org.objectweb.jonas.resource
Class Rar

java.lang.Object
  extended byorg.objectweb.jonas.resource.Rar

public class Rar
extends java.lang.Object

Rar object

Author:
Eric Hardesty

Field Summary
static java.lang.String CLASS
           
static int DEF_EXEC_TIME
           
static int DEF_WRK_THREADS
           
static java.util.Hashtable fileName2RA
          Hashtable mapping a filename to an RAR object
static java.lang.String JAO
           
static java.lang.String JAS
           
static java.lang.String JCD
           
static java.lang.String JNDI_NAME
           
static java.util.Hashtable jndiName2RA
          These hashtables associate an RAR with other objects
 JonasConnectorDesc jonasConn
           
 java.lang.String jonasXmlContent
           
static java.lang.String LNK_JNDI_NAME
           
static java.lang.String LNK_RAR_FILENAME
           
 JonasConnectorDesc lnkJonasConn
           
static java.lang.String OBJ_TYPE
           
 java.lang.String objectName
           
 java.lang.String pathName
           
 ConnectorDesc raConn
           
static java.lang.String RAR_FILENAME
           
 javax.resource.spi.ResourceAdapter resAdp
           
static java.lang.String RESOURCE_LIST
           
 java.lang.String xmlContent
           
 
Constructor Summary
Rar()
          - Get the loggers - Get the global jndi context - Get the list of the resource adapters.
Rar(javax.naming.Context ctx, java.lang.String jDom, java.lang.String jServ, javax.resource.spi.work.WorkManager wrkMgr, ResourceBootstrapContext btCtx)
          - Get the loggers - Get the global jndi context - Get the list of the resource adapters.
 
Method Summary
static void addDefaultAS(java.lang.String jndiName)
          add a default AS to the list, the first one deployed is the default if others are added then they will become default if this one is undeployed
static java.lang.String buildModuleName(java.lang.String rarFileName, java.lang.String appName)
           
 void configureAS(javax.resource.spi.ActivationSpec as, java.util.List acp, java.util.List jacp, java.lang.String jndiname, java.lang.String ejbName)
           
 java.lang.Object createFactory(java.lang.String jndiName, java.lang.String rarObjectName, int factoryOffset, java.lang.String factoryType, ConnectorDesc conn, JonasConnectorDesc jConn)
          Create the factory specified
 java.lang.Object getConfigObj(java.lang.String jndiName)
          get the ConfigObj matching the jndiname specified
 ConnectorDesc getConnectorDesc()
          get the ResourceAdapter Connector object for this Rar
static ConnectorDesc getConnectorDesc(java.lang.String jndiName)
          get the RAR ConnectorDesc object matching the jndiname
static java.lang.String getDefaultAS()
          return the current default ActivationSpec
 java.lang.Object getFactory(java.lang.String jndiname)
           
 java.lang.String getInterface(java.lang.String jndiname)
           
 java.util.Vector getJndinames()
           
 JonasConnectorDesc getJonasConnectorDesc()
          get the JonasConnector object for this Rar
static JonasConnectorDesc getJonasConnectorDesc(java.lang.String jndiName)
          get the RAR JonasConnectorDesc object matching the jndiname
static Rar getRar(java.lang.String jndiName)
          get the Rar matching the jndiNname will be used in EJB container to deploy an MDB
 javax.resource.spi.ResourceAdapter getResourceAdapter()
           
static java.lang.Object getResourceObject(java.lang.String jndiName)
          get the ResourceAdapter matching the jndiName will be used in ResourceObjectJNDIHandler class at lookup time
 java.lang.String getXmlContent()
          get the Xml Content for this Rar
 javax.naming.Context processRar()
          Process the resource adapter.
static void removeDefaultAS(java.lang.String jndiName)
          remove the specified jndiName from the default AS list
 void setConnectorDesc(ConnectorDesc cd)
          set the ResourceAdapter Connector object for this Rar
 void setJonasConnectorDesc(JonasConnectorDesc jcd)
          set the JonasConnector object for this Rar
 void unRegister()
          Unregister the resource adapter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS

public static final java.lang.String CLASS
See Also:
Constant Field Values

JNDI_NAME

public static final java.lang.String JNDI_NAME
See Also:
Constant Field Values

RAR_FILENAME

public static final java.lang.String RAR_FILENAME
See Also:
Constant Field Values

LNK_JNDI_NAME

public static final java.lang.String LNK_JNDI_NAME
See Also:
Constant Field Values

LNK_RAR_FILENAME

public static final java.lang.String LNK_RAR_FILENAME
See Also:
Constant Field Values

OBJ_TYPE

public static final java.lang.String OBJ_TYPE
See Also:
Constant Field Values

RESOURCE_LIST

public static final java.lang.String RESOURCE_LIST
See Also:
Constant Field Values

DEF_WRK_THREADS

public static final int DEF_WRK_THREADS
See Also:
Constant Field Values

DEF_EXEC_TIME

public static final int DEF_EXEC_TIME
See Also:
Constant Field Values

JCD

public static final java.lang.String JCD
See Also:
Constant Field Values

JAS

public static final java.lang.String JAS
See Also:
Constant Field Values

JAO

public static final java.lang.String JAO
See Also:
Constant Field Values

objectName

