org.apache.geronimo.kernel.config
Interface ConfigurationManager

All Known Subinterfaces:
EditableConfigurationManager
All Known Implementing Classes:
EditableKernelConfigurationManager, SimpleConfigurationManager

public interface ConfigurationManager

Encapsulates logic for dealing with configurations.

Version:
$Rev: 405881 $ $Date: 2006-05-12 23:29:24 +0200 (Fri, 12 May 2006) $

Method Summary
 ArtifactResolver getArtifactResolver()
          Gets the common ArtifactResolver in case the caller wants to use this directly.
 Configuration getConfiguration(Artifact configurationId)
          Gets a loaded Configuration (does not see unloaded configurations).
 Artifact[] getInstalled(Artifact query)
          Given an artifact that's not fully resolved (e.g.
 Artifact[] getLoaded(Artifact query)
          Given an artifact that's not fully resolved (e.g.
 Artifact[] getRunning(Artifact query)
          Given an artifact that's not fully resolved (e.g.
 ConfigurationStore getStoreForConfiguration(Artifact configuration)
          Gets the configuration store responsible for the specified configuration, or null if there is none.
 ConfigurationStore[] getStores()
          Get all the ConfigurationStores known to this manager at present
 boolean isConfiguration(Artifact artifact)
          Is the specified artifact a configuration?
 boolean isInstalled(Artifact configurationId)
          Is the specified configuration installed into the server environment? That is, does it exist in the configuration store, regardless of whether it's loaded or running? Note that this always returns false if the argument does not represent a configuration (e.g.
 boolean isLoaded(Artifact configurationId)
          Is the specified configuration loaded into the kernel? Note that this always returns false if the argument does not represent a configuration (e.g.
 boolean isOnline()
          Online means full functionality.
 boolean isRunning(Artifact configurationId)
          Is the specified configuation running? Note that this always returns false if the argument does not represent a configuration (e.g.
 List listConfigurations()
          Gets a List>ConfigurationInfo< of every of every available configuation.
 List listConfigurations(org.apache.geronimo.gbean.AbstractName store)
          Return a list of the configurations in a specific store.
 List listStores()
          Return a list of the stores this manager knows about.
 LifecycleResults loadConfiguration(Artifact configurationId)
          Load the specified configuration (from a config store) and all configurations it depends on into the kernel.
 LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor)
          Load the specified configuration (from a config store) and all configurations it depends on into the kernel.
 LifecycleResults loadConfiguration(ConfigurationData configurationData)
          Load the specified configurationData and all configurations it depends on (from a config store) into the kernel.
 LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor)
          Load the specified configurationData and all configurations it depends on (from a config store) into the kernel.
 LifecycleResults reloadConfiguration(Artifact configurationId)
          Reloads the specified configuration and all configurations that have a dependency on the specified configuration
 LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor)
          Reloads the specified configuration and all configurations that have a dependency on the specified configuration
 LifecycleResults reloadConfiguration(Artifact configurationId, Version version)
          Reloads the specified configuration and all configurations that have a dependency on the specified configuration
 LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor)
          Reloads the specified configuration and all configurations that have a dependency on the specified configuration
 LifecycleResults reloadConfiguration(ConfigurationData configurationData)
          Reloads the specified configuration and all configurations that have a dependency on the specified configuration
 LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor)
          Reloads the specified configuration and all configurations that have a dependency on the specified configuration
 LifecycleResults restartConfiguration(Artifact configurationId)
          Restarts the specified configuration and all configurations that have a service dependency on the specified configuration
 LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor)
          Restarts the specified configuration and all configurations that have a service dependency on the specified configuration
 void setOnline(boolean online)
           
 LifecycleResults startConfiguration(Artifact configurationId)
          Loads and starts all of the gbeans contained within the configuration.
 LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor)
          Loads and starts all of the gbeans contained within the configuration.
 LifecycleResults stopConfiguration(Artifact configurationId)
          Stop the gbeans contained within the configuration.
 LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor)
          Stop the gbeans contained within the configuration.
 void uninstallConfiguration(Artifact configurationId)
          Unstalls the specified configuration from the server.
 LifecycleResults unloadConfiguration(Artifact configurationId)
          Stops and unloads the configuration.
 LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor)
          Stops and unloads the configuration.
 

