org.codehaus.cargo.generic
Class AbstractFactoryRegistry

java.lang.Object
  extended by org.codehaus.cargo.generic.AbstractFactoryRegistry

public abstract class AbstractFactoryRegistry
extends java.lang.Object

SPI to be implemented by container implementation to register implementations to their factories.

This class also provides static methods (to be used primarily within Cargo but can be also called directly by client apps) to discover all the implementations and register them to factories.

Client apps should normally use DefaultXXXFactory classes, like DefaultDeployableFactory, which internally uses the discovery mechanism

Container implementors should override the 1-arg register methods to register its implementations to the given factory.

Version:
$Id: AbstractFactoryRegistry.java 1705 2008-09-02 13:14:55Z adriana $

Constructor Summary
AbstractFactoryRegistry()
           
 
Method Summary
static void register(java.lang.ClassLoader classLoader, ConfigurationCapabilityFactory factory)
          See register(ClassLoader, DeployableFactory) for the semantics.
static void register(java.lang.ClassLoader classLoader, ConfigurationFactory factory)
          See register(ClassLoader, DeployableFactory) for the semantics.
static void register(java.lang.ClassLoader classLoader, ContainerCapabilityFactory factory)
          See register(ClassLoader, DeployableFactory) for the semantics.
static void register(java.lang.ClassLoader classLoader, ContainerFactory factory)
          See register(ClassLoader, DeployableFactory) for the semantics.
static void register(java.lang.ClassLoader classLoader, DeployableFactory factory)
          Discovers all the Deployables and adds them to the given DeployableFactory.
static void register(java.lang.ClassLoader classLoader, DeployerFactory factory)
          See register(ClassLoader, DeployableFactory) for the semantics.
static void register(java.lang.ClassLoader classLoader, PackagerFactory factory)
          See register(ClassLoader, DeployableFactory) for the semantics.
protected abstract  void register(ConfigurationCapabilityFactory factory)
          See register(DeployableFactory) for the semantics.
protected abstract  void register(ConfigurationFactory factory)
          See register(DeployableFactory) for the semantics.
protected abstract  void register(ContainerCapabilityFactory factory)
          See register(DeployableFactory) for the semantics.
protected abstract  void register(ContainerFactory factory)
          See register(DeployableFactory) for the semantics.
protected abstract  void register(DeployableFactory factory)
          Registers Deployable implementations to the given DeployableFactory.
protected abstract  void register(DeployerFactory factory)
          See register(DeployableFactory) for the semantics.
protected abstract  void register(PackagerFactory factory)
          See register(DeployableFactory) for the semantics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFactoryRegistry

public AbstractFactoryRegistry()
Method Detail

register

public static void register(java.lang.ClassLoader classLoader,
                            DeployableFactory factory)
Discovers all the Deployables and adds them to the given DeployableFactory.

The discovery is done by the standard service loader mechanism, by looking for /META-INF/services/org.codehaus.cargo.generic.AbstractFactoryRegistry files.

Parameters:
classLoader - The class loader to be used to search service provide configuration files. If null, the value defaults to the thread context classloader. If that's also null, the value defaults to the class loader that loaded AbstractFactoryRegistry. In the rare circumstance of that also being null (which means Cargo is loaded in the bootstrap classloader), the value defaults to the system class loader.
factory - The factory whose register method is invoked to receive Deployables that are discovered.

register

public static void register(java.lang.ClassLoader classLoader,
                            ConfigurationFactory factory)
See register(ClassLoader, DeployableFactory) for the semantics.

Parameters:
classLoader - See register(ClassLoader, DeployableFactory) for the semantics.
factory - See register(ClassLoader, DeployableFactory) for the semantics.

register

public static void register(java.lang.ClassLoader classLoader,
                            ConfigurationCapabilityFactory factory)
See register(ClassLoader, DeployableFactory) for the semantics.

Parameters:
classLoader - See register(ClassLoader, DeployableFactory) for the semantics.
factory - See register(ClassLoader, DeployableFactory) for the semantics.

register

public static void register(java.lang.ClassLoader classLoader,
                            DeployerFactory factory)
See register(ClassLoader, DeployableFactory) for the semantics.

Parameters:
classLoader - See register(ClassLoader, DeployableFactory) for the semantics.
factory - See register(ClassLoader, DeployableFactory) for the semantics.

register

public static void register(java.lang.ClassLoader classLoader,
                            PackagerFactory factory)
See register(ClassLoader, DeployableFactory) for the semantics.

Parameters:
classLoader - See register(ClassLoader, DeployableFactory) for the semantics.
factory - See register(ClassLoader, DeployableFactory) for the semantics.

register

public static void register(java.lang.ClassLoader classLoader,
                            ContainerFactory factory)
See register(ClassLoader, DeployableFactory) for the semantics.

Parameters:
classLoader - See register(ClassLoader, DeployableFactory) for the semantics.
factory - See register(ClassLoader, DeployableFactory) for the semantics.

register

public static void register(java.lang.ClassLoader classLoader,
                            ContainerCapabilityFactory factory)
See register(ClassLoader, DeployableFactory) for the semantics.

Parameters:
classLoader - See register(ClassLoader, DeployableFactory) for the semantics.
factory - See register(ClassLoader, DeployableFactory) for the semantics.

register

protected abstract void register(DeployableFactory factory)
Registers Deployable implementations to the given DeployableFactory.

Parameters:
factory - See register(ClassLoader, DeployableFactory)

register

protected abstract void register(ConfigurationCapabilityFactory factory)
See register(DeployableFactory) for the semantics.

Parameters:
factory - See register(DeployableFactory)

register

protected abstract void register(ConfigurationFactory factory)
See register(DeployableFactory) for the semantics.

Parameters:
factory - See register(DeployableFactory)

register

protected abstract void register(DeployerFactory factory)
See register(DeployableFactory) for the semantics.

Parameters:
factory - See register(DeployableFactory)

register

protected abstract void register(PackagerFactory factory)
See register(DeployableFactory) for the semantics.

Parameters:
factory - See register(DeployableFactory)

register

protected abstract void register(ContainerFactory factory)
See register(DeployableFactory) for the semantics.

Parameters:
factory - See register(DeployableFactory)

register

protected abstract void register(ContainerCapabilityFactory factory)
See register(DeployableFactory) for the semantics.

Parameters:
factory - See register(DeployableFactory)


Copyright © 2004-2011 Codehaus. All Rights Reserved.