Nuxeo Enterprise Platform 5.1

org.nuxeo.runtime.jboss.osgi
Class JBossOSGiAdapter

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.system.ListenerServiceMBeanSupport
              extended by org.nuxeo.runtime.jboss.osgi.JBossOSGiAdapter
All Implemented Interfaces:
EventListener, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, NotificationListener, org.jboss.system.ListenerServiceMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean, JBossOSGiAdapterMBean

public class JBossOSGiAdapter
extends org.jboss.system.ListenerServiceMBeanSupport
implements JBossOSGiAdapterMBean

This service is a singleton (you must not deploy several times a service using this implementation).

If you need to use this service inside multiple EARs you must use isolated class loaders.

Author:
Bogdan Stefanescu

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.system.ListenerServiceMBeanSupport
org.jboss.system.ListenerServiceMBeanSupport.SubscriptionInfo
 
Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ListenerServiceMBean
SL_FILTER_ELEMENT, SL_FILTER_FACTORY_ATTRIBUTE, SL_MBEAN_ELEMENT, SL_MBEAN_HANDBACK_ATTRIBUTE, SL_MBEAN_NAME_ATTRIBUTE, SL_NOTIFICATION_ELEMENT, SL_NOTIFICATION_TYPE_ATTRIBUTE, SL_ROOT_ELEMENT
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
JBossOSGiAdapter()
           
 
Method Summary
protected  void createService()
           
protected  void destroyService()
           
static org.jboss.deployment.DeploymentInfo getEARDeployment()
          Gets the EAR deployment or null if no parent EAR was found.
 String getHomeLocation()
           
static JBossOSGiAdapter getInstance()
          This method is safe only when using isolated EARs if there are multiple nuxeo EARs in the system.
 OSGiAdapter getOSGi()
           
 void handleNotification2(Notification notification, Object handback)
          Handles notification.
 BundleImpl installBundle(String symbolicName, org.jboss.deployment.DeploymentInfo di)
           
 String listBundles()
           
protected  void startService()
           
protected  void stopService()
           
 void uninstallBundle(String symbolicName, org.jboss.deployment.DeploymentInfo di)
           
 
Methods inherited from class org.jboss.system.ListenerServiceMBeanSupport
handleNotification, setSubscriptionList, subscribe, subscribe, subscribe, unsubscribe
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ListenerServiceMBean
setSubscriptionList
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

JBossOSGiAdapter

public JBossOSGiAdapter()
Method Detail

getInstance

public static JBossOSGiAdapter getInstance()
This method is safe only when using isolated EARs if there are multiple nuxeo EARs in the system.

Returns:
the instance or null if not yet instantiated

getEARDeployment

public static org.jboss.deployment.DeploymentInfo getEARDeployment()
Gets the EAR deployment or null if no parent EAR was found.

This method should be used only on single Nuxeo deployments or when using isolated class loaders for Nuxeo ears.

Returns:

getOSGi

public OSGiAdapter getOSGi()

installBundle

public BundleImpl installBundle(String symbolicName,
                                org.jboss.deployment.DeploymentInfo di)
                         throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

uninstallBundle

public void uninstallBundle(String symbolicName,
                            org.jboss.deployment.DeploymentInfo di)
                     throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

createService

protected void createService()
                      throws Exception
Overrides:
createService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

startService

protected void startService()
                     throws Exception
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

destroyService

protected void destroyService()
                       throws Exception
Overrides:
destroyService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

listBundles

public String listBundles()
Specified by:
listBundles in interface JBossOSGiAdapterMBean

getHomeLocation

public String getHomeLocation()
Specified by:
getHomeLocation in interface JBossOSGiAdapterMBean

handleNotification2

public void handleNotification2(Notification notification,
                                Object handback)
Handles notification.

Overrides:
handleNotification2 in class org.jboss.system.ListenerServiceMBeanSupport

Nuxeo Enterprise Platform 5.1

Copyright ? 2007 Nuxeo SAS. All Rights Reserved.