public class DefaultPackagerFactory extends AbstractIntrospectionGenericHintFactory 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 Object |
createInstance(Constructor 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 |
getConstructor(Class deployerClass,
String hint,
AbstractGenericHintFactory.GenericParameters parameters)
Create a constructor.
|
boolean |
isPackagerRegistered(String containerId,
PackagerType packagerType) |
void |
registerPackager(String containerId,
PackagerType packagerType,
Class packagerClass)
Registers a
Packager implementation. |
void |
registerPackager(String containerId,
PackagerType packagerType,
String packagerClassName)
Registers a packager using a class specified as a String.
|
createImplementation, registerImplementation
getMapping, getMappings, hasMapping, registerImplementation
public 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 packagerClass)
Packager
implementation.registerPackager
in interface PackagerFactory
containerId
- 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 PackagerFactory
containerId
- 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 PackagerFactory
containerId
- 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 getConstructor(Class deployerClass, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws NoSuchMethodException
getConstructor
in class AbstractGenericHintFactory
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 Object createInstance(Constructor constructor, String hint, AbstractGenericHintFactory.GenericParameters parameters) throws Exception
createInstance
in class AbstractGenericHintFactory
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, java.lang.String, org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.GenericParameters)
Copyright © 2004-2013 Codehaus. All Rights Reserved.