org.ow2.petals.jbi.management.recovery
Class SystemRecoveryServiceImpl

java.lang.Object
  extended by org.ow2.petals.jbi.management.recovery.SystemRecoveryServiceImpl
All Implemented Interfaces:
SystemRecoveryService

public class SystemRecoveryServiceImpl
extends java.lang.Object
implements SystemRecoveryService

Allows to restore system state after shutdown or crash.

Author:
Olivier Fabre - EBM Websourcing

Field Summary
protected  AdminService adminService
          Communication :: JMX Agent Admin.
protected  ContainerService container
          Container :: Container Service.
protected  EndpointRegistry endpointRegistry
          The EndpointRegistry is used to manage all the endpoint interfaces in a distributed context
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
SystemRecoveryServiceImpl()
           
 
Method Summary
protected  Context createDeploymentContext(java.net.URL installUrl, org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor)
          Create the deployment context
protected  Context createRecoveryContext(org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor, java.net.URL installUrl)
          Create recovery context for component and shared libraries
protected  void moveUnknownDirsToLostPlusFoundDir(java.util.List<java.io.File> unknownDirs)
          Move all unknown components from Petals repository to "lost+found" directory
 void recoverAllEntities()
          Recover all petals recoverable entities (component, shared lib and service assemblies)
 void recoverAllServiceAssembly()
           
 void recoverAllSharedLibrary()
           
protected  void recoverComponent(java.net.URL installUrl, org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor, java.lang.String installState, java.lang.String lifecycleState, java.lang.String compName)
          Recover the given component.
protected  void recoverServiceAssembly(java.net.URL installRoot, org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor, java.lang.String lifecycleState)
          Recover the given Service Assembly.
protected  void recoverSharedLib(java.net.URL installUrl, org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor)
          Recover the given shared library.
protected  void start()
          Start FRACTAL component.
protected  void stop()
          Stop the FRACTAL component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

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


installationTaskFactory

protected InstallationTaskFactory installationTaskFactory

endpointRegistry

protected EndpointRegistry endpointRegistry
The EndpointRegistry is used to manage all the endpoint interfaces in a distributed context


adminService

protected AdminService adminService
Communication :: JMX Agent Admin.


router

protected RouterService router
JBI messaging : Router Service.


repositoryService

protected RepositoryService repositoryService
Platform :: Repository Service.


systemStateService

protected SystemStateService systemStateService
Platform :: SystemState Service.


container

protected ContainerService container
Container :: Container Service.

Constructor Detail

SystemRecoveryServiceImpl

public SystemRecoveryServiceImpl()
Method Detail

recoverAllEntities

public void recoverAllEntities()
                        throws ManagementException
Description copied from interface: SystemRecoveryService
Recover all petals recoverable entities (component, shared lib and service assemblies)

Specified by:
recoverAllEntities in interface SystemRecoveryService
Throws:
ManagementException

recoverAllServiceAssembly

public void recoverAllServiceAssembly()
                               throws ManagementException
Throws:
ManagementException

recoverAllSharedLibrary

public void recoverAllSharedLibrary()
                             throws ManagementException
Throws:
ManagementException

moveUnknownDirsToLostPlusFoundDir

protected void moveUnknownDirsToLostPlusFoundDir(java.util.List<java.io.File> unknownDirs)
Move all unknown components from Petals repository to "lost+found" directory

Parameters:
unknownDirs - the List of unknown dirs that have to be moved.

recoverComponent

protected void recoverComponent(java.net.URL installUrl,
                                org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor,
                                java.lang.String installState,
                                java.lang.String lifecycleState,
                                java.lang.String compName)
                         throws ManagementException
Recover the given component. Recovering a component consist in redoing installation process of a component (see InstallationServiceMBean), calling the "install" method on the created Installer and putting the component in its previous state by calling "start" or/and "stop" on the created component lifecycle.

Parameters:
installationRoot -
installState -
lifecycleState -
Throws:
ManagementException

createRecoveryContext

protected Context createRecoveryContext(org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor,
                                        java.net.URL installUrl)
Create recovery context for component and shared libraries

Parameters:
descriptor -
installRoot -
Returns:

recoverServiceAssembly

protected void recoverServiceAssembly(java.net.URL installRoot,
                                      org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor,
                                      java.lang.String lifecycleState)
                               throws ManagementException
Recover the given Service Assembly. Recovering a Service Assembly consist in redoing deployment process of a Service Assembly (see DeploymentServiceMBean) and putting the Service Assembly in its previous state by calling "start" or/and "stop" on the created component lifecycle.

Parameters:
installationRoot -
lifecycleState -
Throws:
ManagementException

createDeploymentContext

protected Context createDeploymentContext(java.net.URL installUrl,
                                          org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor)
Create the deployment context

Parameters:
descriptor - the sa jbi descriptor
Returns:
the Deployment Context HashMap

recoverSharedLib

protected void recoverSharedLib(java.net.URL installUrl,
                                org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor)
                         throws ManagementException
Recover the given shared library. Recovering a shared library consist in redoing installation process of a shared library (see InstallationServiceMBean).

Parameters:
installationRoot -
Throws:
ManagementException

start

protected void start()
Start FRACTAL component.


stop

protected void stop()
Stop the FRACTAL component



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