org.objectweb.jonas.resource.ResourceServiceImpl Class Reference

Inherits org.objectweb.jonas.resource.ResourceService, and org.objectweb.jonas.resource.ResourceServiceImplMBean.

Inheritance diagram for org.objectweb.jonas.resource.ResourceServiceImpl:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.jonas.resource.ResourceServiceImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ResourceServiceImpl ()
void doInit (Context ctx)
void doStart () throws ServiceException
void doStop () throws ServiceException
String createResourceAdapter (Context ctx) throws Exception
void deployRars (Context ctx) throws ResourceServiceException
void unDeployRars (URL[] urls, URL earUrl)
void unRegisterRar (Context ctx) throws Exception
Integer getCurrentNumberOfResource ()
Integer getCurrentNumberOfRars ()
List getDeployedRars ()
List getInstalledRars () throws Exception
Set getRarNames ()
String deployRarMBean (String fileName) throws RemoteException, ResourceServiceException
String deployRar (String fileName) throws Exception
Boolean isRarDeployed (String fileName)
boolean isRarDeployedByUnpackName (String unpackName)
void unDeployRarMBean (String fileName) throws RemoteException, ResourceServiceException
void unDeployRar (String fileName) throws Exception
boolean isRarLoaded (String fileName)
List getDeployableRars () throws Exception
List getAutoloadDirectories ()
String getRarsDirectory ()

Static Public Attributes

final String AUTOLOADDIR = "jonas.service.resource.autoloaddir"
final String CLASS = "jonas.service.resource.class"
final String JNDI_NAME = "jndiname"
final String RAR_OBJNAME = "rarobjname"
final String FACTORY_OFFSET = "factoryoffset"
final String FACTORY_TYPE = "factorytype"
final String RAR_FILENAME = "rarfilename"
final String LNK_JNDI_NAME = "lnkjndiname"
final String LNK_RAR_FILENAME = "lnkrarfilename"
final String JONAS_RA_XML = "jonasraxml"
final String RA_XML = "raxml"
final String PARSINGWITHVALIDATION = "jonas.service.resource.parsingwithvalidation"
final String RESOURCE_LIST = "jonas.service.resource.resources"
final String THREADWAITTIMEOUT = "jonas.service.resource.threadwaittimeout"
final String MINWORKTHREADS = "jonas.service.resource.minworkthreads"
final String MAXWORKTHREADS = "jonas.service.resource.maxworkthreads"
final String EXECTIMEOUT = "jonas.service.resource.worktimeout"
final int DEF_WRK_THREADWAITTIMEOUT = 60
final int DEF_WRK_THREADS = 5
final int DEF_MAX_WRK_THREADS = 80
final int DEF_EXEC_TIME = 0
final String JONAS_BASE = JProp.getJonasBase()
final String WORK_RARS_DIR = JProp.getWorkDir() + File.separator + "rars"
final String RARSDIR = JProp.getJonasBase() + File.separator + "rars"

Detailed Description

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) JOnAS 4.0 Adriana Danes (JSR 77 + use of Jakarta Modeler Component : http://jakarta.apache.org/commons/modeler) Eric Hardesty (J2CA 1.5)

Definition at line 81 of file ResourceServiceImpl.java.


Constructor & Destructor Documentation

org.objectweb.jonas.resource.ResourceServiceImpl.ResourceServiceImpl  ) 
 

Default construtor for ResourceService

Definition at line 278 of file ResourceServiceImpl.java.


Member Function Documentation

String org.objectweb.jonas.resource.ResourceServiceImpl.createResourceAdapter Context  ctx  )  throws Exception
 

Create a new resource adapter. This Resource Adapter is configured via xml files in the rar file

Parameters:
ctx Context to use for deploying an RAR
Returns:
Sting resource objectName
Exceptions:
Exception error encountered

Implements org.objectweb.jonas.resource.ResourceService.

Definition at line 574 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.Rar.fileName2RA, org.objectweb.jonas.resource.Rar.getJndinames(), org.objectweb.jonas.resource.Rar.jndiName2RA, org.objectweb.jonas.resource.Rar.processRar(), and org.objectweb.jonas.resource.ResourceServiceImpl.RARSDIR.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.deployRarMBean(), org.objectweb.jonas.resource.ResourceServiceImpl.deployRars(), and org.objectweb.jonas.resource.ResourceServiceImpl.doStart().

Here is the call graph for this function:

String org.objectweb.jonas.resource.ResourceServiceImpl.deployRar String  fileName  )  throws Exception
 

Deploy the resource adapter

Parameters:
fileName the name of the rar file.
Exceptions:
Exception if unable to deploy the rar
Returns:
String ObjectName of the deployed rar

Implements org.objectweb.jonas.resource.ResourceService.

Definition at line 943 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.deployRarMBean().

