java.lang.Object | +--com.ibm.commerce.messaging.adapters.jcasample.SampleConnectionFactory
This class provides a client API for getting a managed connection. A connection manager (of type javax.resource.spi.ConnectionManager) is assigned to this class by the application server during class construction. With this connection manager provided by the application server, the application creates a connection using getConnection method by calling ConnectionManager.allocateConnection method. Doing so, the application server can provide connection pooling and other services.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT Copyright statement. |
Constructor Summary | |
---|---|
SampleConnectionFactory(ConnectionManager cm,
ManagedConnectionFactory mcf) SampleConnectionFactory constructor |
Method Summary | |
---|---|
Connection |
getConnection() Gets a connection allocated by connection manager.It invokes the ConnectionManager.allocateConnection method of the application server. |
Connection |
getConnection(ConnectionSpec cSpec) Gets the connection allocated by connection manager. |
ResourceAdapterMetaData |
getMetaData() Gets the meta data |
RecordFactory |
getRecordFactory() Gets the record factory |
javax.naming.Reference |
getReference() Gets the reference of this class. |
void |
setReference(javax.naming.Reference reference) Sets the class field reference to the one provided. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public SampleConnectionFactory(ConnectionManager cm, ManagedConnectionFactory mcf)
cm
- The javax.resource.spi.ConnectionManagermcf
- The ManagedConnectionFactoryMethod Detail |
---|
public Connection getConnection() throws ResourceException
javax.resource.ResourceException
- Raised if cannot get a
connection from the application server.ResourceException
public Connection getConnection(ConnectionSpec cSpec) throws ResourceException
cSpec
- The connectionSpecjavax.resource.ResourceException
- Raised if cannot get a
connection from the appliction server.ResourceException
public ResourceAdapterMetaData getMetaData() throws ResourceException
javax.resource.ResourceException
ResourceException
public RecordFactory getRecordFactory() throws ResourceException
javax.resource.ResourceException
ResourceException
public void setReference(javax.naming.Reference reference)
reference
- The referencepublic javax.naming.Reference getReference()