Oracle Fusion Middleware User Messaging Service 11.1.1.3.0 Java API Reference
E14011-02

oracle.sdp.messaging.driver
Class DriverManagedConnectionBase

java.lang.Object
  extended by oracle.sdp.messaging.driver.DriverManagedConnectionBase
All Implemented Interfaces:
javax.resource.spi.ManagedConnection, DriverConnection, DriverManagedConnection

public abstract class DriverManagedConnectionBase
extends java.lang.Object
implements DriverManagedConnection

Base implementation of the DriverManagedConnection interface. This implements all the common methods defined in the javax.resource.spi.ManagedConnection interface. The driver provider should extend this base class and implement all the remaining methods defined in the DriverManagedConnection interface (namely, the DriverConnection interface).

For example:

 public class XXXManagedConnetion extends DriverManagedConnetionBase implements DriverManagedConnection {
 
    ...
    
    public List<DriverSendingStatus> send(Message message) {
      // send the message
      ...
    }
    
    ...
    
 }
 

Since:
11.0.0

Field Summary
 
Fields inherited from interface oracle.sdp.messaging.driver.DriverConnection
MESSAGE_ID_MAX_LENGTH
 
Constructor Summary
DriverManagedConnectionBase(Properties adapterProperties)
           
 
Method Summary
 void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
           
 void associateConnection(java.lang.Object conn)
           
 void cleanup()
           
 java.lang.Object getConnection(javax.security.auth.Subject sub, javax.resource.spi.ConnectionRequestInfo info)
           
 DriverContext getDriverContext()
          Get access to the DriverContext associated with this managed connection.
 Properties getDriverProperties()
          Get the driver configuration properties.
 javax.resource.spi.LocalTransaction getLocalTransaction()
           
 PrintWriter getLogWriter()
           
 MessageListener getMessageListener()
          This provides the ability to a non-JCA driver component to get the callback message listener for inbound messaging (and status reporting) from this driver connection.
 javax.resource.spi.ManagedConnectionMetaData getMetaData()
           
 javax.transaction.xa.XAResource getXAResource()
           
 void processHttpServletRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This is a helper method defined for drivers that have HTTP based protocols, and use a servlet to process incoming HTTP requests.
 void removeConnection(DriverConnection conn)
          Remove a client connection instance associated with this managed connection.
 void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
           
 void setDriverContext(DriverContext context)
          Set the DriverContext instance associated with this managed connection.
 void setLogWriter(PrintWriter writer)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.sdp.messaging.driver.DriverConnection
cancel, close, getStatus, getWorkingState, registerMessageListener, replace, send, unregisterMessageListener
 
Methods inherited from interface javax.resource.spi.ManagedConnection
destroy
 

Constructor Detail

DriverManagedConnectionBase

public DriverManagedConnectionBase(Properties adapterProperties)
Method Detail

addConnectionEventListener

public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Specified by:
addConnectionEventListener in interface javax.resource.spi.ManagedConnection
See Also:
ManagedConnection.addConnectionEventListener(javax.resource.spi.ConnectionEventListener)

associateConnection

public void associateConnection(java.lang.Object conn)
                         throws javax.resource.ResourceException
Specified by:
associateConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException
See Also:
ManagedConnection.associateConnection(java.lang.Object)

cleanup

public void cleanup()
             throws javax.resource.ResourceException
Specified by:
cleanup in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException
See Also:
ManagedConnection.cleanup()

getConnection

public java.lang.Object getConnection(javax.security.auth.Subject sub,
                                      javax.resource.spi.ConnectionRequestInfo info)
                               throws javax.resource.ResourceException
Specified by:
getConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException
See Also:
ManagedConnection.getConnection(javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)

getDriverContext

public DriverContext getDriverContext()
Description copied from interface: DriverManagedConnection
Get access to the DriverContext associated with this managed connection.

Specified by:
getDriverContext in interface DriverManagedConnection
Returns:
the DriverContext associated with this managed connection.

getDriverProperties

public Properties getDriverProperties()
Get the driver configuration properties.

Returns:
the driver configuration properties.

getLocalTransaction

public javax.resource.spi.LocalTransaction getLocalTransaction()
                                                        throws javax.resource.ResourceException
Specified by:
getLocalTransaction in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException
See Also:
ManagedConnection.getLocalTransaction()

getLogWriter

public PrintWriter getLogWriter()
                         throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException
See Also:
ManagedConnection.getLogWriter()

getMessageListener

public MessageListener getMessageListener()
                                   throws DriverException
Description copied from interface: DriverConnection
This provides the ability to a non-JCA driver component to get the callback message listener for inbound messaging (and status reporting) from this driver connection. This is useful in cases where the Driver has a servlet or web services based component for inbound messages (and status reports), and it needs to deliver these to the Messaging engine via the Driver RA facility.

Specified by:
getMessageListener in interface DriverConnection
Returns:
the registered message listener
Throws:
DriverException - if there is no registered message listener.

getMetaData

public javax.resource.spi.ManagedConnectionMetaData getMetaData()
                                                         throws javax.resource.ResourceException
Specified by:
getMetaData in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException
See Also:
ManagedConnection.getMetaData()

getXAResource

public javax.transaction.xa.XAResource getXAResource()
                                              throws javax.resource.ResourceException
Specified by:
getXAResource in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException
See Also:
ManagedConnection.getXAResource()

processHttpServletRequest

public void processHttpServletRequest(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)
                               throws DriverException
Description copied from interface: DriverConnection
This is a helper method defined for drivers that have HTTP based protocols, and use a servlet to process incoming HTTP requests. The servlet can pass the processing work to the Driver RA's Connection which has all the other state required to complete the processing, such as generating an inbound message or a status report for delivery to the Messaging engine. By default, this method is implemented by the DriverManagedConnectionBase (which throws a "NotImplemented" DriverException) , but any driver can override this method and use it from it's servlet. See the SampleReceiveServlet code part of the sample driver distribution.

Specified by:
processHttpServletRequest in interface DriverConnection
Parameters:
request - the HTTP servlet request object
response - the HTTP servlet response object
Throws:
DriverException - if there was an error during this operation.

removeConnection

public void removeConnection(DriverConnection conn)
Remove a client connection instance associated with this managed connection.

Parameters:
conn - the client connection instance

removeConnectionEventListener

public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Specified by:
removeConnectionEventListener in interface javax.resource.spi.ManagedConnection
See Also:
ManagedConnection.removeConnectionEventListener(javax.resource.spi.ConnectionEventListener)

setDriverContext

public void setDriverContext(DriverContext context)
Description copied from interface: DriverManagedConnection
Set the DriverContext instance associated with this managed connection.

Specified by:
setDriverContext in interface DriverManagedConnection
Parameters:
context - the DriverContext to associate with this managed connection.

setLogWriter

public void setLogWriter(PrintWriter writer)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException
See Also:
ManagedConnection.setLogWriter(java.io.PrintWriter)

Oracle Fusion Middleware User Messaging Service 11.1.1.3.0 Java API Reference
E14011-02

Copyright © 2010 Oracle and/or its affiliates. All rights reserved.