org.apache.servicemix.jbi.framework
Class InstallationService

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.framework.InstallationService
All Implemented Interfaces:
javax.jbi.management.InstallationServiceMBean, javax.jbi.management.LifeCycleMBean, MBeanInfoProvider

public class InstallationService
extends BaseSystemService
implements javax.jbi.management.InstallationServiceMBean

Installation Service - installs/uninstalls archives

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
InstallationService()
           
 
Method Summary
protected  void buildComponent(File componentDirectory)
           
protected  ComponentContextImpl buildComponentContext(File componentRoot, File installRoot, String name)
           
protected  void buildComponents()
           
protected  void buildSharedLibs()
           
protected  void buildState()
           
protected  boolean containsSharedLibrary(String name)
          returns true if a shared library is already installed
protected  InstallerMBeanImpl doInstallArchive(File tmpDirectory, Descriptor descriptor)
           
protected  InstallerMBeanImpl doInstallComponent(File tmpDirectory, Component descriptor)
           
protected  String doInstallSharedLibrary(File tmpDirectory, SharedLibrary descriptor)
           
 String getDescription()
          Get Description
 MBeanOperationInfo[] getOperationInfos()
          Get an array of MBeanOperationInfo
protected  Class getServiceMBean()
           
 void init(JBIContainer container)
          Initialize the Service
protected  void install(File tmpDir, Properties props, Descriptor root, boolean autoStart)
          Install an archive
 void install(String location, Properties props, boolean autoStart)
          Install an archive
 String installSharedLibrary(String aSharedLibURI)
          Install a shared library jar.
 ObjectName loadInstaller(String aComponentName)
          Load the InstallerMBean for a previously installed component.
 ObjectName loadNewInstaller(String installJarURL)
          Load the installer for a new component from a component installation package.
 boolean uninstallSharedLibrary(String aSharedLibName)
          Uninstall a shared library.
 boolean unloadInstaller(String componentName, boolean isToBeDeleted)
          Unload a JBI Installable Component installer.
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseSystemService
getContainer, getName, getType, shutDown
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
firePropertyChanged, getAttributeInfos, getCurrentState, getObjectToManage, getSubType, init, isInitialized, isShutDown, isStarted, isStopped, isUnknown, setCurrentState, setPropertyChangeListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstallationService

public InstallationService()
Method Detail

getDescription

public String getDescription()
Get Description

Specified by:
getDescription in interface MBeanInfoProvider
Returns:
description of this item

loadNewInstaller

public ObjectName loadNewInstaller(String installJarURL)
Load the installer for a new component from a component installation package.

Specified by:
loadNewInstaller in interface javax.jbi.management.InstallationServiceMBean
Parameters:
installJarURL - - URL locating a jar file containing a JBI Installable Component.
Returns:
- the JMX ObjectName of the InstallerMBean loaded from installJarURL.

loadInstaller

public ObjectName loadInstaller(String aComponentName)
Load the InstallerMBean for a previously installed component.

Specified by:
loadInstaller in interface javax.jbi.management.InstallationServiceMBean
Parameters:
aComponentName - - the component name identifying the installer to load.
Returns:
- the JMX ObjectName of the InstallerMBean loaded from an existing installation context.

unloadInstaller

public boolean unloadInstaller(String componentName,
                               boolean isToBeDeleted)
Unload a JBI Installable Component installer.

Specified by:
unloadInstaller in interface javax.jbi.management.InstallationServiceMBean
Parameters:
componentName - - the component name identifying the installer to unload.
isToBeDeleted - - true if the component is to be deleted as well.
Returns:
- true if the operation was successful, otherwise false.

installSharedLibrary

public String installSharedLibrary(String aSharedLibURI)
Install a shared library jar.

Specified by:
installSharedLibrary in interface javax.jbi.management.InstallationServiceMBean
Parameters:
aSharedLibURI - - URI locating a jar file containing a shared library.
Returns:
- the name of the shared library loaded from aSharedLibURI.

uninstallSharedLibrary

public boolean uninstallSharedLibrary(String aSharedLibName)
Uninstall a shared library.

Specified by:
uninstallSharedLibrary in interface javax.jbi.management.InstallationServiceMBean
Parameters:
aSharedLibName - - the name of the shared library to uninstall.
Returns:
- true iff the uninstall was successful.

init

public void init(JBIContainer container)
          throws javax.jbi.JBIException
Initialize the Service

Overrides:
init in class BaseSystemService
Parameters:
container -
Throws:
javax.jbi.JBIException
javax.jbi.management.DeploymentException

getServiceMBean

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

install

public void install(String location,
                    Properties props,
                    boolean autoStart)
             throws javax.jbi.management.DeploymentException
Install an archive

Parameters:
location -
props -
autoStart -
Throws:
javax.jbi.management.DeploymentException

install

protected void install(File tmpDir,
                       Properties props,
                       Descriptor root,
                       boolean autoStart)
                throws javax.jbi.management.DeploymentException
Install an archive

Parameters:
tmpDir -
root -
autoStart -
Throws:
javax.jbi.management.DeploymentException

getOperationInfos

public MBeanOperationInfo[] getOperationInfos()
                                       throws JMException
Get an array of MBeanOperationInfo

Specified by:
getOperationInfos in interface MBeanInfoProvider
Overrides:
getOperationInfos in class BaseLifeCycle
Returns:
array of OperationInfos
Throws:
JMException

doInstallArchive

protected InstallerMBeanImpl doInstallArchive(File tmpDirectory,
                                              Descriptor descriptor)
                                       throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

doInstallSharedLibrary

protected String doInstallSharedLibrary(File tmpDirectory,
                                        SharedLibrary descriptor)
                                 throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

doInstallComponent

protected InstallerMBeanImpl doInstallComponent(File tmpDirectory,
                                                Component descriptor)
                                         throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

buildState

protected void buildState()

containsSharedLibrary

protected boolean containsSharedLibrary(String name)
returns true if a shared library is already installed

Parameters:
name -
Returns:
true/false

buildSharedLibs

protected void buildSharedLibs()

buildComponents

protected void buildComponents()

buildComponent

protected void buildComponent(File componentDirectory)
                       throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

buildComponentContext

protected ComponentContextImpl buildComponentContext(File componentRoot,
                                                     File installRoot,
                                                     String name)
                                              throws IOException
Throws:
IOException


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