Here is the call graph for this function:

String org.objectweb.jonas.resource.ResourceServiceImpl.deployRarMBean String  fileName  )  throws RemoteException, ResourceServiceException
 

Deploy an RAR by delegating the operation to the createResourceAdapter method. This is used for JMX management.

Parameters:
fileName the fileName of the rar which must be be deployed.
Returns:
The ObjectName of the MBean associated to the deployed J2EE Application
Exceptions:
RemoteException if rmi call failed.
ResourceServiceException if the deployment of the RAR failed.

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 918 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.createResourceAdapter().

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.deployRar().

Here is the call graph for this function:

void org.objectweb.jonas.resource.ResourceServiceImpl.deployRars Context  ctx  )  throws ResourceServiceException
 

Deploy the given rars of an ear file with the specified parent classloader (ear classloader). (This method is only used for for ear applications).

Parameters:
ctx the context containing the configuration to deploy the rars.
This context contains the following parameters :
  • urls the list of the urls of the rars to deploy.
  • earRootURL the URL of the ear application file.
  • earClassLoader the ear classLoader of the j2ee app.
  • altDDs the optional URI of deployment descriptor.
Exceptions:
ResourceServiceException if an error occurs during the deployment.

Implements org.objectweb.jonas.resource.ResourceService.

Definition at line 678 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.createResourceAdapter(), org.objectweb.jonas.naming.CompNamingContext.rebind(), and org.objectweb.jonas.resource.ResourceServiceImpl.unRegisterRar().

Here is the call graph for this function:

void org.objectweb.jonas.resource.ResourceServiceImpl.doInit Context  ctx  ) 
 

  • Get the loggers
  • 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
  • Set the XML validation property
    Parameters:
    ctx Context

Definition at line 291 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.AUTOLOADDIR, org.objectweb.jonas.resource.ResourceServiceImpl.DEF_WRK_THREADS, org.objectweb.jonas.resource.ResourceServiceImpl.DEF_WRK_THREADWAITTIMEOUT, org.objectweb.jonas.resource.ResourceServiceImpl.EXECTIMEOUT, org.objectweb.jonas.server.LoaderManager.getAppsLoader(), org.objectweb.jonas.server.LoaderManager.getInstance(), org.objectweb.jonas.service.ServiceManager.getTransactionService(), org.objectweb.jonas.resource.ResourceServiceImpl.MAXWORKTHREADS, org.objectweb.jonas.resource.ResourceServiceImpl.MINWORKTHREADS, org.objectweb.jonas.resource.ResourceServiceImpl.PARSINGWITHVALIDATION, org.objectweb.jonas.resource.ResourceServiceImpl.RESOURCE_LIST, and org.objectweb.jonas.resource.ResourceServiceImpl.THREADWAITTIMEOUT.

Here is the call graph for this function:

void org.objectweb.jonas.resource.ResourceServiceImpl.doStart  )  throws ServiceException
 

Start the Resource service.

Exceptions:
ServiceException if the startup failed.

Definition at line 461 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.createResourceAdapter(), org.objectweb.jonas.naming.CompNamingContext.lookup(), and org.objectweb.jonas.naming.CompNamingContext.rebind().

Here is the call graph for this function:

void org.objectweb.jonas.resource.ResourceServiceImpl.doStop  )  throws ServiceException
 

Stop the Resource service.

Exceptions:
ServiceException if the stop failed.

Definition at line 522 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.Rar.fileName2RA, and org.objectweb.jonas.resource.Rar.unRegister().

Here is the call graph for this function:

List org.objectweb.jonas.resource.ResourceServiceImpl.getAutoloadDirectories  ) 
 

Return the list of "autoload" directories for RAR containers.

Returns:
The list of all "autoload" directories

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 1103 of file ResourceServiceImpl.java.

Integer org.objectweb.jonas.resource.ResourceServiceImpl.getCurrentNumberOfRars  ) 
 

Returns:
Integer Total Number of Rars available in JOnAS

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 852 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.getCurrentNumberOfResource().

Integer org.objectweb.jonas.resource.ResourceServiceImpl.getCurrentNumberOfResource  ) 
 

Returns:
Integer Total Number of Resources available in JOnAS

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 844 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.getCurrentNumberOfRars().

Here is the call graph for this function:

List org.objectweb.jonas.resource.ResourceServiceImpl.getDeployableRars  )  throws Exception
 

Return the list of installed RAR container ready to deploy.

Returns:
The list of deployable RAR container
Exceptions:
Exception if error retrieving the list

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 1093 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.getDeployedRars(), and org.objectweb.jonas.resource.ResourceServiceImpl.getInstalledRars().

Here is the call graph for this function:

List org.objectweb.jonas.resource.ResourceServiceImpl.getDeployedRars  ) 
 

