org.ow2.jonas.lib.service.manager
Class ServiceManagerImpl

java.lang.Object
  extended by org.ow2.jonas.lib.service.manager.ServiceManagerImpl
All Implemented Interfaces:
ServiceManager

public class ServiceManagerImpl
extends Object
implements ServiceManager

Class to manage the JOnAS services.

Author:
Francois Fornaciari

Constructor Summary
ServiceManagerImpl(org.osgi.framework.BundleContext bc)
          Construct a service manager for JOnAS server.
 
Method Summary
 void bindJ2EEServer(J2EEServerService j2eeServer)
           
 List<String> getAllServices()
          
 List<String> getOptionalServices()
          
 String getServiceDescription(String serviceName)
          Return the description of a given service.
 String getServiceState(String serviceName)
          Return the state of a given service.
 void setConfigurationManager(ConfigurationManager configurationManager)
           
 void setDeployerManager(org.ow2.util.ee.deploy.api.deployer.IDeployerManager deployerManager)
           
 void setDeploymentPlanDeployer(DeploymentPlanDeployer deploymentPlanDeployer)
           
 void setServerProperties(ServerProperties serverProperties)
           
 J2EEServiceState setServiceState(String serviceName, J2EEServiceState state)
          Modify a service state.
 void start()
          Initialization method.
 void startRequiredServices(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
          Start all required services for a given deployable.
 void startService(String service)
          Start a JOnAS service.
 void startServices()
          
 void stop()
          Finalization method.
 void stopService(String service)
          Stop a JOnAS service.
 void stopServices()
          
 void unbindJ2EEServer(J2EEServerService j2eeServer)
           
 void updateServiceStates()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceManagerImpl

public ServiceManagerImpl(org.osgi.framework.BundleContext bc)
Construct a service manager for JOnAS server.

Parameters:
bc - The bundleContext reference
Method Detail

start

public void start()
Initialization method.


stop

public void stop()
Finalization method.


getAllServices

public List<String> getAllServices()

Specified by:
getAllServices in interface ServiceManager

getOptionalServices

public List<String> getOptionalServices()

Specified by:
getOptionalServices in interface ServiceManager

setServiceState

public J2EEServiceState setServiceState(String serviceName,
                                        J2EEServiceState state)
Modify a service state. This may arrive at startup when a service registers itself before the J2EEServer server initialization phase, or due to a service state notification (ServiceEvent in OSGI).

Parameters:
serviceName - name of the service
state - new state
Returns:
the service state

getServiceState

public String getServiceState(String serviceName)
Return the state of a given service.

Specified by:
getServiceState in interface ServiceManager
Parameters:
serviceName - service name
Returns:
the service state

getServiceDescription

public String getServiceDescription(String serviceName)
Return the description of a given service.

Specified by:
getServiceDescription in interface ServiceManager
Parameters:
serviceName - service name
Returns:
the service description

updateServiceStates

public void updateServiceStates()
See Also:
org.ow2.jonas.management.ServiceManager#updateServiceStates()

startService

public void startService(String service)
                  throws Exception
Start a JOnAS service.

Specified by:
startService in interface ServiceManager
Parameters:
service - name of the service to start
Throws:
Exception - If the startup of the service fails

startRequiredServices

public void startRequiredServices(org.ow2.util.ee.deploy.api.deployable.IDeployable<?> deployable)
Start all required services for a given deployable.

Specified by:
startRequiredServices in interface ServiceManager
Parameters:
deployable - The deployable to analyse

stopService

public void stopService(String service)
                 throws Exception
Stop a JOnAS service.

Specified by:
stopService in interface ServiceManager
Parameters:
service - name of the service to stop
Throws:
Exception - If the stop of the service fails

startServices

public void startServices()

Specified by:
startServices in interface ServiceManager

stopServices

public void stopServices()

Specified by:
stopServices in interface ServiceManager

bindJ2EEServer

public void bindJ2EEServer(J2EEServerService j2eeServer)
Parameters:
j2eeServer - The j2eeServer to set

unbindJ2EEServer

public void unbindJ2EEServer(J2EEServerService j2eeServer)
Parameters:
j2eeServer - the j2eeServer to unset

setConfigurationManager

public void setConfigurationManager(ConfigurationManager configurationManager)
Parameters:
configurationManager - the configurationManager to set

setDeployerManager

public void setDeployerManager(org.ow2.util.ee.deploy.api.deployer.IDeployerManager deployerManager)
Parameters:
deployerManager - the deployerManager to set

setDeploymentPlanDeployer

public void setDeploymentPlanDeployer(DeploymentPlanDeployer deploymentPlanDeployer)
Parameters:
deploymentPlanDeployer - the deploymentPlanDeployer to set

setServerProperties

public void setServerProperties(ServerProperties serverProperties)
Parameters:
serverProperties - the serverProperties to set


Copyright © 2009 OW2 Consortium. All Rights Reserved.