@Service @PerLookup public class ActiveResourceAdapterImpl extends Object implements ActiveResourceAdapter
| Modifier and Type | Field and Description |
|---|---|
protected ConnectionDefDescriptor[] |
connectionDefs_ |
protected ConnectorRuntime |
connectorRuntime_ |
protected ConnectorDescriptor |
desc_ |
protected ClassLoader |
jcl_ |
protected String |
moduleName_ |
| Constructor and Description |
|---|
ActiveResourceAdapterImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createAllConnectorResources()
Creates both the default connector connection pools and resources
|
protected void |
createDefaultConnectorConnectionPools(boolean useSunRA)
Creates default connector connection pool
|
protected void |
createDefaultConnectorResources()
Creates default connector resource
|
javax.resource.spi.ManagedConnectionFactory[] |
createManagedConnectionFactories(ConnectorConnectionPool ccp,
ClassLoader jcl)
Creates managed Connection factories corresponding to one pool.
|
javax.resource.spi.ManagedConnectionFactory |
createManagedConnectionFactory(ConnectorConnectionPool ccp,
ClassLoader jcl)
Creates managed Connection factory instance.
|
protected void |
deleteDefaultConnectorConnectionPools()
Deletes the default connector connection pools.
|
protected void |
deleteDefaultConnectorResources()
Deletes the default connector resources.
|
void |
destroy()
uninitializes the resource adapter.
|
protected void |
destroyAllConnectorResources()
Deletes both the default connector connection pools and resources
|
ClassLoader |
getClassLoader()
Returns the class loader that is used to load the RAR.
|
ConnectorDescriptor |
getDescriptor()
Returns the Connector descriptor which represents/holds ra.xml
|
String |
getModuleName()
Returns the module Name of the RAR
|
javax.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(javax.resource.spi.ResourceAdapter ra,
ConnectorDescriptor desc,
String moduleName,
ClassLoader jcl)
Constructor.
|
protected javax.resource.spi.ManagedConnectionFactory |
instantiateMCF(String mcfClass,
ClassLoader loader) |
protected boolean |
isServer()
Check if the execution environment is appserver runtime or application
client container.
|
protected boolean |
isSystemRar(String moduleName) |
void |
setup()
It initializes the resource adapter.
|
protected ConnectorDescriptor desc_
protected String moduleName_
protected ClassLoader jcl_
protected ConnectionDefDescriptor[] connectionDefs_
protected ConnectorRuntime connectorRuntime_
public void init(javax.resource.spi.ResourceAdapter ra,
ConnectorDescriptor desc,
String moduleName,
ClassLoader jcl)
throws ConnectorRuntimeException
init in interface ActiveResourceAdapterdesc - Connector Descriptor. Holds the all ra.xml valuesmoduleName - Name of the module i.e rar Name. Incase of
embedded resource adapters its name will be appName#rarNamejcl - Classloader used to load the ResourceAdapter and managed
connection factory class.
values to domain.xml.ra - resource-adapter beanConnectorRuntimeException - when unable to initialize the runtime RApublic String getModuleName()
getModuleName in interface ActiveResourceAdapterString representing the name of the
connector modulepublic void setup()
throws ConnectorRuntimeException
setup in interface ActiveResourceAdapterConnectorRuntimeException - This exception is thrown if the
ra.xml is invalid or the default pools and resources couldn't
be createdprotected boolean isServer()
protected void createAllConnectorResources()
throws ConnectorRuntimeException
ConnectorRuntimeException - when unable to create resourcesprotected void destroyAllConnectorResources()
protected boolean isSystemRar(String moduleName)
protected void deleteDefaultConnectorConnectionPools()
protected void deleteDefaultConnectorResources()
public void destroy()
destroy in interface ActiveResourceAdapterpublic ConnectorDescriptor getDescriptor()
getDescriptor in interface ActiveResourceAdapterpublic boolean handles(ConnectorDescriptor cd, String moduleName)
handles in interface ActiveResourceAdaptercd - ConnectorDescriptormoduleName - resource adapter namepublic javax.resource.spi.ManagedConnectionFactory[] createManagedConnectionFactories(ConnectorConnectionPool ccp, ClassLoader jcl)
createManagedConnectionFactories in interface ActiveResourceAdapterccp - Connector connection pool which contains the pool properties
and ra.xml values pertaining to managed connection factory
class. These values are used in MCF creation.jcl - Classloader used to managed connection factory class.public javax.resource.spi.ManagedConnectionFactory createManagedConnectionFactory(ConnectorConnectionPool ccp, ClassLoader jcl)
createManagedConnectionFactory in interface ActiveResourceAdapterccp - Connector connection pool which contains the pool properties
and ra.xml values pertaining to managed connection factory
class. These values are used in MCF creation.jcl - Classloader used to managed connection factory class.protected javax.resource.spi.ManagedConnectionFactory instantiateMCF(String mcfClass, ClassLoader loader) throws Exception
Exceptionprotected void createDefaultConnectorResources()
throws ConnectorRuntimeException
ConnectorRuntimeException - when unable to create connector resourcesprotected void createDefaultConnectorConnectionPools(boolean useSunRA)
throws ConnectorRuntimeException
useSunRA - whether to use default pool settings or settings in sun-ra.xmlConnectorRuntimeException - when unable to create connector connection poolspublic ClassLoader getClassLoader()
getClassLoader in interface ActiveResourceAdapterClassLoader object.public javax.resource.spi.ResourceAdapter getResourceAdapter()
getResourceAdapter in interface ActiveResourceAdapterResourceAdapterCopyright © 2019. All rights reserved.