Method Detail

isInstalled

public boolean isInstalled(Artifact configurationId)
Is the specified configuration installed into the server environment? That is, does it exist in the configuration store, regardless of whether it's loaded or running? Note that this always returns false if the argument does not represent a configuration (e.g. if it's for a plain JAR).

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
true if the configuration has been loaded; false otherwise

isLoaded

public boolean isLoaded(Artifact configurationId)
Is the specified configuration loaded into the kernel? Note that this always returns false if the argument does not represent a configuration (e.g. if it's for a plain JAR).

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
true if the configuration has been loaded; false otherwise

isRunning

public boolean isRunning(Artifact configurationId)
Is the specified configuation running? Note that this always returns false if the argument does not represent a configuration (e.g. if it's for a plain JAR).

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
true if the configuration is running, false otherwise

getInstalled

public Artifact[] getInstalled(Artifact query)
Given an artifact that's not fully resolved (e.g. some parts are missing), check whether there are any instances installed into the server environment. That is, are there any matches in the configuration store, regardless of whether they're loaded or running? Note that this always returns an empty array if the argument does not represent a configuration (e.g. if it's for a plain JAR).

Parameters:
query - The partially-complete artifact name to check for
Returns:
All matching artifacts that are loaded in the server

getLoaded

public Artifact[] getLoaded(Artifact query)
Given an artifact that's not fully resolved (e.g. some parts are missing), check whether there are any instances loaded. Note that this always returns an empty array if the argument does not represent a configuration (e.g. if it's for a plain JAR).

Parameters:
query - The partially-complete artifact name to check for
Returns:
All matching artifacts that are loaded in the server

getRunning

public Artifact[] getRunning(Artifact query)
Given an artifact that's not fully resolved (e.g. some parts are missing), check whether there are any instances running. Note that this always returns an empty array if the argument does not represent a configuration (e.g. if it's for a plain JAR).

Parameters:
query - The partially-complete artifact name to check for
Returns:
All matching artifacts that are loaded in the server

listConfigurations

public List listConfigurations()
Gets a List>ConfigurationInfo< of every of every available configuation. This includes all configurations installed, regardless of whether they are currently loaded or running.


listStores

public List listStores()
Return a list of the stores this manager knows about.

Returns:
a List>AbstractName< of the stores this manager controls

getStores

public ConfigurationStore[] getStores()
Get all the ConfigurationStores known to this manager at present


getStoreForConfiguration

public ConfigurationStore getStoreForConfiguration(Artifact configuration)
Gets the configuration store responsible for the specified configuration, or null if there is none. The configuration need not be loaded or running; this just checks which store holds the data for it.

Parameters:
configuration - The unique ID for the configuration to check for, which must be fully resolved (isResolved() == true)
Returns:
The ConfigurationStore for this configuration, or null if the configuration was not found in any configuration store.

listConfigurations

public List listConfigurations(org.apache.geronimo.gbean.AbstractName store)
                        throws NoSuchStoreException
Return a list of the configurations in a specific store.

Parameters:
store - the store to list
Returns:
a List>ConfigurationInfo< of all the configurations in the store
Throws:
NoSuchStoreException - if the store could not be located

isConfiguration

public boolean isConfiguration(Artifact artifact)
Is the specified artifact a configuration?

Parameters:
artifact - the ID of the artifact to check, which must be fully resolved (isResolved() == true)
Returns:
true if the artifact is a configuration available in the server (regardless of whether it has been loaded/started)

getConfiguration

public Configuration getConfiguration(Artifact configurationId)
Gets a loaded Configuration (does not see unloaded configurations).

Parameters:
configurationId - the unique ID of the configuration to get, which must be fully resolved (isResolved() == true)
Returns:
the specified configuration or null if the configuration has not been loaded

loadConfiguration

public LifecycleResults loadConfiguration(Artifact configurationId)
                                   throws NoSuchConfigException,
                                          LifecycleException
Load the specified configuration (from a config store) and all configurations it depends on into the kernel. This causes the configuration gbean to be loaded and started, but does not load any of the gbeans contained within the configuration.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
the results of the operation
Throws:
NoSuchConfigException - if no configuration with the given id exists in the configuration stores
LifecycleException - if there is a problem loading the configuration

loadConfiguration

public LifecycleResults loadConfiguration(ConfigurationData configurationData)
                                   throws NoSuchConfigException,
                                          LifecycleException
Load the specified configurationData and all configurations it depends on (from a config store) into the kernel. This causes the configuration gbean to be loaded and started, but does not load any of the gbeans contained within the configuration.

Parameters:
configurationData - the configuration to load
Returns:
the results of the operation
Throws:
NoSuchConfigException - if no configuration with the given id exists in the configuration stores
LifecycleException - if there is a problem loading the configuration

loadConfiguration

public LifecycleResults loadConfiguration(Artifact configurationId,
                                          LifecycleMonitor monitor)
                                   throws NoSuchConfigException,
                                          LifecycleException
Load the specified configuration (from a config store) and all configurations it depends on into the kernel. This causes the configuration gbean to be loaded and started, but does not load any of the gbeans contained within the configuration.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
monitor - the monitor that should receive events as the operation is carried out
Returns:
the results of the operation
Throws:
NoSuchConfigException - if no configuration with the given id exists in the configuration stores
LifecycleException - if there is a problem loading the configuration

loadConfiguration

public LifecycleResults loadConfiguration(ConfigurationData configurationData,
                                          LifecycleMonitor monitor)
                                   throws NoSuchConfigException,
                                          LifecycleException
Load the specified configurationData and all configurations it depends on (from a config store) into the kernel. This causes the configuration gbean to be loaded and started, but does not load any of the gbeans contained within the configuration.

Parameters:
configurationData - the configuration to load
monitor - the monitor that should receive events as the operation is carried out
Returns:
the results of the operation
Throws:
NoSuchConfigException - if no configuration with the given id exists in the configuration stores
LifecycleException - if there is a problem loading the configuration

unloadConfiguration

public LifecycleResults unloadConfiguration(Artifact configurationId)
                                     throws NoSuchConfigException
Stops and unloads the configuration. This causes all contained gbeans to be stopped and unloaded, and the configuration gbean is stopped and unloaded. This operation causes all configurations that have a class or service dependency on the specified configuration to be stopped and unloaded.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded

unloadConfiguration

public LifecycleResults unloadConfiguration(Artifact configurationId,
                                            LifecycleMonitor monitor)
                                     throws NoSuchConfigException
Stops and unloads the configuration. This causes all contained gbeans to be stopped and unloaded, and the configuration gbean is stopped and unloaded. This operation causes all configurations that have a class or service dependency on the specified configuration to be stopped and unloaded.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
monitor - the monitor that should receive events as the operation is carried out
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded

startConfiguration

public LifecycleResults startConfiguration(Artifact configurationId)
                                    throws NoSuchConfigException,
                                           LifecycleException
Loads and starts all of the gbeans contained within the configuration. If any of the gbeans fails to fully start, all gbeans will be unloaded and an exception will be thrown. This operation causes all configurations that the specified configuration has a service dependency on to be started.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException

startConfiguration

public LifecycleResults startConfiguration(Artifact configurationId,
                                           LifecycleMonitor monitor)
                                    throws NoSuchConfigException,
                                           LifecycleException
Loads and starts all of the gbeans contained within the configuration. If any of the gbeans fails to fully start, all gbeans will be unloaded and an exception will be thrown. This operation causes all configurations that the specified configuration has a service dependency on to be started.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
monitor - the monitor that should receive events as the operation is carried out
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException

stopConfiguration

public LifecycleResults stopConfiguration(Artifact configurationId)
                                   throws NoSuchConfigException
Stop the gbeans contained within the configuration. This operation causes all configurations that have a service dependency on the specified configuration to be stopped.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded

stopConfiguration

public LifecycleResults stopConfiguration(Artifact configurationId,
                                          LifecycleMonitor monitor)
                                   throws NoSuchConfigException
Stop the gbeans contained within the configuration. This operation causes all configurations that have a service dependency on the specified configuration to be stopped.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
monitor - the monitor that should receive events as the operation is carried out
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded

restartConfiguration

public LifecycleResults restartConfiguration(Artifact configurationId)
                                      throws NoSuchConfigException,
                                             LifecycleException
Restarts the specified configuration and all configurations that have a service dependency on the specified configuration

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException - if there is a problem loading the configuration

restartConfiguration

public LifecycleResults restartConfiguration(Artifact configurationId,
                                             LifecycleMonitor monitor)
                                      throws NoSuchConfigException,
                                             LifecycleException
Restarts the specified configuration and all configurations that have a service dependency on the specified configuration

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
monitor - the monitor that should receive events as the operation is carried out
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException - if there is a problem loading the configuration

reloadConfiguration

public LifecycleResults reloadConfiguration(Artifact configurationId)
                                     throws NoSuchConfigException,
                                            LifecycleException
Reloads the specified configuration and all configurations that have a dependency on the specified configuration

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException - if there is a problem loading the configuration

reloadConfiguration

public LifecycleResults reloadConfiguration(Artifact configurationId,
                                            LifecycleMonitor monitor)
                                     throws NoSuchConfigException,
                                            LifecycleException
Reloads the specified configuration and all configurations that have a dependency on the specified configuration

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
monitor - the monitor that should receive events as the operation is carried out
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException - if there is a problem loading the configuration

reloadConfiguration

public LifecycleResults reloadConfiguration(Artifact configurationId,
                                            Version version)
                                     throws NoSuchConfigException,
                                            LifecycleException
Reloads the specified configuration and all configurations that have a dependency on the specified configuration

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
version - new version to load from the config store
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException - if there is a problem loading the configuration

reloadConfiguration

public LifecycleResults reloadConfiguration(Artifact configurationId,
                                            Version version,
                                            LifecycleMonitor monitor)
                                     throws NoSuchConfigException,
                                            LifecycleException
Reloads the specified configuration and all configurations that have a dependency on the specified configuration

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
monitor - the monitor that should receive events as the operation is carried out
version - new version to load from the config store
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException - if there is a problem loading the configuration

reloadConfiguration

public LifecycleResults reloadConfiguration(ConfigurationData configurationData)
                                     throws NoSuchConfigException,
                                            LifecycleException
Reloads the specified configuration and all configurations that have a dependency on the specified configuration

Parameters:
configurationData - the configuration to load
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException - if there is a problem loading the configuration

reloadConfiguration

public LifecycleResults reloadConfiguration(ConfigurationData configurationData,
                                            LifecycleMonitor monitor)
                                     throws NoSuchConfigException,
                                            LifecycleException
Reloads the specified configuration and all configurations that have a dependency on the specified configuration

Parameters:
configurationData - the configuration to load
monitor - the monitor that should receive events as the operation is carried out
Returns:
the results of the operation
Throws:
NoSuchConfigException - if the configuration is not loaded
LifecycleException - if there is a problem loading the configuration

uninstallConfiguration

public void uninstallConfiguration(Artifact configurationId)
                            throws IOException,
                                   NoSuchConfigException
Unstalls the specified configuration from the server. This operation can not be reversed.

Parameters:
configurationId - the configuration identifier, which must be fully resolved (isResolved() == true)
Throws:
IOException - if there was a problem removing the configuration
NoSuchConfigException - if the configuration is not loaded

getArtifactResolver

public ArtifactResolver getArtifactResolver()
Gets the common ArtifactResolver in case the caller wants to use this directly. It is configured for all the repositories known to this configuration manager, etc.


isOnline

public boolean isOnline()
Online means full functionality. Offline typically means that configurations will never be started, although they may be marked in the persistent configuration list.

Returns:
online status of ConfigurationManager

setOnline

public void setOnline(boolean online)


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.