com.stc.connector.framework.jca.system
Class STCResourceAdapter

java.lang.Object
  extended bycom.stc.connector.framework.jca.system.STCResourceAdapter
All Implemented Interfaces:
javax.resource.spi.ResourceAdapter, STCManagedMaster

public class STCResourceAdapter
extends java.lang.Object
implements javax.resource.spi.ResourceAdapter, STCManagedMaster

Abstract class implementing the ResourceAdapter interface. A ResourceAdapter contains operations for lifecycle management and message endpoint setup. Classes extending this class must be a JavaBean.

Version:
$Revision: 1.19 $
Author:
James Tran

Constructor Summary
STCResourceAdapter()
          Constructor for STCResourceAdapter.
 
Method Summary
 void createMBean(java.lang.String mbeanClassName, java.lang.String mbeanName)
          Creates the MBean
 STCPropertiesInfo createPropertiesInfo()
          Creates a new STCPropertiesInfo instance for the the ResourceAdapter properties from the ResourceAdapter configuration model.
 void endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory messageEndpointFactory, javax.resource.spi.ActivationSpec activationSpec)
          This is called during the activation of a message endpoint.
 void endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory messageEndpointFactory, javax.resource.spi.ActivationSpec activationSpec)
          This is called when a message endpoint is deactivated.
 java.lang.String getConfigurationInstance()
          Gets the value of the ConfigurationInstance property.
 java.lang.String getConfigurationTemplate()
          Gets the value of the ConfigurationTemplate property.
 java.lang.String getEwayDescription()
          Gets the value of the EwayDescription property.
 java.lang.String getEwayName()
          Gets the value of the EwayName property.
 java.lang.String getEwayResourceAdapterClass()
          Gets the value of the EwayResourceAdapterClass property.
 java.lang.String getEwayResourceAdapterMBeanClass()
          Gets the value of the EwayResourceAdapterMBeanClass property.
 java.lang.String getEwayResourceAdapterMBeanName()
          Gets the value of the EwayResourceAdapterMBeanName property.
 java.lang.String getEwayVersion()
          Gets the value of the EwayVersion property.
 java.lang.Object getMBean()
          Gets the RA MBean registered for this RA instance
 java.lang.String getSupportedModes()
          Gets the value of the SupportedModes property.
 javax.transaction.xa.XAResource[] getXAResources(javax.resource.spi.ActivationSpec[] activationSpecs)
          This method is called by the application server during crash recovery.
 void setConfigurationInstance(java.lang.String configInstance)
          Sets the value of the ConfigurationInstance property.
 void setConfigurationTemplate(java.lang.String configTemplate)
          Sets the value of the ConfigurationTemplate property.
 void setEwayDescription(java.lang.String description)
          Sets the value of the EwayDescription property.
 void setEwayName(java.lang.String name)
          Sets the value of the EwayName property.
 void setEwayResourceAdapterClass(java.lang.String className)
          Sets the value of the EwayResourceAdapterClass property.
 void setEwayResourceAdapterMBeanClass(java.lang.String className)
          Sets the value of the EwayResourceAdapterMBeanClass property.
 void setEwayResourceAdapterMBeanName(java.lang.String mbeanName)
          Sets the value of the EwayResourceAdapterMBeanName property.
 void setEwayVersion(java.lang.String version)
          Sets the value of the EwayVersion property.
 void setSupportedModes(java.lang.String inoutModes)
          Sets the value of the SupportedModes property.
 void start(javax.resource.spi.BootstrapContext bootstrapContext)
          This is called when a resource adapter instance is bootstrapped.
 void stop()
          This is called when a resource adapter instance is undeployed or during application server shutdown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STCResourceAdapter

public STCResourceAdapter()
Constructor for STCResourceAdapter.

Method Detail

endpointActivation

public void endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory messageEndpointFactory,
                               javax.resource.spi.ActivationSpec activationSpec)
                        throws javax.resource.NotSupportedException
