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, org.ow2.jonas.cmi.CmiService, org.ow2.jonas.service.Service

public class CmiServiceImpl
extends org.ow2.jonas.lib.service.AbsServiceImpl
implements org.ow2.jonas.cmi.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, String clusterPolicyName, 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.
protected  org.ow2.jonas.jmx.JmxService getJmxService()
           
 void setJmxService(org.ow2.jonas.jmx.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 org.ow2.jonas.service.ServiceException
Start the service.

Specified by:
doStart in class org.ow2.jonas.lib.service.AbsServiceImpl
Throws:
org.ow2.jonas.service.ServiceException - when cannot configure or start the CMI instance.

doStop

protected void doStop()
               throws org.ow2.jonas.service.ServiceException
Stop the service.

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

addClusteredObject

public void addClusteredObject(String jndiName,
                               String clusterPolicyName,
                               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 org.ow2.jonas.cmi.CmiService
Parameters:
jndiName - name of the bean
clusterPolicyName - filename
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)
Throws:
Exception - if the provided policy of load-balancing is not valid

getJmxService

protected org.ow2.jonas.jmx.JmxService getJmxService()
Returns:
the jmxService

setJmxService

public void setJmxService(org.ow2.jonas.jmx.JmxService jmxService)
Parameters:
jmxService - the jmxService to set


Copyright © 2008 OW2 Consortium. All Rights Reserved.