org.ow2.jonas.resource.internal
Class Rar

java.lang.Object
  extended by org.ow2.jonas.resource.internal.Rar
All Implemented Interfaces:
Rar

public class Rar
extends Object
implements Rar

Rar object.

Author:
Eric Hardesty

Field Summary
static String CLASS
           
static int DEF_EXEC_TIME
           
static int DEF_WRK_THREADS
           
static String JAO
           
static String JAS
           
static String JCD
           
static String JNDI_NAME
           
 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, TransactionManager txManager, JmxService jmxService)
          - 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)
          Configure ActivationSpec
 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 String getDefaultAS()
          return the current default ActivationSpec
 Object getFactory(String jndiname)
           
 String getInterface(String jndiname)
          Get the messagelistenerType
 Vector getJndinames()
           
 JonasConnectorDesc getJonasConnectorDesc()
          get the JonasConnector object for this Rar
 ResourceAdapter getResourceAdapter()
           
 String getXmlContent()
          get the Xml Content for this Rar
 Context processRar(String domainName, JOnASResourceService rserv)
          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 setInitialContext(Context context)
           
 void setJMXService(JmxService jmx)
           
 void setJonasConnectorDesc(JonasConnectorDesc jcd)
          set the JonasConnector object for this Rar
 void setTransactionManager(TransactionManager tm)
           
 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
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,
           TransactionManager txManager,
           JmxService jmxService)
- 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

setTransactionManager

public void setTransactionManager(TransactionManager tm)
Parameters:
tm - the TransactionManager to set

setJMXService

public void setJMXService(JmxService jmx)
Parameters:
jmx - the JmxService to set

setInitialContext

public void setInitialContext(Context context)
Parameters:
context - the initial Context to set

processRar

public Context processRar(String domainName,
                          JOnASResourceService rserv)
                   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)
Description copied from interface: Rar
Get the messagelistenerType

Specified by:
getInterface in interface Rar
Parameters:
jndiname - jndi name of the Rar
Returns:
the String messagelistenerType

getJndinames

public Vector getJndinames()

getResourceAdapter

public ResourceAdapter getResourceAdapter()
Specified by:
getResourceAdapter in interface Rar
Returns:
The associated ResourceAdapter

configureAS

public void configureAS(ActivationSpec as,
                        List acp,
                        List jacp,
                        String jndiname,
                        String ejbName)
                 throws Exception
Description copied from interface: Rar
Configure ActivationSpec

Specified by:
configureAS in interface Rar
Parameters:
as - ActivationSpec to be configured
acp - List of activation properties
jacp - List of JOnAS activation properties
jndiname - String destination desired
ejbName - ejb Name
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


Copyright © 2010 OW2 Consortium. All Rights Reserved.