This is called during the activation of a message endpoint. This causes the resource adapter instance to do the necessary setup (ie., setup message delivery for the message endpoint with a message provider). Note that message delivery to the message endpoint might start even before this method returns.

Specified by:
endpointActivation in interface javax.resource.spi.ResourceAdapter
Parameters:
messageEndpointFactory - A message endpoint factory instance.
activationSpec - An activativation spec JavaBean instance.
Throws:
javax.resource.NotSupportedException - if message inflow is not supported by the ResourceAdapter or if there was a failure in message endpoint setup.

endpointDeactivation

public void endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory messageEndpointFactory,
                                 javax.resource.spi.ActivationSpec activationSpec)
This is called when a message endpoint is deactivated. The instances passed as arguments to this method call should be identical to those passed in for the corresponding endpointActivation call. This causes the resource adapter to stop delivering messages to the message endpoint.

Specified by:
endpointDeactivation in interface javax.resource.spi.ResourceAdapter
Parameters:
messageEndpointFactory - A message endpoint factory instance.
activationSpec - An activativation spec JavaBean instance.

getXAResources

public javax.transaction.xa.XAResource[] getXAResources(javax.resource.spi.ActivationSpec[] activationSpecs)
                                                 throws javax.resource.ResourceException
This method is called by the application server during crash recovery. This method takes in an array of ActivationSpec JavaBeans and returns an array of XAResource objects each of which represents a unique resource manager. The application server uses the XAResource objects to query each resource manager for a list of in-doubt transactions. It then completes each pending transaction by sending the commit decision to the participating resource managers.

Specified by:
getXAResources in interface javax.resource.spi.ResourceAdapter
Parameters:
activationSpecs - An array of ActivationSpec JavaBeans each of which corresponds to a deployed endpoint application that was active prior to the system crash.
Returns:
An array of XAResource objects each of which represents a unique resource manager. If no XAResource, an empty array of XAResource will be returned.
Throws:
javax.resource.ResourceException - upon error.

start

public void start(javax.resource.spi.BootstrapContext bootstrapContext)
           throws javax.resource.spi.ResourceAdapterInternalException
This is called when a resource adapter instance is bootstrapped. This may be during resource adapter deployment or application server startup. This is a startup notification from the application server, and this method is called by an application server thread. The application server thread executes in an unspecified context. During this method call a ResourceAdapter JavaBean is responsible for initializing the resource adapter instance. Any exception thrown during this method call causes the application server to abort the bootstrap procedure for this specific resource adapter instance.

Specified by:
start in interface javax.resource.spi.ResourceAdapter
Parameters:
bootstrapContext - A bootstrap context containing references to useful facilities that could be used by a resource adapter instance.
Throws:
javax.resource.spi.ResourceAdapterInternalException - upon error.

stop

public void stop()
This is called when a resource adapter instance is undeployed or during application server shutdown. This is a shutdown notification from the application server, and this method is called by an application server thread. The application server thread executes in an unspecified context. During this method call, a ResourceAdapter JavaBean is responsible for performing an orderly shutdown of the resource adapter instance. Any exception thrown by this method call does not alter the processing of the application server shutdown or resource adapter undeployment that caused this method call. The application server may log the exception information for error reporting purposes.

Specified by:
stop in interface javax.resource.spi.ResourceAdapter

createPropertiesInfo

public STCPropertiesInfo createPropertiesInfo()
Creates a new STCPropertiesInfo instance for the the ResourceAdapter properties from the ResourceAdapter configuration model.

Returns:
A ConnectionRequestInfo with possible null property values filled in with the values of the same properties in the ManagedConnectionFactory.

setEwayResourceAdapterClass

public void setEwayResourceAdapterClass(java.lang.String className)
                                 throws java.lang.Exception
Sets the value of the EwayResourceAdapterClass property.

Parameters:
className - String containing the value to be assigned to EwayResourceAdapterClass.
Throws:
java.lang.Exception - upon error.

