org.apache.servicemix.jbi.container
Class EnvironmentContext

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.jbi.management.BaseSystemService
          extended by org.apache.servicemix.jbi.container.EnvironmentContext
All Implemented Interfaces:
javax.jbi.management.LifeCycleMBean, EnvironmentContextMBean, MBeanInfoProvider

public class EnvironmentContext
extends BaseSystemService
implements EnvironmentContextMBean

Holder for environment information (component root dir) |-> version_X (versionned dir) \-> workspace (workspace dir) ServiceAssembly root \-> version_X (versionned dir) |-> install (unzip dir) \-> sus (service units dir) |-> |->

Version:
$Revision: 564900 $

Field Summary
 
Fields inherited from class org.apache.servicemix.jbi.management.BaseSystemService
container
 
Fields inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
currentState, INITIALIZED, listener
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
EnvironmentContext()
           
 
Method Summary
 File createComponentRootDir(String componentName)
          Create root directory for a Component
 File createSharedLibraryDirectory(String name)
          create a shared library directory
 File createWorkspaceDirectory(String componentName)
          Create workspace directory for a Component
 ComponentEnvironment getComponentEnvironment(String compName)
           
 File getComponentInstallationDir(String componentName)
          Create installation directory for a Component
 File getComponentRootDir(String componentName)
          Get root directory for a Component
 File getComponentsDir()
           
 File getDeploymentDir()
           
 String getDescription()
          Get Description
 File getInstallationDir()
           
 File getJbiRootDir()
           
 ComponentEnvironment getNewComponentEnvironment(String compName)
           
 File getNewComponentInstallationDir(String componentName)
          Get a new versionned directory for installation
 ServiceAssemblyEnvironment getNewServiceAssemblyEnvironment(String saName)
           
 File getServiceAssembliesDir()
           
 ServiceAssemblyEnvironment getServiceAssemblyEnvironment(String saName)
           
protected  Class getServiceMBean()
           
 File getSharedLibDir()
           
 File getTmpDir()
           
static String getVersion()
           
 void init(JBIContainer container, String rootDirPath)
          Initialize the Environment
 ComponentEnvironment registerComponent(ComponentEnvironment result, ComponentMBeanImpl connector)
          register the ComponentConnector
 ComponentEnvironment registerComponent(ComponentMBeanImpl connector)
          register the ComponentConnector
 void removeComponentRootDirectory(String componentName)
          Remove the Component root directory from the local file system
 void removeSharedLibraryDirectory(String name)
          remove shared library directory
 void setDeploymentDir(File deploymentDir)
           
 void setInstallationDir(File installationDir)
          Set the installationDir - rge default location is root//installation
 void shutDown()
          Shut down the item.
 void start()
          Start the item.
 void stop()
          Stop the item.
 void unreregister(ComponentMBeanImpl connector)
          deregister the ComponentConnector
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseSystemService
getContainer, getName, getType, init
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
firePropertyChanged, getAttributeInfos, getCurrentState, getObjectToManage, getOperationInfos, getSubType, init, isInitialized, isShutDown, isStarted, isStopped, isUnknown, setCurrentState, setPropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jbi.management.LifeCycleMBean
getCurrentState
 

Constructor Detail

EnvironmentContext

public EnvironmentContext()
Method Detail

getVersion

public static String getVersion()
Returns:
the current version of servicemix

getDescription

public String getDescription()
Get Description

Specified by:
getDescription in interface MBeanInfoProvider
Returns:
description

getComponentsDir

public File getComponentsDir()
Returns:
Returns the componentsDir.

getInstallationDir

public File getInstallationDir()
Returns:
Returns the installationDir.

setInstallationDir

public void setInstallationDir(File installationDir)
Set the installationDir - rge default location is root//installation

Parameters:
installationDir -

getDeploymentDir

public File getDeploymentDir()
Returns:
Returns the deploymentDir.

setDeploymentDir

public void setDeploymentDir(File deploymentDir)
Parameters:
deploymentDir - The deploymentDir to set.

getSharedLibDir

public File getSharedLibDir()
Returns:
Returns the shared library directory

getTmpDir

public File getTmpDir()
Returns:
Returns the tmpDir

getServiceAssembliesDir

