org.objectweb.joram.client.connector
Class JoramAdapter

java.lang.Object
  extended byorg.objectweb.joram.client.connector.JoramAdapter
All Implemented Interfaces:
javax.resource.spi.ResourceAdapter, java.io.Serializable

public class JoramAdapter
extends java.lang.Object
implements javax.resource.spi.ResourceAdapter, java.io.Serializable

A JoramAdapter instance manages connectivities to an underlying JORAM server: outbound connectivity (JCA connection management contract) and inbound connectivity (asynchronous message delivery as specified by the JCA message inflow contract).

See Also:
Serialized Form

Field Summary
 int cnxPendingTimer
          Period in milliseconds between two ping requests sent by the client connection to the server; if the server does not receive any ping request during more than 2 * cnxPendingTimer, the connection is considered as dead and processed as required.
 int connectingTimer
          Duration in seconds during which connecting is attempted (connecting might take time if the server is temporarily not reachable); the 0 value is set for connecting only once and aborting if connecting failed.
 int txPendingTimer
          Duration in seconds during which a JMS transacted (non XA) session might be pending; above that duration the session is rolled back and closed; the 0 value means "no timer".
 
Constructor Summary
JoramAdapter()
          Constructs a JoramAdapter instance.
 
Method Summary
 void endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory, javax.resource.spi.ActivationSpec spec)
          Notifies the adapter to setup asynchronous message delivery for an application server endoint.
 void endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory, javax.resource.spi.ActivationSpec spec)
          Notifies the adapter to deactivate message delivery for a given endpoint.
 boolean equals(java.lang.Object o)
          Compares adapters according to their properties.
 java.lang.String getAdminFile()
           
 java.lang.Integer getCnxPendingTimer()
           
 java.lang.Boolean getCollocatedServer()
           
 java.lang.Integer getConnectingTimer()
           
 java.lang.String getHostName()
           
 java.lang.Boolean getPersistentPlatform()
           
 java.lang.String getPlatformConfigDir()
           
 java.lang.Short getServerId()
           
 java.lang.String getServerName()
           
 java.lang.Integer getServerPort()
           
 java.lang.Integer getTxPendingTimer()
           
 javax.transaction.xa.XAResource[] getXAResources(javax.resource.spi.ActivationSpec[] specs)
          Returns XA resources given an array of ActivationSpec instances.
 int hashCode()
          Returns a code depending on the adapter properties.
 void setAdminFile(java.lang.String adminFile)
           
 void setCnxPendingTimer(java.lang.Integer cnxPendingTimer)
           
 void setCollocatedServer(java.lang.Boolean collocatedServer)
           
 void setConnectingTimer(java.lang.Integer connectingTimer)
           
 void setHostName(java.lang.String hostName)
           
 void setPersistentPlatform(java.lang.Boolean persistentPlatform)
           
 void setPlatformConfigDir(java.lang.String platformConfigDir)
           
 void setServerId(java.lang.Short serverId)
           
 void setServerName(java.lang.String serverName)
           
 void setServerPort(java.lang.Integer serverPort)
           
 void setTxPendingTimer(java.lang.Integer txPendingTimer)
           
 void start(javax.resource.spi.BootstrapContext ctx)
          Initializes the adapter; starts, if needed, a collocated JORAM server, and if needed again, administers it.
 void stop()
          Notifies the adapter to terminate the connections it manages, and if needed, to shut down the collocated JORAM server.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectingTimer

public int connectingTimer
Duration in seconds during which connecting is attempted (connecting might take time if the server is temporarily not reachable); the 0 value is set for connecting only once and aborting if connecting failed.


txPendingTimer

public int txPendingTimer
Duration in seconds during which a JMS transacted (non XA) session might be pending; above that duration the session is rolled back and closed; the 0 value means "no timer".


cnxPendingTimer

public int cnxPendingTimer
Period in milliseconds between two ping requests sent by the client connection to the server; if the server does not receive any ping request during more than 2 * cnxPendingTimer, the connection is considered as dead and processed as required.

Constructor Detail