getEwayResourceAdapterClass

public java.lang.String getEwayResourceAdapterClass()
Gets the value of the EwayResourceAdapterClass property.

Returns:
String containing the value of the EwayResourceAdapterClass property.

getConfigurationTemplate

public java.lang.String getConfigurationTemplate()
Gets the value of the ConfigurationTemplate property.

Returns:
String containing the value of the ConfigurationTemplate property.

setConfigurationTemplate

public void setConfigurationTemplate(java.lang.String configTemplate)
                              throws java.lang.Exception
Sets the value of the ConfigurationTemplate property.

Parameters:
configTemplate - String containing the value to be assigned to ConfigurationTemplate.
Throws:
java.lang.Exception - upon error.

getConfigurationInstance

public java.lang.String getConfigurationInstance()
Gets the value of the ConfigurationInstance property.

Returns:
String containing the value of the ConfigurationInstance property.

setConfigurationInstance

public void setConfigurationInstance(java.lang.String configInstance)
                              throws java.lang.Exception
Sets the value of the ConfigurationInstance property.

Parameters:
configInstance - String containing the value to be assigned to ConfigurationInstance.
Throws:
java.lang.Exception - upon error.

setEwayResourceAdapterMBeanClass

public void setEwayResourceAdapterMBeanClass(java.lang.String className)
                                      throws java.lang.Exception
Sets the value of the EwayResourceAdapterMBeanClass property.

Parameters:
className - String containing the value to be assigned to EwayResourceAdapterMBeanClass.
Throws:
java.lang.Exception - upon error.

getEwayResourceAdapterMBeanClass

public java.lang.String getEwayResourceAdapterMBeanClass()
Gets the value of the EwayResourceAdapterMBeanClass property.

Returns:
String containing the value of the EwayResourceAdapterMBeanClass property.

setEwayResourceAdapterMBeanName

public void setEwayResourceAdapterMBeanName(java.lang.String mbeanName)
                                     throws java.lang.Exception
Sets the value of the EwayResourceAdapterMBeanName property.

Throws:
java.lang.Exception - upon error.

getEwayResourceAdapterMBeanName

public java.lang.String getEwayResourceAdapterMBeanName()
Gets the value of the EwayResourceAdapterMBeanName property.

Returns:
String containing the value of the EwayResourceAdapterMBeanName property.

setEwayName

public void setEwayName(java.lang.String name)
Sets the value of the EwayName property.


getEwayName

public java.lang.String getEwayName()
Gets the value of the EwayName property.

Returns:
String containing the value of the EwayName property.

setEwayDescription

public void setEwayDescription(java.lang.String description)
Sets the value of the EwayDescription property.


getEwayDescription

public java.lang.String getEwayDescription()
Gets the value of the EwayDescription property.

Returns:
String containing the value of the EwayDescription property.

setEwayVersion

public void setEwayVersion(java.lang.String version)
Sets the value of the EwayVersion property.


getEwayVersion

public java.lang.String getEwayVersion()
Gets the value of the EwayVersion property.

Returns:
String containing the value of the EwayVersion property.

setSupportedModes

public void setSupportedModes(java.lang.String inoutModes)
Sets the value of the SupportedModes property.


getSupportedModes

public java.lang.String getSupportedModes()
Gets the value of the SupportedModes property.

Returns:
String containing the value of the SupportedModes property.

getMBean

public java.lang.Object getMBean()
Gets the RA MBean registered for this RA instance

Specified by:
getMBean in interface STCManagedMaster
Returns:
STCRABean

createMBean

public void createMBean(java.lang.String mbeanClassName,
                        java.lang.String mbeanName)
                 throws STCCreateMBeanException
Creates the MBean

Specified by:
createMBean in interface STCManagedMaster
Parameters:
mbeanClassName - classname of MBean impl class
mbeanName - name of MBean
Throws:
STCCreateMBeanException