Returns:
the list of RAR files deployed

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 860 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.Rar.fileName2RA.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.getDeployableRars().

List org.objectweb.jonas.resource.ResourceServiceImpl.getInstalledRars  )  throws Exception
 

Return the list of installed RAR containers. The RAR files or the directories with expanded RAR container are searched in JONAS_BASE/rars and all rar directories 'autoload'.

Returns:
The list of RAR files or the directories with expanded RAR container found
Exceptions:
Exception if the list can't be retrieved

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 882 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.RARSDIR.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.getDeployableRars().

Set org.objectweb.jonas.resource.ResourceServiceImpl.getRarNames  ) 
 

This method is added temporarily. It will disapear when Rars will have their associated MBeans (when Rars will become manageable)

Returns:
the names of the rars currently deployed in the JOnAS server

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 899 of file ResourceServiceImpl.java.

String org.objectweb.jonas.resource.ResourceServiceImpl.getRarsDirectory  ) 
 

Return the Rars directory.

Returns:
The Rars directory

Implements org.objectweb.jonas.resource.ResourceService.

Definition at line 1119 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.RARSDIR.

Boolean org.objectweb.jonas.resource.ResourceServiceImpl.isRarDeployed String  fileName  ) 
 

Test if the specified filename is already deployed or not.

Parameters:
fileName the name of the rar file.
Returns:
true if the rar is deployed, else false.

Implements org.objectweb.jonas.resource.ResourceService.

Definition at line 952 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.isRarLoaded().

Here is the call graph for this function:

boolean org.objectweb.jonas.resource.ResourceServiceImpl.isRarDeployedByUnpackName String  unpackName  ) 
 

Test if the specified unpack name is already deployed or not. This method is defined in the ResourceService interface.

Parameters:
unpackName the name of the rar file.
Returns:
true if the rar is deployed, else false.

Implements org.objectweb.jonas.resource.ResourceService.

Definition at line 962 of file ResourceServiceImpl.java.

boolean org.objectweb.jonas.resource.ResourceServiceImpl.isRarLoaded String  fileName  ) 
 

Test if the specified filename is already deployed or not

Parameters:
fileName the name of the rar file.
Returns:
true if the rar is deployed, else false.

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 1059 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.RARSDIR.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.isRarDeployed().

void org.objectweb.jonas.resource.ResourceServiceImpl.unDeployRar String  fileName  )  throws Exception
 

Undeploy the resource adapter

Parameters:
fileName the name of the rar file.
Exceptions:
Exception if not able to undeploy the rar

Implements org.objectweb.jonas.resource.ResourceService.

Definition at line 1050 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.unDeployRarMBean().

Here is the call graph for this function:

void org.objectweb.jonas.resource.ResourceServiceImpl.unDeployRarMBean String  fileName  )  throws RemoteException, ResourceServiceException
 

Undeploy an RAR by delegating the operation to the unRegisterRar() method. This is used for JMX management.

Parameters:
fileName the fileName of the rar which must be be undeployed.
Exceptions:
RemoteException if rmi call failed.
ResourceServiceException if the undeployment of the RAR failed.

Implements org.objectweb.jonas.resource.ResourceServiceImplMBean.

Definition at line 990 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.ResourceServiceImpl.RARSDIR, org.objectweb.jonas.naming.CompNamingContext.rebind(), and org.objectweb.jonas.resource.ResourceServiceImpl.unRegisterRar().

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.unDeployRar().

Here is the call graph for this function:

void org.objectweb.jonas.resource.ResourceServiceImpl.unDeployRars URL[]  urls,
URL  earUrl
 

Undeploy the given rars of an ear file. (This method is only used for the ear applications).

Parameters:
urls the list of the urls of the rars to undeploy.
earUrl the URL of the associated EAR file

Implements org.objectweb.jonas.resource.ResourceService.

Definition at line 777 of file ResourceServiceImpl.java.

References org.objectweb.jonas.naming.CompNamingContext.rebind(), and org.objectweb.jonas.resource.ResourceServiceImpl.unRegisterRar().

Here is the call graph for this function:

void org.objectweb.jonas.resource.ResourceServiceImpl.unRegisterRar Context  ctx  )  throws Exception
 

Unregister the resource adapter.

Parameters:
ctx Context to use for unregistering an RAR
Exceptions:
Exception error encountered

Definition at line 803 of file ResourceServiceImpl.java.

References org.objectweb.jonas.resource.Rar.fileName2RA, org.objectweb.jonas.resource.Rar.getJndinames(), org.objectweb.jonas.resource.Rar.jndiName2RA, org.objectweb.jonas.naming.CompNamingContext.lookup(), and org.objectweb.jonas.resource.Rar.unRegister().

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.deployRars(), org.objectweb.jonas.resource.ResourceServiceImpl.unDeployRarMBean(), and org.objectweb.jonas.resource.ResourceServiceImpl.unDeployRars().

