org.ow2.jonas.lib.jmbeans
Class OsgiServicesUtil

java.lang.Object
  extended by org.ow2.jonas.lib.jmbeans.OsgiServicesUtil

public class OsgiServicesUtil
extends Object

This class provides facilities for managing the JOnAS services implemented as OSGI services.

Author:
danesa

Field Summary
static String SERVICE_MANDATORY_PROP
          OSGI service property defined for all the JOnAS services, having value true for mandatory services: carol registry and jmx.
static String SERVICE_NAME_PROP
          OSGI service property defined for all the JOnAS services, giving the service name for JOnAS management support.
 
Constructor Summary
OsgiServicesUtil()
           
 
Method Summary
static ArrayList<String> getJonasMandatoryServices(org.osgi.framework.BundleContext bc)
          Returns the names of the JOnAS mandatory services that are registered in the OSGI platform.
static ArrayList<String> getJonasServices(org.osgi.framework.BundleContext bc)
          Returns the names of the JOnAS services that are registered in the OSGI platform.
static boolean jonasMandatoryService(org.osgi.framework.ServiceReference ref)
          If the given ServiceReference has the "jonas.service.mandatory" property set, return this property value (true).
static String jonasService(org.osgi.framework.ServiceReference ref)
          If the given ServiceReference has the "jonas.service" property set, return its value representing the JOnAS service name.
static Object runningState()
          Current implementation for the RUNNING state of a service.
static Object stoppedState()
          Current implementation for the STOPPED state of a service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME_PROP

public static final String SERVICE_NAME_PROP
OSGI service property defined for all the JOnAS services, giving the service name for JOnAS management support.

See Also:
Constant Field Values

SERVICE_MANDATORY_PROP

public static final String SERVICE_MANDATORY_PROP
OSGI service property defined for all the JOnAS services, having value true for mandatory services: carol registry and jmx.

See Also:
Constant Field Values
Constructor Detail

OsgiServicesUtil

public OsgiServicesUtil()
Method Detail

jonasService

public static String jonasService(org.osgi.framework.ServiceReference ref)
If the given ServiceReference has the "jonas.service" property set, return its value representing the JOnAS service name.

Parameters:
ref - the ServiceReference
Returns:
"jonas.service" property value if set, null otherwise.

jonasMandatoryService

public static boolean jonasMandatoryService(org.osgi.framework.ServiceReference ref)
If the given ServiceReference has the "jonas.service.mandatory" property set, return this property value (true). Return false otherwise.

Parameters:
ref - the ServiceReference
Returns:
true if "jonas.service.mandatory" property set, false otherwise

runningState

public static Object runningState()
Current implementation for the RUNNING state of a service.

Returns:
true

stoppedState

public static Object stoppedState()
Current implementation for the STOPPED state of a service.

Returns:
false

getJonasServices

public static ArrayList<String> getJonasServices(org.osgi.framework.BundleContext bc)
                                          throws org.osgi.framework.InvalidSyntaxException
Returns the names of the JOnAS services that are registered in the OSGI platform.

Parameters:
bc - the BundleContext
Returns:
running services' names
Throws:
org.osgi.framework.InvalidSyntaxException - could not get the OSGI services

getJonasMandatoryServices

public static ArrayList<String> getJonasMandatoryServices(org.osgi.framework.BundleContext bc)
                                                   throws org.osgi.framework.InvalidSyntaxException
Returns the names of the JOnAS mandatory services that are registered in the OSGI platform.

Parameters:
bc - the BundleContext
Returns:
running services' names
Throws:
org.osgi.framework.InvalidSyntaxException - could not get the OSGI services


Copyright © 2008 OW2 Consortium. All Rights Reserved.