org.objectweb.jonas.resource
Class Rar

java.lang.Object
  extended by org.objectweb.jonas.resource.Rar

public class Rar
extends Object

Rar object

Author:
Eric Hardesty

Field Summary
static String CLASS
           
static int DEF_EXEC_TIME
           
static int DEF_WRK_THREADS
           
static Hashtable fileName2RA
          Hashtable mapping a filename to an RAR object
static String JAO
           
static String JAS
           
static String JCD
           
static String JNDI_NAME
           
static Hashtable jndiName2RA
          These hashtables associate an RAR with other objects
 JonasConnectorDesc jonasConn
           
 String jonasXmlContent
           
static String LNK_JNDI_NAME
           
static String LNK_RAR_FILENAME
           
 JonasConnectorDesc lnkJonasConn
           
static String OBJ_TYPE
           
 String objectName
           
 String pathName
           
 ConnectorDesc raConn
           
static String RAR_FILENAME
           
 ResourceAdapter resAdp
           
static String RESOURCE_LIST
           
 String xmlContent
           
 
Constructor Summary
Rar()
          - Get the loggers - Get the global jndi context - Get the list of the resource adapters.
Rar(Context ctx, String jDom, String jServ, ResourceBootstrapContext btCtx)
          - Get the loggers - Get the global jndi context - Get the list of the resource adapters.
 
Method Summary
static void addDefaultAS(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 String buildModuleName(String rarFileName, String appName)
           
 void configureAS(ActivationSpec as, List acp, List jacp, String jndiname, String ejbName)
           
 Object createFactory(String jndiName, String rarObjectName, int factoryOffset, String factoryType, ConnectorDesc conn, JonasConnectorDesc jConn)
          Create the factory specified
 Object getConfigObj(String jndiName)
          get the ConfigObj matching the jndiname specified
 ConnectorDesc getConnectorDesc()
          get the ResourceAdapter Connector object for this Rar
static ConnectorDesc getConnectorDesc(String jndiName)
          get the RAR ConnectorDesc object matching the jndiname
static String getDefaultAS()
          return the current default ActivationSpec
 Object getFactory(String jndiname)
           
 String getInterface(String jndiname)
           
 Vector getJndinames()
           
 JonasConnectorDesc getJonasConnectorDesc()
          get the JonasConnector object for this Rar
static JonasConnectorDesc getJonasConnectorDesc(String jndiName)
          get the RAR JonasConnectorDesc object matching the jndiname
static Rar getRar(String jndiName)
          get the Rar matching the jndiNname will be used in EJB container to deploy an MDB
 ResourceAdapter getResourceAdapter()
           
static Object getResourceObject(String jndiName)
          get the ResourceAdapter matching the jndiName will be used in ResourceObjectJNDIHandler class at lookup time
 String getXmlContent()
          get the Xml Content for this Rar
 Context processRar(String domainName)
          Process the resource adapter.
static void removeDefaultAS(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(String domainName)
          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 String CLASS
See Also:
Constant Field Values

JNDI_NAME

public static final String JNDI_NAME
See Also:
Constant Field Values

RAR_FILENAME

public static final String RAR_FILENAME
See Also:
Constant Field Values

LNK_JNDI_NAME

public static final String LNK_JNDI_NAME
See Also:
Constant Field Values

LNK_RAR_FILENAME

public static final String LNK_RAR_FILENAME
See Also:
Constant Field Values

OBJ_TYPE

public static final String OBJ_TYPE
See Also:
Constant Field Values

RESOURCE_LIST

public static final 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 String JCD
See Also:
Constant Field Values

JAS

public static final String JAS
See Also:
Constant Field Values

JAO

public static final String JAO
See Also:
Constant Field Values

objectName

public String objectName

pathName

public String pathName

resAdp

public ResourceAdapter resAdp

raConn

public ConnectorDesc raConn

lnkJonasConn

public JonasConnectorDesc lnkJonasConn

jonasConn

public JonasConnectorDesc jonasConn

xmlContent

public String xmlContent

jonasXmlContent

public String jonasXmlContent

fileName2RA

public static Hashtable fileName2RA
Hashtable mapping a filename to an RAR object


jndiName2RA

public static 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(Context ctx,
           String jDom,
           String jServ,
           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 Context processRar(String domainName)
                   throws Exception
Process the resource adapter. This Resource Adapter is configured via xml files in the rar file

Throws:
Exception

unRegister

public void unRegister(String domainName)
                throws Exception
Unregister the resource adapter.

Throws:
Exception - thrown

getConfigObj

public Object getConfigObj(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 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 Object getFactory(String jndiname)

getInterface

public String getInterface(String jndiname)

getJndinames

public Vector getJndinames()

getResourceAdapter

public ResourceAdapter getResourceAdapter()

configureAS

public void configureAS(ActivationSpec as,
                        List acp,
                        List jacp,
                        String jndiname,
                        String ejbName)
                 throws Exception
Throws:
Exception

buildModuleName

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

createFactory

public Object createFactory(String jndiName,
                            String rarObjectName,
                            int factoryOffset,
                            String factoryType,
                            ConnectorDesc conn,
                            JonasConnectorDesc jConn)
                     throws 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:
Exception - if an error occurs

addDefaultAS

public static void addDefaultAS(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 String getDefaultAS()
return the current default ActivationSpec

Returns:
String default ActivationSpec name

removeDefaultAS

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

Parameters:
jndiName - jndi name to remove

getConnectorDesc

public static ConnectorDesc getConnectorDesc(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(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(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 Object getResourceObject(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


Copyright © 2007 OW2 Consortium. All Rights Reserved.