org.ow2.jonas.services.bootstrap
Class JOnASConfiguration

java.lang.Object
  extended by org.ow2.jonas.services.bootstrap.JOnASConfiguration
All Implemented Interfaces:
org.osgi.service.cm.ConfigurationPlugin, ConfigurationManager

public class JOnASConfiguration
extends Object
implements ConfigurationManager, org.osgi.service.cm.ConfigurationPlugin

JOnAS Configuration component.

Author:
Francois Fornaciari

Field Summary
 
Fields inherited from interface org.osgi.service.cm.ConfigurationPlugin
CM_RANKING, CM_TARGET
 
Constructor Summary
JOnASConfiguration(org.osgi.framework.BundleContext bc)
          Constructor used to retrieve the OSGi BundleContext.
 
Method Summary
 void configure()
          Method called when the Configuration Admin Service is bound to the component.
 void deleteServiceConfiguration(String service)
          Delete the service configuration for the given service.
 List<String> getAllServices()
          Get all services.
 List<String> getMandatoryServices()
          Get mandatory services.
 List<String> getOptionalServices()
          Get optional services.
 Dictionary<String,String> getServiceProperties(String service)
          Get all properties for a given JOnAS service name.
 void haltServer()
          Halt server by stopping the system bundle.
 boolean matchService(String service)
          Return true if the given service matches a JOnAS service
 void modifyConfiguration(org.osgi.framework.ServiceReference serviceReference, Dictionary storedProperties)
          
 void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
           
 void updateServiceConfiguration(String service)
          Create or update the service configuration for the given service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JOnASConfiguration

public JOnASConfiguration(org.osgi.framework.BundleContext bc)
Constructor used to retrieve the OSGi BundleContext.

Parameters:
bc - OSGi BundleContext
Method Detail

configure

public void configure()
               throws Exception
Method called when the Configuration Admin Service is bound to the component.
This method creates service configurations for mandatory JOnAS services (regitry and jmx)

Throws:
Exception - Thrown if the configuration failed.

haltServer

public void haltServer()
                throws Exception
Halt server by stopping the system bundle.

Specified by:
haltServer in interface ConfigurationManager
Throws:
Exception - If an exception occurs during server halting

updateServiceConfiguration

public void updateServiceConfiguration(String service)
                                throws Exception
Create or update the service configuration for the given service.

Specified by:
updateServiceConfiguration in interface ConfigurationManager
Parameters:
service - the service name
Throws:
Exception - If an exception occurs during configuration updates

deleteServiceConfiguration

public void deleteServiceConfiguration(String service)
                                throws Exception
Delete the service configuration for the given service.

Specified by:
deleteServiceConfiguration in interface ConfigurationManager
Parameters:
service - the service name
Throws:
Exception - If an exception occurs during configuration deletions

matchService

public boolean matchService(String service)
Return true if the given service matches a JOnAS service

Specified by:
matchService in interface ConfigurationManager
Parameters:
service - The service name
Returns:
True if the given service matches a JOnAS service

getMandatoryServices

public List<String> getMandatoryServices()
Get mandatory services.

Specified by:
getMandatoryServices in interface ConfigurationManager
Returns:
Mandatory services

getAllServices

public List<String> getAllServices()
Get all services.

Specified by:
getAllServices in interface ConfigurationManager
Returns:
All services

getOptionalServices

public List<String> getOptionalServices()
Get optional services.

Specified by:
getOptionalServices in interface ConfigurationManager
Returns:
Optional services

getServiceProperties

public Dictionary<String,String> getServiceProperties(String service)
Get all properties for a given JOnAS service name.

Specified by:
getServiceProperties in interface ConfigurationManager
Parameters:
service - The given service name
Returns:
A Dictionary value representing all properties for a JOnAS service name

modifyConfiguration

public void modifyConfiguration(org.osgi.framework.ServiceReference serviceReference,
                                Dictionary storedProperties)

Specified by:
modifyConfiguration in interface org.osgi.service.cm.ConfigurationPlugin

setConfigurationAdmin

public void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
Parameters:
configurationAdmin - the configurationAdmin to set


Copyright © 2010 OW2 Consortium. All Rights Reserved.