public File getServiceAssembliesDir()
Returns:
Returns service asseblies directory

init

public void init(JBIContainer container,
                 String rootDirPath)
          throws javax.jbi.JBIException
Initialize the Environment

Parameters:
container -
rootDirPath -
Throws:
javax.jbi.JBIException - if the root directory informed could not be created or it is not a directory

getServiceMBean

protected Class getServiceMBean()
Specified by:
getServiceMBean in class BaseSystemService

start

public void start()
           throws javax.jbi.JBIException
Start the item.

Specified by:
start in interface javax.jbi.management.LifeCycleMBean
Overrides:
start in class BaseLifeCycle
Throws:
javax.jbi.JBIException - if the item fails to start.

stop

public void stop()
          throws javax.jbi.JBIException
Stop the item. This suspends current messaging activities.

Specified by:
stop in interface javax.jbi.management.LifeCycleMBean
Overrides:
stop in class BaseLifeCycle
Throws:
javax.jbi.JBIException - if the item fails to stop.

shutDown

public void shutDown()
              throws javax.jbi.JBIException
Shut down the item. The releases resources, preparatory to uninstallation.

Specified by:
shutDown in interface javax.jbi.management.LifeCycleMBean
Overrides:
shutDown in class BaseSystemService
Throws:
javax.jbi.JBIException - if the item fails to shut down.

registerComponent

public ComponentEnvironment registerComponent(ComponentMBeanImpl connector)
                                       throws javax.jbi.JBIException
register the ComponentConnector

Parameters:
connector -
Returns:
the CompponentEnvironment
Throws:
javax.jbi.JBIException

registerComponent

public ComponentEnvironment registerComponent(ComponentEnvironment result,
                                              ComponentMBeanImpl connector)
                                       throws javax.jbi.JBIException
register the ComponentConnector

Parameters:
connector -
Returns:
the CompponentEnvironment
Throws:
javax.jbi.JBIException

getComponentRootDir

public File getComponentRootDir(String componentName)
Get root directory for a Component

Parameters:
componentName -
Returns:
directory for deployment/workspace etc
Throws:
IOException

createComponentRootDir

public File createComponentRootDir(String componentName)
                            throws IOException
Create root directory for a Component

Parameters:
componentName -
Returns:
directory for deployment/workspace etc
Throws:
IOException

getNewComponentInstallationDir

public File getNewComponentInstallationDir(String componentName)
                                    throws IOException
Get a new versionned directory for installation

Parameters:
componentName -
Returns:
Throws:
IOException

getComponentInstallationDir

public File getComponentInstallationDir(String componentName)
                                 throws IOException
Create installation directory for a Component

Parameters:
componentName -
Returns:
directory to deploy in
Throws:
IOException

getNewComponentEnvironment

public ComponentEnvironment getNewComponentEnvironment(String compName)
                                                throws IOException
Throws:
IOException

getComponentEnvironment

public ComponentEnvironment getComponentEnvironment(String compName)
                                             throws IOException
Throws:
IOException

getNewServiceAssemblyEnvironment

public ServiceAssemblyEnvironment getNewServiceAssemblyEnvironment(String saName)
                                                            throws IOException
Throws:
IOException

getServiceAssemblyEnvironment

public ServiceAssemblyEnvironment getServiceAssemblyEnvironment(String saName)

createWorkspaceDirectory

public File createWorkspaceDirectory(String componentName)
                              throws IOException
Create workspace directory for a Component

Parameters:
componentName -
Returns:
directory workspace
Throws:
IOException

unreregister

public void unreregister(ComponentMBeanImpl connector)
deregister the ComponentConnector

Parameters:
connector -
doDelete - true if component is to be deleted

removeComponentRootDirectory

public void removeComponentRootDirectory(String componentName)
Remove the Component root directory from the local file system

Parameters:
componentName -

createSharedLibraryDirectory

public File createSharedLibraryDirectory(String name)
create a shared library directory

Parameters:
name -
Returns:
directory
Throws:
IOException

removeSharedLibraryDirectory

public void removeSharedLibraryDirectory(String name)
remove shared library directory

Parameters:
name -
Throws:
IOException

getJbiRootDir

public File getJbiRootDir()


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.