org.ow2.petals.jbi.management.installation
Class InstallationServiceImpl

java.lang.Object
  extended by org.ow2.petals.jbi.management.installation.InstallationServiceImpl
All Implemented Interfaces:
javax.jbi.management.InstallationServiceMBean, InstallationService, PetalsLifeCycle

public class InstallationServiceImpl
extends java.lang.Object
implements InstallationService

JBI installation service implementation.

Since:
Petals 1.0
Version:
$Rev: 154 $ $Date: 2006-03-27 17:30:10 +0200 (lun., 27 mars 2006) $
Author:
Rafael Marins, ofabre - EBM Websourcing

Field Summary
protected  AdminService adminService
          Communication :: JMX Agent Admin.
protected  javax.naming.InitialContext componentInitialContext
           
protected  ContainerService container
          Container :: Container Service.
protected  InstallationTaskFactory installationTaskFactory
           
protected  org.ow2.petals.util.LoggingUtil log
          logger wrapper
protected  RepositoryService repositoryService
          Platform :: Repository Service.
protected  RouterService router
          JBI messaging :: Router Service.
protected  SystemStateService systemStateService
          Platform :: SystemState Service.
 
Constructor Summary
InstallationServiceImpl()
          Default constructor.
 
Method Summary
 boolean forceUnloadInstaller(java.lang.String componentName)
          Try to unload installer of a component.
 java.lang.String[] getInstalledComponentsForSharedLibrary(java.lang.String slName)
          Get the list of components that use the shared library
 java.lang.String[] getInstalledSharedLibraries()
          Get the list of all installed shared libraries
 java.lang.String[] getInstallers()
          Get the list of all the existing installers
 java.util.logging.Logger getLogger()
           
 java.lang.String installSharedLibrary(java.lang.String slZipURL)
           
 javax.management.ObjectName loadInstaller(java.lang.String componentName)
           
 javax.management.ObjectName loadNewInstaller(java.lang.String installZipURL)
           
 void shutdown()
          Called to shutdown a component.
 java.lang.String[] shutdownAllComponents()
          Try to shutdown all components.
 boolean shutdownComponent(java.lang.String componentName)
          Shutdown the component.
protected  void start()
          Initialize the InstallationServiceImpl
 java.lang.String[] startAllComponents()
          Try to start all components.
 boolean startComponent(java.lang.String componentName)
          Start the component.
protected  void stop()
          Stop the InstallationServiceImpl
 java.lang.String[] stopAllComponents()
          Try to stop all components.
 boolean stopComponent(java.lang.String componentName)
          Stop the component.
 java.lang.String[] uninstallAllComponents()
          Try to uninstall all components.
 java.lang.String[] uninstallAllSharedLibraries()
          Try to uninstall all shared libraries.
 boolean uninstallComponent(java.lang.String componentName)
          Uninstall the component.
 boolean uninstallSharedLibrary(java.lang.String slName)
           
 boolean uninstallSharedLibrary(java.lang.String slName, java.lang.String version)
          Uninstall a previously installed shared library with the given version.
 java.lang.String[] unloadAllInstallers(boolean force)
          Try to uninstall all components.
 boolean unloadInstaller(java.lang.String componentName, boolean isToBeDeleted)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adminService

protected AdminService adminService
Communication :: JMX Agent Admin.


componentInitialContext

protected javax.naming.InitialContext componentInitialContext

container

protected ContainerService container
Container :: Container Service.


installationTaskFactory

protected InstallationTaskFactory installationTaskFactory

log

protected org.ow2.petals.util.LoggingUtil log
logger wrapper


repositoryService

protected RepositoryService repositoryService
Platform :: Repository Service.


router

protected RouterService router
JBI messaging :: Router Service.


systemStateService

protected SystemStateService systemStateService
Platform :: SystemState Service.

Constructor Detail

InstallationServiceImpl

public InstallationServiceImpl()
Default constructor.

Method Detail

forceUnloadInstaller

public boolean forceUnloadInstaller(java.lang.String componentName)
Description copied from interface: InstallationServiceMBean
Try to unload installer of a component. If the component is in the STARTED state it's stopped and shutdown, if the component is in the STOPPED state it's shutdown. If the installer is in the INSTALLED state, it's uninstalled.

Parameters:
componentName - the component unique name
Returns:
true if the component installer is correctly unloaded, false otherwise

getInstalledComponentsForSharedLibrary

public java.lang.String[] getInstalledComponentsForSharedLibrary(java.lang.String slName)
                                                          throws java.lang.Exception
Description copied from interface: InstallationServiceMBean
Get the list of components that use the shared library

Parameters:
slName - the name of the shared library
Returns:
the list of components that uses this shared library
Throws:
java.lang.Exception - if the shared library is not installed

getInstalledSharedLibraries

public java.lang.String[] getInstalledSharedLibraries()
Description copied from interface: InstallationServiceMBean
Get the list of all installed shared libraries

Returns:
the list of all installed shared libraries

getInstallers

public java.lang.String[] getInstallers()
Description copied from interface: InstallationServiceMBean
Get the list of all the existing installers

Returns:
the list of all the existing installers

getLogger

public java.util.logging.Logger getLogger()

installSharedLibrary

public java.lang.String installSharedLibrary(java.lang.String slZipURL)
Specified by:
installSharedLibrary in interface javax.jbi.management.InstallationServiceMBean

loadInstaller