JoramAdapter

public JoramAdapter()
Constructs a JoramAdapter instance.

Method Detail

start

public void start(javax.resource.spi.BootstrapContext ctx)
           throws javax.resource.spi.ResourceAdapterInternalException
Initializes the adapter; starts, if needed, a collocated JORAM server, and if needed again, administers it.

Specified by:
start in interface javax.resource.spi.ResourceAdapter
Throws:
javax.resource.spi.ResourceAdapterInternalException - If the adapter could not be initialized.

stop

public void stop()
Notifies the adapter to terminate the connections it manages, and if needed, to shut down the collocated JORAM server.

Specified by:
stop in interface javax.resource.spi.ResourceAdapter

endpointActivation

public void endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory,
                               javax.resource.spi.ActivationSpec spec)
                        throws javax.resource.ResourceException
Notifies the adapter to setup asynchronous message delivery for an application server endoint.

Specified by:
endpointActivation in interface javax.resource.spi.ResourceAdapter
Throws:
javax.resource.spi.IllegalStateException - If the adapter is either not started, or stopped.
javax.resource.NotSupportedException - If the provided activation parameters are invalid.
javax.resource.spi.CommException - If the JORAM server is not reachable.
java.lang.SecurityException - If connecting is not allowed.
javax.resource.ResourceException - Generic exception.

endpointDeactivation

public void endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory,
                                 javax.resource.spi.ActivationSpec spec)
Notifies the adapter to deactivate message delivery for a given endpoint.

Specified by:
endpointDeactivation in interface javax.resource.spi.ResourceAdapter

getXAResources

public javax.transaction.xa.XAResource[] getXAResources(javax.resource.spi.ActivationSpec[] specs)
                                                 throws javax.resource.ResourceException
Returns XA resources given an array of ActivationSpec instances.

Specified by:
getXAResources in interface javax.resource.spi.ResourceAdapter
Throws:
javax.resource.spi.IllegalStateException - If the adapter is either not started, or stopped.
javax.resource.NotSupportedException - If provided activation parameters are invalid.
javax.resource.spi.CommException - If the JORAM server is not reachable.
java.lang.SecurityException - If connecting is not allowed.
javax.resource.ResourceException - Generic exception.

hashCode

public int hashCode()
Returns a code depending on the adapter properties.


equals

public boolean equals(java.lang.Object o)
Compares adapters according to their properties.


setPlatformConfigDir

public void setPlatformConfigDir(java.lang.String platformConfigDir)

setPersistentPlatform

public void setPersistentPlatform(java.lang.Boolean persistentPlatform)

setServerId

public void setServerId(java.lang.Short serverId)

setServerName

public void setServerName(java.lang.String serverName)

setAdminFile

public void setAdminFile(java.lang.String adminFile)

setCollocatedServer

public void setCollocatedServer(java.lang.Boolean collocatedServer)

setHostName

public void setHostName(java.lang.String hostName)

setServerPort

public void setServerPort(java.lang.Integer serverPort)

setConnectingTimer

public void setConnectingTimer(java.lang.Integer connectingTimer)

setTxPendingTimer

public void setTxPendingTimer(java.lang.Integer txPendingTimer)

setCnxPendingTimer

public void setCnxPendingTimer(java.lang.Integer cnxPendingTimer)

getPlatformConfigDir

public java.lang.String getPlatformConfigDir()

getPersistentPlatform

public java.lang.Boolean getPersistentPlatform()

getServerId

public java.lang.Short getServerId()

getServerName

public java.lang.String getServerName()

getAdminFile

public java.lang.String getAdminFile()

getCollocatedServer

public java.lang.Boolean getCollocatedServer()

getHostName

public java.lang.String getHostName()

getServerPort

public java.lang.Integer getServerPort()

getConnectingTimer

public java.lang.Integer getConnectingTimer()

getTxPendingTimer

public java.lang.Integer getTxPendingTimer()

getCnxPendingTimer

public java.lang.Integer getCnxPendingTimer()


Copyright ? 2004 Scalagent - All rights reserved