Package com.sun.enterprise.connectors
Class ActiveOutboundResourceAdapter
- java.lang.Object
-
- com.sun.enterprise.connectors.ActiveResourceAdapterImpl
-
- com.sun.enterprise.connectors.ActiveOutboundResourceAdapter
-
- All Implemented Interfaces:
ActiveResourceAdapter
- Direct Known Subclasses:
ActiveInboundResourceAdapterImpl
@Service(name="ActiveOutboundResourceAdapter") @PerLookup public class ActiveOutboundResourceAdapter extends ActiveResourceAdapterImpl
This class represents a live outbound resource adapter (1.5 compliant) i.e. A resource adapter is considered active after start() and before stop() is called.- Author:
- Binod P G, Sivakumar Thyagarajan
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
_logger
protected jakarta.resource.spi.BootstrapContext
bootStrapContextImpl
protected jakarta.resource.spi.ResourceAdapter
resourceadapter_
-
Fields inherited from class com.sun.enterprise.connectors.ActiveResourceAdapterImpl
connectionDefs_, connectorRuntime_, desc_, jcl_, moduleName_
-
-
Constructor Summary
Constructors Constructor Description ActiveOutboundResourceAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdminObject(String appName, String connectorName, ResourceInfo resourceInfo, String adminObjectType, String adminObjectClassName, Properties props)
Creates an admin object.jakarta.resource.spi.ManagedConnectionFactory
createManagedConnectionFactory(ConnectorConnectionPool pool, ClassLoader jcl)
Creates an instance ofManagedConnectionFactory
object using the connection pool properties.void
destroy()
Destroys default pools and resources.jakarta.resource.spi.BootstrapContext
getBootStrapContext()
jakarta.resource.spi.ResourceAdapter
getResourceAdapter()
Retrieves the resource adapter java bean.boolean
handles(ConnectorDescriptor cd, String moduleName)
Indicates whether a particular implementation of ActiveRA can handle the RAR in question.void
init(jakarta.resource.spi.ResourceAdapter ra, ConnectorDescriptor desc, String moduleName, ClassLoader jcl)
Creates an active inbound resource adapter.protected void
loadRAConfiguration()
Loads RA javabean.protected Set
mergeRAConfiguration(ResourceAdapterConfig raConfig, List<Property> raConfigProps)
merge RA bean configuration with resource-adapter-config properties Union of both.void
setup()
Does the necessary initial setup.protected void
startResourceAdapter(jakarta.resource.spi.BootstrapContext bootstrapContext)
called by connector runtime to start the resource-adapter java bean-
Methods inherited from class com.sun.enterprise.connectors.ActiveResourceAdapterImpl
createAllConnectorResources, createDefaultConnectorConnectionPools, createDefaultConnectorResources, createManagedConnectionFactories, deleteDefaultConnectorConnectionPools, deleteDefaultConnectorResources, destroyAllConnectorResources, getClassLoader, getDescriptor, getModuleName, instantiateMCF, isServer, isSystemRar
-
-
-
-
Field Detail
-
resourceadapter_
protected jakarta.resource.spi.ResourceAdapter resourceadapter_
-
_logger
protected static final Logger _logger
-
bootStrapContextImpl
protected jakarta.resource.spi.BootstrapContext bootStrapContextImpl
-
-
Method Detail
-
init
public void init(jakarta.resource.spi.ResourceAdapter ra, ConnectorDescriptor desc, String moduleName, ClassLoader jcl) throws ConnectorRuntimeException
Creates an active inbound resource adapter. Sets all RA java bean properties and issues a start.- Specified by:
init
in interfaceActiveResourceAdapter
- Overrides:
init
in classActiveResourceAdapterImpl
- Parameters:
ra
-ResourceAdapter
java bean.
desc
-ConnectorDescriptor
object.moduleName
- Resource adapter module name.jcl
-ClassLoader
instance.- Throws:
ConnectorRuntimeException
- If there is a failure in loading or starting the resource adapter.
-
startResourceAdapter
protected void startResourceAdapter(jakarta.resource.spi.BootstrapContext bootstrapContext) throws jakarta.resource.spi.ResourceAdapterInternalException
called by connector runtime to start the resource-adapter java bean- Parameters:
bootstrapContext
- BootstrapContext- Throws:
jakarta.resource.spi.ResourceAdapterInternalException
-
handles
public boolean handles(ConnectorDescriptor cd, String moduleName)
Indicates whether a particular implementation of ActiveRA can handle the RAR in question.- Specified by:
handles
in interfaceActiveResourceAdapter
- Overrides:
handles
in classActiveResourceAdapterImpl
- Parameters:
cd
- ConnectorDescriptormoduleName
- resource adapter name- Returns:
- boolean indiating whether a ActiveRA can handle the RAR
-
getResourceAdapter
public jakarta.resource.spi.ResourceAdapter getResourceAdapter()
Retrieves the resource adapter java bean.- Specified by:
getResourceAdapter
in interfaceActiveResourceAdapter
- Overrides:
getResourceAdapter
in classActiveResourceAdapterImpl
- Returns:
ResourceAdapter
-
setup
public void setup() throws ConnectorRuntimeException
Does the necessary initial setup. Creates the default pool and resource.- Specified by:
setup
in interfaceActiveResourceAdapter
- Overrides:
setup
in classActiveResourceAdapterImpl
- Throws:
ConnectorRuntimeException
- If there is a failure
-
destroy
public void destroy()
Destroys default pools and resources. Stops the Resource adapter java bean.- Specified by:
destroy
in interfaceActiveResourceAdapter
- Overrides:
destroy
in classActiveResourceAdapterImpl
-
createManagedConnectionFactory
public jakarta.resource.spi.ManagedConnectionFactory createManagedConnectionFactory(ConnectorConnectionPool pool, ClassLoader jcl)
Creates an instance ofManagedConnectionFactory
object using the connection pool properties. Also set theResourceAdapterAssociation
- Specified by:
createManagedConnectionFactory
in interfaceActiveResourceAdapter
- Overrides:
createManagedConnectionFactory
in classActiveResourceAdapterImpl
- Parameters:
pool
-ConnectorConnectionPool
properties.jcl
-ClassLoader
- Returns:
- ManagedConnectionFactory created managed connection factory instance
-
loadRAConfiguration
protected void loadRAConfiguration() throws ConnectorRuntimeException
Loads RA javabean. This method is protected, so that any system resource adapter can have specific configuration done during the loading.- Throws:
ConnectorRuntimeException
- if there is a failure.
-
mergeRAConfiguration
protected Set mergeRAConfiguration(ResourceAdapterConfig raConfig, List<Property> raConfigProps)
merge RA bean configuration with resource-adapter-config properties Union of both. resource-adapter-config properties will override the values of resource-adapter bean's config- Parameters:
raConfig
- resource-adapter-configraConfigProps
- resource-adapter bean configuration- Returns:
- merged set of config properties
-
getBootStrapContext
public jakarta.resource.spi.BootstrapContext getBootStrapContext()
-
addAdminObject
public void addAdminObject(String appName, String connectorName, ResourceInfo resourceInfo, String adminObjectType, String adminObjectClassName, Properties props) throws ConnectorRuntimeException
Creates an admin object.- Parameters:
appName
- Name of application, in case of embedded rar.connectorName
- Module name of the resource adapter.jndiName
- JNDI name to be registered.adminObjectType
- Interface name of the admin object.props
-Properties
object containing name/value pairs of properties.- Throws:
ConnectorRuntimeException
-
-