public javax.management.ObjectName loadInstaller(java.lang.String componentName)
Specified by:
loadInstaller in interface javax.jbi.management.InstallationServiceMBean

loadNewInstaller

public javax.management.ObjectName loadNewInstaller(java.lang.String installZipURL)
Specified by:
loadNewInstaller in interface javax.jbi.management.InstallationServiceMBean
Throws:
java.lang.RuntimeException - if an error occurs during installation process. We have chosen this type of exception because, in the specification, this method doesn't return an exception
See Also:
Return a specific ObjectName if component can't be installed correctly. It's an implementation choice !

shutdown

public void shutdown()
              throws java.lang.Exception
Description copied from interface: PetalsLifeCycle
Called to shutdown a component. The component must unregister all container related information.

Specified by:
shutdown in interface PetalsLifeCycle
Throws:
java.lang.Exception

shutdownAllComponents

public java.lang.String[] shutdownAllComponents()
Description copied from interface: InstallationServiceMBean
Try to shutdown all components. If a component can't be shutdown, the shutdowning process isn't aborted. It returns the list of all shutdown components.

Returns:
an array of succesfuly shutdown component names.

shutdownComponent

public boolean shutdownComponent(java.lang.String componentName)
                          throws javax.jbi.JBIException
Description copied from interface: InstallationServiceMBean
Shutdown the component. This puts the component into the LifeCycleMBean.SHUTDOWN state.

Parameters:
componentName - name of the component to be shutdown; must be non-null and non-empty
Returns:
true if the component is correctly shut down
Throws:
javax.jbi.JBIException - if the component fails to shut down

startAllComponents

public java.lang.String[] startAllComponents()
Description copied from interface: InstallationServiceMBean
Try to start all components. If a component can't be started, the starting process isn't aborted. It returns the list of all started components.

Returns:
an array of succesfuly started component names.

startComponent

public boolean startComponent(java.lang.String componentName)
                       throws javax.jbi.JBIException
Description copied from interface: InstallationServiceMBean
Start the component. This puts the component into the LifeCycleMBean.STARTED state.

Parameters:
componentName - name of the component to be started; must be non-null and non-empty
Returns:
true if the component is correctly started
Throws:
javax.jbi.JBIException - if the component fails to start

stopAllComponents

public java.lang.String[] stopAllComponents()
Description copied from interface: InstallationServiceMBean
Try to stop all components. If a component can't be stoped, the stoping process isn't aborted. It returns the list of all stoped components.

Returns:
an array of succesfuly stoped component names.

stopComponent

public boolean stopComponent(java.lang.String componentName)
                      throws javax.jbi.JBIException
Description copied from interface: InstallationServiceMBean
Stop the component. This puts the component into the LifeCycleMBean.STOPPED state.

Parameters:
componentName - name of the component to be stopped; must be non-null and non-empty
Returns:
true if the component is correctly stopped
Throws:
javax.jbi.JBIException - if the component fails to stop

uninstallAllComponents

public java.lang.String[] uninstallAllComponents()
Description copied from interface: InstallationServiceMBean
Try to uninstall all components. If a component can't be uninstalled, the uninstalling process isn't aborted. It returns the list of all uninstalled components.

Returns:
an array of succesfuly uninstalled component names.

uninstallAllSharedLibraries

public java.lang.String[] uninstallAllSharedLibraries()
Description copied from interface: InstallationServiceMBean
Try to uninstall all shared libraries. If a shared library can't be uninstalled, the uninstalling process isn't aborted. It returns the list of all uninstalled shared libraries.

Returns:
an array of succesfuly uninstalled shared library names.

uninstallComponent

public boolean uninstallComponent(java.lang.String componentName)
                           throws javax.jbi.JBIException
Description copied from interface: InstallationServiceMBean
Uninstall the component. This puts the component into the Installer.UNINSTALLED state.

Parameters:
componentName - name of the component to be uninstalled; must be non-null and non-empty
Returns:
true if the component is correctly uninstalled
Throws:
javax.jbi.JBIException - if the component fails to uninstall

uninstallSharedLibrary

public boolean uninstallSharedLibrary(java.lang.String slName)
Specified by:
uninstallSharedLibrary in interface javax.jbi.management.InstallationServiceMBean

uninstallSharedLibrary

public boolean uninstallSharedLibrary(java.lang.String slName,
                                      java.lang.String version)
Description copied from interface: InstallationServiceMBean
Uninstall a previously installed shared library with the given version.

Parameters:
slName - the name of the shared name space to uninstall; must be non-null and non-empty
version - the Version of the shared name space to uninstall; must be non-null and non-empty
Returns:
true if the uninstall was successful

unloadAllInstallers

public java.lang.String[] unloadAllInstallers(boolean force)
Description copied from interface: InstallationServiceMBean
Try to uninstall all components. If the boolean is set to true, the uninstallation process is forced as this : if the component is in the STARTED state it's stopped and shutdown, if the component is in the STOPPED state it's shutdown. If the installer is in the INSTALLED state, it's uninstalled. If a component can't be uninstalled, the uninstalling process isn't aborted. It returns the list of all uninstalled components.

Returns:
an array of succesfuly uninstalled component names.

unloadInstaller

public boolean unloadInstaller(java.lang.String componentName,
                               boolean isToBeDeleted)
Specified by:
unloadInstaller in interface javax.jbi.management.InstallationServiceMBean

start

protected void start()
Initialize the InstallationServiceImpl


stop

protected void stop()
Stop the InstallationServiceImpl



Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.