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_loggerprotected jakarta.resource.spi.BootstrapContextbootStrapContextImplprotected jakarta.resource.spi.ResourceAdapterresourceadapter_-
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 voidaddAdminObject(String appName, String connectorName, ResourceInfo resourceInfo, String adminObjectType, String adminObjectClassName, Properties props)Creates an admin object.jakarta.resource.spi.ManagedConnectionFactorycreateManagedConnectionFactory(ConnectorConnectionPool pool, ClassLoader jcl)Creates an instance ofManagedConnectionFactoryobject using the connection pool properties.voiddestroy()Destroys default pools and resources.jakarta.resource.spi.BootstrapContextgetBootStrapContext()jakarta.resource.spi.ResourceAdaptergetResourceAdapter()Retrieves the resource adapter java bean.booleanhandles(ConnectorDescriptor cd, String moduleName)Indicates whether a particular implementation of ActiveRA can handle the RAR in question.voidinit(jakarta.resource.spi.ResourceAdapter ra, ConnectorDescriptor desc, String moduleName, ClassLoader jcl)Creates an active inbound resource adapter.protected voidloadRAConfiguration()Loads RA javabean.protected SetmergeRAConfiguration(ResourceAdapterConfig raConfig, List<Property> raConfigProps)merge RA bean configuration with resource-adapter-config properties Union of both.voidsetup()Does the necessary initial setup.protected voidstartResourceAdapter(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 ConnectorRuntimeExceptionCreates an active inbound resource adapter. Sets all RA java bean properties and issues a start.- Specified by:
initin interfaceActiveResourceAdapter- Overrides:
initin classActiveResourceAdapterImpl- Parameters:
ra-ResourceAdapterjava bean.desc-ConnectorDescriptorobject.moduleName- Resource adapter module name.jcl-ClassLoaderinstance.- 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.ResourceAdapterInternalExceptioncalled 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:
handlesin interfaceActiveResourceAdapter- Overrides:
handlesin 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:
getResourceAdapterin interfaceActiveResourceAdapter- Overrides:
getResourceAdapterin classActiveResourceAdapterImpl- Returns:
ResourceAdapter
-
setup
public void setup() throws ConnectorRuntimeExceptionDoes the necessary initial setup. Creates the default pool and resource.- Specified by:
setupin interfaceActiveResourceAdapter- Overrides:
setupin 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:
destroyin interfaceActiveResourceAdapter- Overrides:
destroyin classActiveResourceAdapterImpl
-
createManagedConnectionFactory
public jakarta.resource.spi.ManagedConnectionFactory createManagedConnectionFactory(ConnectorConnectionPool pool, ClassLoader jcl)
Creates an instance ofManagedConnectionFactoryobject using the connection pool properties. Also set theResourceAdapterAssociation- Specified by:
createManagedConnectionFactoryin interfaceActiveResourceAdapter- Overrides:
createManagedConnectionFactoryin classActiveResourceAdapterImpl- Parameters:
pool-ConnectorConnectionPoolproperties.jcl-ClassLoader- Returns:
- ManagedConnectionFactory created managed connection factory instance
-
loadRAConfiguration
protected void loadRAConfiguration() throws ConnectorRuntimeExceptionLoads 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-Propertiesobject containing name/value pairs of properties.- Throws:
ConnectorRuntimeException
-
-