Here is the call graph for this function:


Member Data Documentation

final String org.objectweb.jonas.resource.ResourceServiceImpl.AUTOLOADDIR = "jonas.service.resource.autoloaddir" [static]
 

Autoload directory property name

Definition at line 109 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final String org.objectweb.jonas.resource.ResourceServiceImpl.CLASS = "jonas.service.resource.class" [static]
 

Service class property name

Definition at line 113 of file ResourceServiceImpl.java.

final int org.objectweb.jonas.resource.ResourceServiceImpl.DEF_EXEC_TIME = 0 [static]
 

Maximum work execution timeout (0 is unlimited)

Definition at line 190 of file ResourceServiceImpl.java.

final int org.objectweb.jonas.resource.ResourceServiceImpl.DEF_MAX_WRK_THREADS = 80 [static]
 

Default max number of work threads

Definition at line 186 of file ResourceServiceImpl.java.

final int org.objectweb.jonas.resource.ResourceServiceImpl.DEF_WRK_THREADS = 5 [static]
 

Default number of work threads

Definition at line 182 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final int org.objectweb.jonas.resource.ResourceServiceImpl.DEF_WRK_THREADWAITTIMEOUT = 60 [static]
 

Default work thread timeout

Definition at line 178 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final String org.objectweb.jonas.resource.ResourceServiceImpl.EXECTIMEOUT = "jonas.service.resource.worktimeout" [static]
 

Work max execution timeout property name

Definition at line 173 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final String org.objectweb.jonas.resource.ResourceServiceImpl.FACTORY_OFFSET = "factoryoffset" [static]
 

Factory offset property name

Definition at line 125 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.FACTORY_TYPE = "factorytype" [static]
 

Factory type property name

Definition at line 129 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.JNDI_NAME = "jndiname" [static]
 

Jndiname property name

Definition at line 117 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.JONAS_BASE = JProp.getJonasBase() [static]
 

The name of the JONAS_BASE directory

Definition at line 258 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.JONAS_RA_XML = "jonasraxml" [static]
 

Jonas ra.xml property name

Definition at line 145 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.LNK_JNDI_NAME = "lnkjndiname" [static]
 

Jndiname link property name

Definition at line 137 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.LNK_RAR_FILENAME = "lnkrarfilename" [static]
 

Link Rar filename property name

Definition at line 141 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.MAXWORKTHREADS = "jonas.service.resource.maxworkthreads" [static]
 

Maximum number of work threads property name

Definition at line 169 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final String org.objectweb.jonas.resource.ResourceServiceImpl.MINWORKTHREADS = "jonas.service.resource.minworkthreads" [static]
 

Minimum number of work threads property name

Definition at line 165 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final String org.objectweb.jonas.resource.ResourceServiceImpl.PARSINGWITHVALIDATION = "jonas.service.resource.parsingwithvalidation" [static]
 

Parsing validation property name

Definition at line 153 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final String org.objectweb.jonas.resource.ResourceServiceImpl.RA_XML = "raxml" [static]
 

ra.xml property name

Definition at line 149 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.RAR_FILENAME = "rarfilename" [static]
 

Rar filename property name

Definition at line 133 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.RAR_OBJNAME = "rarobjname" [static]
 

Rar object property name

Definition at line 121 of file ResourceServiceImpl.java.

final String org.objectweb.jonas.resource.ResourceServiceImpl.RARSDIR = JProp.getJonasBase() + File.separator + "rars" [static]
 

The name of the rars directory

Definition at line 268 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.createResourceAdapter(), org.objectweb.jonas.resource.ResourceServiceImpl.getInstalledRars(), org.objectweb.jonas.resource.ResourceServiceImpl.getRarsDirectory(), org.objectweb.jonas.resource.ResourceServiceImpl.isRarLoaded(), and org.objectweb.jonas.resource.ResourceServiceImpl.unDeployRarMBean().

final String org.objectweb.jonas.resource.ResourceServiceImpl.RESOURCE_LIST = "jonas.service.resource.resources" [static]
 

Resources list property name

Definition at line 157 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final String org.objectweb.jonas.resource.ResourceServiceImpl.THREADWAITTIMEOUT = "jonas.service.resource.threadwaittimeout" [static]
 

Thread timeout

Definition at line 161 of file ResourceServiceImpl.java.

Referenced by org.objectweb.jonas.resource.ResourceServiceImpl.doInit().

final String org.objectweb.jonas.resource.ResourceServiceImpl.WORK_RARS_DIR = JProp.getWorkDir() + File.separator + "rars" [static]
 

The name of the working apps directory.

Definition at line 263 of file ResourceServiceImpl.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:07:31 2005 for JOnAS by  doxygen 1.3.9.1