org.objectweb.jonas.resource
Class ResourceServiceImpl

java.lang.Object
  |
  +--org.objectweb.jonas.management.ReconfigDispatcher
        |
        +--org.objectweb.jonas.service.AbsServiceImpl
              |
              +--org.objectweb.jonas.resource.ResourceServiceImpl
All Implemented Interfaces:
javax.management.NotificationBroadcaster, ReconfigDispatcherMBean, ResourceService, ResourceServiceImplMBean, Service

public class ResourceServiceImpl
extends AbsServiceImpl
implements ResourceService, ResourceServiceImplMBean

JCA resource service implmentation

Author:
Philippe Coq Contributor(s): JOnAS 2.4 Sebastien Chassande-Barrioz (sebastien.chassande@inrialpes.fr) JOnAS 3.0 Eric Hardesty (Eric.Hardesty@bull.com)

Field Summary
static java.lang.String AUTOLOADDIR
           
static java.lang.String CLASS
           
static java.lang.String JNDI_NAME
           
 java.lang.String MANAGED_CONNECTION_FACTORY_CLASS
           
static java.lang.String MONITOR_FACTORY
           
static java.lang.String PARSINGWITHVALIDATION
           
static java.lang.String PRINTWRITER
           
static java.lang.String RESOURCE_LIST
           
 
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
ResourceServiceImpl()
           
 
Method Summary
 void createResourceAdapter(java.lang.String resName)
          Create a Resource Adapter
 void doInit(javax.naming.Context ctx)
          - Get the global jndi context - Get the list of the resource adapters.
 void doStart()
          Abstract start-up method to be implemented by sub-classes
 void doStop()
          Abstract method for service stopping to be implemented by sub-classes
static java.lang.Object getConnectionFactory(java.lang.String jndiName)
          get the ResourceAdapter matching the raname will be used in ConnectionFactoryJNDIHandler class at lookup time
 java.lang.Integer getCurrentNumberOfResource()
          MBean method
 
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl
getName, init, isStarted, setName, start, stop
 
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Field Detail

RESOURCE_LIST

public static final java.lang.String RESOURCE_LIST

CLASS

public static final java.lang.String CLASS

AUTOLOADDIR

public static final java.lang.String AUTOLOADDIR

PARSINGWITHVALIDATION

public static final java.lang.String PARSINGWITHVALIDATION

MANAGED_CONNECTION_FACTORY_CLASS

public final java.lang.String MANAGED_CONNECTION_FACTORY_CLASS

JNDI_NAME

public static final java.lang.String JNDI_NAME

PRINTWRITER

public static final java.lang.String PRINTWRITER

MONITOR_FACTORY

public static final java.lang.String MONITOR_FACTORY
Constructor Detail

ResourceServiceImpl

public ResourceServiceImpl()
Method Detail

doInit

public void doInit(javax.naming.Context ctx)
- Get the global jndi context - Get the list of the resource adapters. The list is reachable in the Context parameter under the name RESOURCE_LIST. - Get the transaction manager into the jndi - Instanciate the connection manager
Overrides:
doInit in class AbsServiceImpl
Following copied from class: org.objectweb.jonas.service.AbsServiceImpl
Parameters:
ctx - configuration of the service
Throws:
ServiceException - service initialization failed

doStart

public void doStart()
             throws ServiceException
Description copied from class: AbsServiceImpl
Abstract start-up method to be implemented by sub-classes
Overrides:
doStart in class AbsServiceImpl
Following copied from class: org.objectweb.jonas.service.AbsServiceImpl
Throws:
ServiceException - service start-up failed

doStop

public void doStop()
            throws ServiceException
Description copied from class: AbsServiceImpl
Abstract method for service stopping to be implemented by sub-classes
Overrides:
doStop in class AbsServiceImpl
Following copied from class: org.objectweb.jonas.service.AbsServiceImpl
Throws:
ServiceException - service stopping failed

createResourceAdapter

public void createResourceAdapter(java.lang.String resName)
                           throws java.lang.Exception
Description copied from interface: ResourceService
Create a Resource Adapter
Specified by:
createResourceAdapter in interface ResourceService
Following copied from interface: org.objectweb.jonas.resource.ResourceService
Parameters:
String - name of the resource adapter. the configuration information for this resource adapter must be found in the xml files in the rar file being deployed

getConnectionFactory

public static java.lang.Object getConnectionFactory(java.lang.String jndiName)
get the ResourceAdapter matching the raname will be used in ConnectionFactoryJNDIHandler class at lookup time

getCurrentNumberOfResource

public java.lang.Integer getCurrentNumberOfResource()
MBean method
Specified by:
getCurrentNumberOfResource in interface ResourceServiceImplMBean
Returns:
Integer Total Number of Resourcesource available in JOnAS