Home » geronimo-2.2-source-release » org.apache.geronimo.kernel.config » [javadoc | source]
org.apache.geronimo.kernel.config
public class: Configuration [javadoc | source]
java.lang.Object
   org.apache.geronimo.kernel.config.Configuration

All Implemented Interfaces:
    GBeanLifecycle, ConfigurationParent

A Configuration represents a collection of runnable services that can be loaded into a Geronimo Kernel and brought online. The primary components in a Configuration are a codebase, represented by a collection of URLs that is used to locate classes, and a collection of GBean instances that define its state.

The persistent attributes of the Configuration are:

When a configuration is started, it converts the URIs into a set of absolute URLs by resolving them against the specified baseURL (this would typically be the root of the CAR file which contains the configuration) and then constructs a ClassLoader for that codebase. That ClassLoader is then used to de-serialize the persisted GBeans, ensuring the GBeans can be recycled as necessary. Once the GBeans have been restored, they are brought online by registering them with the MBeanServer.

A dependency on the Configuration is created for every GBean it loads. As a result, a startRecursive() operation on the configuration will result in a startRecursive() for all the GBeans it contains. Similarly, if the Configuration is stopped then all of its GBeans will be stopped as well.

Field Summary
 List<Configuration> children    The nested configurations of this configuration. 
public static final  GBeanInfo GBEAN_INFO     
Constructor:
 public Configuration() 
 public Configuration(Collection<Configuration> parents,
    ConfigurationData configurationData,
    ConfigurationResolver configurationResolver,
    ManageableAttributeStore attributeStore) throws MissingDependencyException, MalformedURLException, NoSuchConfigException, InvalidConfigException 
    Creates a configuration.
    Parameters:
    parents - parents of this configuation (not ordered)
    configurationData - the module type, environment and classpath of the configuration
    configurationResolver - used to resolve dependecies and paths
Method from org.apache.geronimo.kernel.config.Configuration Summary:
addGBean,   addGBean,   addToClassPath,   containsGBean,   doFail,   doStart,   doStop,   findGBean,   findGBean,   findGBean,   findGBeanData,   findGBeanData,   findGBeanDatas,   findGBeanDatas,   findGBeans,   findGBeans,   findGBeans,   getAbstractName,   getChildren,   getClassParents,   getClassPath,   getConfigurationAbstractName,   getConfigurationClassLoader,   getConfigurationData,   getConfigurationDir,   getConfigurationID,   getConfigurationResolver,   getCreated,   getDependencies,   getEnclosingConfiguration,   getEnvironment,   getGBeanInfo,   getGBeans,   getId,   getManageableAttributeStore,   getModuleType,   getObjectName,   getOwnedConfigurations,   getServiceParents,   isConfigurationObjectName,   removeGBean
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.geronimo.kernel.config.Configuration Detail:
 public synchronized  void addGBean(GBeanData gbean) throws GBeanAlreadyExistsException 
 public synchronized AbstractName addGBean(String name,
    GBeanData gbean) throws GBeanAlreadyExistsException 
 public  void addToClassPath(String pattern) throws IOException 
 public synchronized boolean containsGBean(AbstractName gbean) 
    Determines of this configuration constains the specified GBean.
 public  void doFail() 
 public  void doStart() throws Exception 
 public synchronized  void doStop() throws Exception 
 public AbstractName findGBean(AbstractNameQuery pattern) throws GBeanNotFoundException 
 public AbstractName findGBean(ReferencePatterns referencePatterns) throws GBeanNotFoundException 
 public AbstractName findGBean(Set<AbstractNameQuery> patterns) throws GBeanNotFoundException 
 public GBeanData findGBeanData(AbstractNameQuery pattern) throws GBeanNotFoundException 
 public GBeanData findGBeanData(Set<AbstractNameQuery> patterns) throws GBeanNotFoundException 
 public LinkedHashSet<GBeanData> findGBeanDatas(Set<AbstractNameQuery> patterns) 
 public LinkedHashSet<GBeanData> findGBeanDatas(Configuration configuration,
    Set<AbstractNameQuery> patterns) 
    Find the gbeanDatas matching the patterns in this configuration only, ignoring parents.
 public LinkedHashSet<AbstractName> findGBeans(AbstractNameQuery pattern) 
 public LinkedHashSet<AbstractName> findGBeans(ReferencePatterns referencePatterns) 
 public LinkedHashSet<AbstractName> findGBeans(Set<AbstractNameQuery> patterns) 
 public AbstractName getAbstractName() 
 public List<Configuration> getChildren() 
    Gets the nested configurations of this configuration. That is, the configurations within this one as a WAR can be within an EAR; not including wholly separate configurations that just depend on this one as a parent.
 public List<Configuration> getClassParents() 
    Gets the parent configurations used for class loading.
 public List<String> getClassPath() 
    Gets the relative class path (URIs) of this configuration.
 public static AbstractName getConfigurationAbstractName(Artifact configId) throws InvalidConfigException 
    Converts an Artifact to an AbstractName for a configuration. Does not validate that this is a reasonable or resolved Artifact, or that it corresponds to an actual Configuration.
 public ClassLoader getConfigurationClassLoader() 
    Gets the class loader for this configuration.
 ConfigurationData getConfigurationData() 
    This is used by the configuration manager to restart an existing configuation. Do not modify the configuration data.
 public File getConfigurationDir() 
 public static Artifact getConfigurationID(ObjectName objectName) 
 public ConfigurationResolver getConfigurationResolver() 
Deprecated! this - is only exposed temporarily for configuration manager

 public long getCreated() 
    Gets the time at which this configuration was created (or deployed).
 public LinkedHashSet<Artifact> getDependencies() 
    Gets the artifact dependencies of this configuration.
 public Configuration getEnclosingConfiguration() 
    Gets the enclosing configuration of this one (e.g. the EAR for a WAR), or null if it has none.
 public Environment getEnvironment() 
    Gets the declaration of the environment in which this configuration runs.
 public static GBeanInfo getGBeanInfo() 
 public Map<AbstractName, GBeanData> getGBeans() 
    Gets an unmodifiable collection of the GBeanDatas for the GBeans in this configuration.
 public Artifact getId() 
    Return the unique Id
 ManageableAttributeStore getManageableAttributeStore() 
    Gets the manageable attribute store for this configuration. This is used in the configuration manager to apply overrides
 public ConfigurationModuleType getModuleType() 
    Gets the type of the configuration (WAR, RAR et cetera)
 public String getObjectName() 
    Gets the unique name of this configuration within the kernel.
 public Set<Artifact> getOwnedConfigurations() 
    Gets the configurations owned by this configuration. This is only used for cascade-uninstall.
 public List<Configuration> getServiceParents() 
    Gets the parent configurations used for service resolution.
 public static boolean isConfigurationObjectName(ObjectName name) 
 public synchronized  void removeGBean(AbstractName name) throws GBeanNotFoundException