public java.lang.String objectName

pathName

public java.lang.String pathName

resAdp

public javax.resource.spi.ResourceAdapter resAdp

raConn

public ConnectorDesc raConn

lnkJonasConn

public JonasConnectorDesc lnkJonasConn

jonasConn

public JonasConnectorDesc jonasConn

xmlContent

public java.lang.String xmlContent

jonasXmlContent

public java.lang.String jonasXmlContent

fileName2RA

public static java.util.Hashtable fileName2RA
Hashtable mapping a filename to an RAR object


jndiName2RA

public static java.util.Hashtable jndiName2RA
These hashtables associate an RAR with other objects

Constructor Detail

Rar

public Rar()
- 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


Rar

public Rar(javax.naming.Context ctx,
           java.lang.String jDom,
           java.lang.String jServ,
           javax.resource.spi.work.WorkManager wrkMgr,
           ResourceBootstrapContext btCtx)
- 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

Method Detail

processRar

public javax.naming.Context processRar()
                                throws java.lang.Exception
Process the resource adapter. This Resource Adapter is configured via xml files in the rar file

Throws:
java.lang.Exception

unRegister

public void unRegister()
                throws java.lang.Exception
Unregister the resource adapter.

Throws:
java.lang.Exception - thrown

getConfigObj

public java.lang.Object getConfigObj(java.lang.String jndiName)
get the ConfigObj matching the jndiname specified

Parameters:
jndiName - String of jndi name
Returns:
Object ConfigObj associated with the jndi name

getConnectorDesc

public ConnectorDesc getConnectorDesc()
get the ResourceAdapter Connector object for this Rar

Returns:
ConnectorDesc associated resource adapter connector object

setConnectorDesc

public void setConnectorDesc(ConnectorDesc cd)
set the ResourceAdapter Connector object for this Rar

Parameters:
cd - ConnectorDesc to associate with

getXmlContent

public java.lang.String getXmlContent()
get the Xml Content for this Rar

Returns:
String Xml content of this RAR

getJonasConnectorDesc

public JonasConnectorDesc getJonasConnectorDesc()
get the JonasConnector object for this Rar

Returns:
JonasConnectorDesc associated JonasConnector

setJonasConnectorDesc

public void setJonasConnectorDesc(JonasConnectorDesc jcd)
set the JonasConnector object for this Rar

Parameters:
jcd - JonasConnectorDesc to associate with

getFactory

public java.lang.Object getFactory(java.lang.String jndiname)

getInterface

public java.lang.String getInterface(java.lang.String jndiname)

getJndinames

public java.util.Vector getJndinames()

getResourceAdapter

public javax.resource.spi.ResourceAdapter getResourceAdapter()

configureAS

public void configureAS(javax.resource.spi.ActivationSpec as,
                        java.util.List acp,
                        java.util.List jacp,
                        java.lang.String jndiname,
                        java.lang.String ejbName)
                 throws java.lang.Exception
Throws:
java.lang.Exception

buildModuleName

public static java.lang.String buildModuleName(java.lang.String rarFileName,
                                               java.lang.String appName)
Parameters:
rarFileName - String of rar file
appName - the name of the application
Returns:
String of module name

createFactory

public java.lang.Object createFactory(java.lang.String jndiName,
                                      java.lang.String rarObjectName,
                                      int factoryOffset,
                                      java.lang.String factoryType,
                                      ConnectorDesc conn,
                                      JonasConnectorDesc jConn)
                               throws java.lang.Exception
Create the factory specified

Parameters:
jndiName - name to bind the factory
rarObjectName - unique name to match rar
factoryOffset - factory offset in the to create
factoryType - factory type to create
conn - ConnectionDesc object to use for creation
jConn - JonasConnectionDesc object to use for creation
Returns:
Object factory created
Throws:
java.lang.Exception - if an error occurs

addDefaultAS

public static void addDefaultAS(java.lang.String jndiName)
add a default AS to the list, the first one deployed is the default if others are added then they will become default if this one is undeployed

Parameters:
jndiName - jndi name to add

getDefaultAS

public static java.lang.String getDefaultAS()
return the current default ActivationSpec

Returns:
String default ActivationSpec name

removeDefaultAS

public static void removeDefaultAS(java.lang.String jndiName)
remove the specified jndiName from the default AS list

Parameters:
jndiName - jndi name to remove

getConnectorDesc

public static ConnectorDesc getConnectorDesc(java.lang.String jndiName)
get the RAR ConnectorDesc object matching the jndiname

Parameters:
jndiName - the jndiname to lookup
Returns:
ConnectorDesc matching ConnectorDesc

getJonasConnectorDesc

public static JonasConnectorDesc getJonasConnectorDesc(java.lang.String jndiName)
get the RAR JonasConnectorDesc object matching the jndiname

Parameters:
jndiName - the jndiname to lookup
Returns:
JonasConnectorDesc matching JonasConnectorDesc

getRar

public static Rar getRar(java.lang.String jndiName)
get the Rar matching the jndiNname will be used in EJB container to deploy an MDB

Parameters:
jndiName - jndi name to lookup
Returns:
Rar Rar object for the specified jndi name

getResourceObject

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

Parameters:
jndiName - to lookup ResourceObject
Returns:
Object resourceObject corresponding to jndiName