The Adapter Framework provides, through the MessageEndpointFactory
, an instance of the ConnectionFactory
, as defined in the <connection-factory>
element in the .jca
property file, which then can be used by the resource adapter to create connections:
javax.resource.cci.ConnectionFactory connectionFactory = ((ConnectionFactoryAssociation)activationSpec).getConnectionFactory(); javax.resource.cci.Connection connection = connectionFactory.getConnection();
During this invocation, the resource adapter must use the MessageEndpointFactory
to create the inbound endpoint and to submit a Work request for execution, which constitutes the inbound thread that monitors the inbound EIS endpoint.
ResourceAdapterInboundWorkerThread workRequest = new ResourceAdapterInboundWorkerThread(endpoint, activationSpec, connection); workManager.startWork(workRequest);
Here ResourceAdapterInboundWorkerThread
is the resource adapter's implementation of javax.resource.spi.work
.Work
.
Soon after returning from startWork(),
the Adapter Framework allocates and assigns a thread to the submitted workRequest
by calling its run()
method.
The following method, endpointDeactivation, is called by the Adapter Framework when a message endpoint is deactivated; that is, either when the composite having activated the endpoint shuts down, or when the application server shuts down.
public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
Note:
For a custom adapter to work in the Oracle Weblogic environment, the custom adapter's Connetion Factory needs to implementoracle.tip.adapter.api.OracleConnectionFactory
. If the custom adapter's Connetion Factory needs to implement oracle.tip.adapter.api.OracleConnectionFactory
, then add a <resource-adapter>
element to the <connection-factory>
in the .jca generated by JDeveloper. For example,
<connection-factory location="eis/Custom/CustomAdapter"/> <resource-adapter className="com.custom.oracle.fusion.adapter.CustomAdapter"/> </connection-factory>