public class DefaultPackagerFactory extends AbstractIntrospectionGenericHintFactory<Packager> implements PackagerFactory
PackagerFactory implementation that has all the known container packagers
registered against their containers. It also supports registering new packagers against any
container.AbstractGenericHintFactory.GenericParameters| Constructor and Description |
|---|
DefaultPackagerFactory()
Register default deployers.
|
DefaultPackagerFactory(ClassLoader classLoader)
Register packager name mappings.
|
| Modifier and Type | Method and Description |
|---|---|
protected Packager |
createInstance(Constructor<? extends Packager> constructor,
String hint,
AbstractGenericHintFactory.GenericParameters parameters)
Create an implementation class instance.
|
Packager |
createPackager(String containerId,
PackagerType packagerType,
String outputLocation)
Create a
Packager instance matching the
specified container id. |
protected Constructor<? extends Packager> |
getConstructor(Class<? extends Packager> deployerClass,
String hint,
AbstractGenericHintFactory.GenericParameters parameters)
Create a constructor.
|
boolean |
isPackagerRegistered(String containerId,
PackagerType packagerType) |
void |
registerPackager(String containerId,
PackagerType packagerType,
Class<? extends Packager> packagerClass)
Registers a
Packager implementation. |
void |
registerPackager(String containerId,
PackagerType packagerType,
String packagerClassName)
Registers a packager using a class specified as a String.
|
createImplementation, registerImplementationgetMapping, getMappings, hasMapping, registerImplementationpublic DefaultPackagerFactory()
public DefaultPackagerFactory(ClassLoader classLoader)
classLoader - ClassLoader to discover implementations from. See
AbstractFactoryRegistry.register(ClassLoader, PackagerFactory) for the
details of what this value means.public void registerPackager(String containerId, PackagerType packagerType, Class<? extends Packager> packagerClass)
Packager implementation.registerPackager in interface PackagerFactorycontainerId - the container attached to this packagerpackagerType - the packager's type (directory, zip, etc)packagerClass - the packager implementation class to registerPackagerFactory.registerPackager(String,
org.codehaus.cargo.container.packager.PackagerType, Class)public void registerPackager(String containerId, PackagerType packagerType, String packagerClassName)
containerId - packagerType - packagerClassName - the packager implementation class to register as a StringregisterPackager(String, org.codehaus.cargo.container.packager.PackagerType, Class)public boolean isPackagerRegistered(String containerId, PackagerType packagerType)
isPackagerRegistered in interface PackagerFactorycontainerId - the container attached to this packager classpackagerType - the type to differentiate this packager from others for the specified
containerPackagerFactory.isPackagerRegistered(String,
org.codehaus.cargo.container.packager.PackagerType)public Packager createPackager(String containerId, PackagerType packagerType, String outputLocation)
Packager instance matching the
specified container id.createPackager in interface PackagerFactorycontainerId - the container for which we need to create a packager instancepackagerType - the packager's type (directory, zip, etc)outputLocation - the location where the package will be generated. For example for a
Directory Packager this will be the directory into which the package will be generated.PackagerFactory.createPackager(java.lang.String, org.codehaus.cargo.container.packager.PackagerType, java.lang.String)protected Constructor<? extends Packager> getConstructor(Class<? extends Packager> deployerClass, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws NoSuchMethodException
getConstructor in class AbstractGenericHintFactory<Packager>deployerClass - implementation class for which to create the constructorhint - the hint to differentiate this implementation class from othersparameters - additional parameters necessary to create the constructor objectNoSuchMethodException - in case of errorAbstractGenericHintFactory.getConstructor(Class, String,
org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.GenericParameters)protected Packager createInstance(Constructor<? extends Packager> constructor, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws Exception
createInstance in class AbstractGenericHintFactory<Packager>constructor - the constructor to use for creating the instancehint - the hint to differentiate this implementation class from othersparameters - additional parameters necessary to create the instanceException - in case of errorAbstractGenericHintFactory.createInstance(java.lang.reflect.Constructor<? extends T>, java.lang.String, org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.GenericParameters)Copyright © 2004–2015 Github. All rights reserved.