org.ow2.jonas.cmi.internal
Class CmiServiceImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jonas.lib.reconfig.ReconfigEmitter
          extended by org.ow2.jonas.lib.service.AbsServiceImpl
              extended by org.ow2.jonas.cmi.internal.CmiServiceImpl
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, CmiService, Service

public class CmiServiceImpl
extends AbsServiceImpl
implements CmiService

CMI Service interface. It provides a way to use CMI with JOnAS.

Author:
Loris Bouzonnet

Field Summary
 
Fields inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
CmiServiceImpl(org.osgi.framework.BundleContext context)
          Constructor providing the bundle context.
 
Method Summary
 void addClusteredObject(String jndiName, Object clusterConfig, Class<?> homeClass, Class<? extends EJBObject> remoteClass, ClassLoader classLoader, boolean stateful, boolean clusterReplicated)
          Add a bean to the cluster.
protected  void doStart()
          Start the service.
protected  void doStop()
          Stop the service.
 org.ow2.util.event.api.IEventListener getBeanEventListener()
          Gets Listener for Bean Events.
static org.ow2.cmi.controller.common.ClusterViewManager getClusterViewManager()
          Gets the clusterview manager
protected  JmxService getJmxService()
           
 void removeClusteredObject(String jndiName)
          Removes the given clustered object.
 void setBeanEventListener(org.ow2.util.event.api.IEventListener beanEventListener)
          Set the bean event listener.
 void setEventService(org.ow2.util.event.api.IEventService eventService)
           
 void setJmxService(JmxService jmxService)
           
 
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl
convertToList, doInit, getDomainName, getJonasServerName, getName, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString
 
Methods inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
initLogger, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ow2.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Constructor Detail

CmiServiceImpl

public CmiServiceImpl(org.osgi.framework.BundleContext context)
Constructor providing the bundle context.

Parameters:
context - the bundle context
Method Detail

doStart

protected void doStart()
                throws ServiceException
Start the service.

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - when cannot configure or start the CMI instance.

doStop

protected void doStop()
               throws ServiceException
Stop the service.

Specified by:
doStop in class AbsServiceImpl
Throws:
ServiceException - when the CMI server side manager cannot be stopped.

getJmxService

protected JmxService getJmxService()
Returns:
the jmxService

setJmxService

public void setJmxService(JmxService jmxService)
Parameters:
jmxService - the jmxService to set

setEventService

public void setEventService(org.ow2.util.event.api.IEventService eventService)
Parameters:
eventService - the EventService to set

addClusteredObject

public void addClusteredObject(String jndiName,
                               Object clusterConfig,
                               Class<?> homeClass,
                               Class<? extends EJBObject> remoteClass,
                               ClassLoader classLoader,
                               boolean stateful,
                               boolean clusterReplicated)
                        throws Exception
Add a bean to the cluster.

Specified by:
addClusteredObject in interface CmiService
Parameters:
jndiName - name of the bean
clusterConfigMapping - The cluster configuration
homeClass - class of the home interface
remoteClass - class of the remote interface
classLoader - the classloader used by the container of this bean
stateful - true if the bean has a state
clusterReplicated - true if the bean is replicated (ha service is required)
env - a given environment.
Throws:
Exception - if the provided policy of load-balancing is not valid

removeClusteredObject

public void removeClusteredObject(String jndiName)
                           throws Exception
Removes the given clustered object.

Specified by:
removeClusteredObject in interface CmiService
Parameters:
jndiName - Name of the object to remove
Throws:
Exception - any

getBeanEventListener

public org.ow2.util.event.api.IEventListener getBeanEventListener()
Description copied from interface: CmiService
Gets Listener for Bean Events.

Specified by:
getBeanEventListener in interface CmiService
Returns:
the beanEventListener

setBeanEventListener

public void setBeanEventListener(org.ow2.util.event.api.IEventListener beanEventListener)
Description copied from interface: CmiService
Set the bean event listener.

Specified by:
setBeanEventListener in interface CmiService
Parameters:
beanEventListener - the beanEventListener to set

getClusterViewManager

public static org.ow2.cmi.controller.common.ClusterViewManager getClusterViewManager()
Gets the clusterview manager

Returns:


Copyright © 2010 OW2 Consortium. All Rights Reserved.