Joram ${version}

org.objectweb.joram.client.connector
Class JoramAdapter

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

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

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.
 com.scalagent.jmx.JMXServer jmxServer
           
 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 createCF(java.lang.String name)
          Creates a non managed connection factory and binds it to JNDI.
 void createQCF(java.lang.String name)
          Creates a non managed PTP connection factory and binds it to JNDI.
 javax.jms.Destination createQueue(int serverId, java.lang.String name)
          Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the corresponding Queue instance.
 javax.jms.Destination createQueue(int serverId, java.lang.String name, java.lang.String className, java.util.Properties prop)
          Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the corresponding Queue instance.
 javax.jms.Destination createQueue(java.lang.String name)
          Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the corresponding Queue instance.
 void createTCF(java.lang.String name)
          Creates a non managed PubSub connection factory and binds it to JNDI.
 javax.jms.Destination createTopic(int serverId, java.lang.String name)
          Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the corresponding Topic instance.
 javax.jms.Destination createTopic(int serverId, java.lang.String name, java.lang.String className, java.util.Properties prop)
          Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the corresponding Topic instance.
 javax.jms.Destination createTopic(java.lang.String name)
          Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the corresponding Topic instance.
 void createUser(java.lang.String name, java.lang.String password)
          Creates or retrieves a user on the underlying JORAM server.
 void createUser(java.lang.String name, java.lang.String password, int serverId)
          Creates or retrieves a user on the underlying JORAM server.
 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.
 void exit()
           
 java.lang.String getAdminFile()
          Path to the file containing a description of the administered objects to create and bind.
 java.lang.Integer getCnxPendingTimer()
          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.
 java.lang.Boolean getCollocatedServer()
           
 java.lang.Integer getConnectingTimer()
          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.
 DeadMQueue getDefaultDMQ()
           
 DeadMQueue getDefaultDMQ(int serverId)
           
 java.util.List getDestinations()
           
 java.util.List getDestinations(int serverId)
           
 java.lang.String getHostName()
           
 java.util.List getLocalUsers()
           
 java.lang.Boolean getPersistentPlatform()
          true if the JORAM server to start is persistent.
 java.lang.String getPlatformConfigDir()
          Path to the directory containing JORAM's configuration files (a3servers.xml, a3debug.cfg and admin file), needed when starting the collocated JORAM server.
 java.util.List getPlatformServersIds()
          Platform servers identifiers.
 java.lang.Short getServerId()
          Identifier of the JORAM server to start.
 java.lang.String getServerName()
          Name of the JORAM server to start.
 java.lang.Integer getServerPort()
           
 long getTimeOutToAbortRequest()
          wait before abort a request.
 java.lang.Integer getTxPendingTimer()
          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".
 java.util.List getUsers()
           
 java.util.List getUsers(int serverId)
           
 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 removeDestination(java.lang.String name)
          Remove a destination on the underlying JORAM server
 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 setDefaultDMQ(int serverId, DeadMQueue dmq)
           
 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 setTimeOutToAbortRequest(long timeOut)
          wait before abort a request.
 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.


jmxServer

public com.scalagent.jmx.JMXServer jmxServer
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.


getDestinations

public java.util.List getDestinations()
Specified by:
getDestinations in interface JoramAdminMBean

getDestinations

public java.util.List getDestinations(int serverId)
Specified by:
getDestinations in interface JoramAdminMBean

getUsers

public java.util.List getUsers()
Specified by:
getUsers in interface JoramAdminMBean

getUsers

public java.util.List getUsers(int serverId)
Specified by:
getUsers in interface JoramAdminMBean

getPlatformServersIds

public java.util.List getPlatformServersIds()
Description copied from interface: JoramAdapterMBean
Platform servers identifiers.

Specified by:
getPlatformServersIds in interface JoramAdapterMBean

getLocalUsers

public java.util.List getLocalUsers()
Specified by:
getLocalUsers in interface JoramAdapterMBean

setDefaultDMQ

public void setDefaultDMQ(int serverId,
                          DeadMQueue dmq)
                   throws java.net.ConnectException,
                          AdminException
Specified by:
setDefaultDMQ in interface JoramAdminMBean
Throws:
java.net.ConnectException
AdminException

getDefaultDMQ

public DeadMQueue getDefaultDMQ(int serverId)
                         throws java.net.ConnectException,
                                AdminException
Specified by:
getDefaultDMQ in interface JoramAdminMBean
Throws:
java.net.ConnectException
AdminException

getDefaultDMQ

public DeadMQueue getDefaultDMQ()
                         throws java.net.ConnectException,
                                AdminException
Specified by:
getDefaultDMQ in interface JoramAdminMBean
Throws:
java.net.ConnectException
AdminException

exit

public void exit()
Specified by:
exit in interface JoramAdminMBean

setTimeOutToAbortRequest

public void setTimeOutToAbortRequest(long timeOut)
wait before abort a request.

Specified by:
setTimeOutToAbortRequest in interface JoramAdminMBean

getTimeOutToAbortRequest

public long getTimeOutToAbortRequest()
wait before abort a request.

Specified by:
getTimeOutToAbortRequest in interface JoramAdminMBean

createUser

public void createUser(java.lang.String name,
                       java.lang.String password)
                throws AdminException
Creates or retrieves a user on the underlying JORAM server.

Specified by:
createUser in interface JoramAdminMBean
Throws:
AdminException - If the creation fails.

createUser

public void createUser(java.lang.String name,
                       java.lang.String password,
                       int serverId)
                throws AdminException
Creates or retrieves a user on the underlying JORAM server.

Specified by:
createUser in interface JoramAdminMBean
Throws:
AdminException - If the creation fails.

createCF

public void createCF(java.lang.String name)
Creates a non managed connection factory and binds it to JNDI.


createQCF

public void createQCF(java.lang.String name)
Creates a non managed PTP connection factory and binds it to JNDI.


createTCF

public void createTCF(java.lang.String name)
Creates a non managed PubSub connection factory and binds it to JNDI.


createQueue

public javax.jms.Destination createQueue(int serverId,
                                         java.lang.String name,
                                         java.lang.String className,
                                         java.util.Properties prop)
                                  throws AdminException
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the corresponding Queue instance.

Specified by:
createQueue in interface JoramAdminMBean
Parameters:
serverId - The identifier of the server where deploying the queue.
name - The name of the queue.
className - The queue class name.
prop - The queue properties.
Throws:
AdminException - If the creation fails.

createQueue

public javax.jms.Destination createQueue(int serverId,
                                         java.lang.String name)
                                  throws AdminException
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the corresponding Queue instance.

Specified by:
createQueue in interface JoramAdminMBean
Parameters:
serverId - The identifier of the server where deploying the queue.
name - The name of the queue.
Throws:
AdminException - If the creation fails.

createQueue

public javax.jms.Destination createQueue(java.lang.String name)
                                  throws AdminException
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the corresponding Queue instance.

Specified by:
createQueue in interface JoramAdminMBean
Parameters:
name - The name of the queue.
Throws:
AdminException - If the creation fails.

createTopic

public javax.jms.Destination createTopic(int serverId,
                                         java.lang.String name,
                                         java.lang.String className,
                                         java.util.Properties prop)
                                  throws AdminException
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the corresponding Topic instance.

Specified by:
createTopic in interface JoramAdminMBean
Parameters:
serverId - The identifier of the server where deploying the topic.
name - The name of the topic.
className - The topic class name.
prop - The topic properties.
Throws:
AdminException - If the creation fails.

createTopic

public javax.jms.Destination createTopic(int serverId,
                                         java.lang.String name)
                                  throws AdminException
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the corresponding Topic instance.

Specified by:
createTopic in interface JoramAdminMBean
Parameters:
serverId - The identifier of the server where deploying the topic.
name - The name of the topic.
Throws:
AdminException - If the creation fails.

createTopic

public javax.jms.Destination createTopic(java.lang.String name)
                                  throws AdminException
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the corresponding Topic instance.

Specified by:
createTopic in interface JoramAdminMBean
Parameters:
name - The name of the topic.
Throws:
AdminException - If the creation fails.

removeDestination

public void removeDestination(java.lang.String name)
                       throws AdminException
Remove a destination on the underlying JORAM server

Specified by:
removeDestination in interface JoramAdapterMBean
Parameters:
name - The name of the destination.
Throws:
AdminException

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()
Description copied from interface: JoramAdapterMBean
Path to the directory containing JORAM's configuration files (a3servers.xml, a3debug.cfg and admin file), needed when starting the collocated JORAM server.

Specified by:
getPlatformConfigDir in interface JoramAdapterMBean

getPersistentPlatform

public java.lang.Boolean getPersistentPlatform()
Description copied from interface: JoramAdapterMBean
true if the JORAM server to start is persistent.

Specified by:
getPersistentPlatform in interface JoramAdapterMBean

getServerId

public java.lang.Short getServerId()
Description copied from interface: JoramAdapterMBean
Identifier of the JORAM server to start.

Specified by:
getServerId in interface JoramAdapterMBean

getServerName

public java.lang.String getServerName()
Description copied from interface: JoramAdapterMBean
Name of the JORAM server to start.

Specified by:
getServerName in interface JoramAdapterMBean

getAdminFile

public java.lang.String getAdminFile()
Description copied from interface: JoramAdapterMBean
Path to the file containing a description of the administered objects to create and bind.

Specified by:
getAdminFile in interface JoramAdapterMBean

getCollocatedServer

public java.lang.Boolean getCollocatedServer()
Specified by:
getCollocatedServer in interface JoramAdapterMBean

getHostName

public java.lang.String getHostName()
Specified by:
getHostName in interface JoramAdapterMBean

getServerPort

public java.lang.Integer getServerPort()
Specified by:
getServerPort in interface JoramAdapterMBean

getConnectingTimer

public java.lang.Integer getConnectingTimer()
Description copied from interface: JoramAdapterMBean
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.

Specified by:
getConnectingTimer in interface JoramAdapterMBean

getTxPendingTimer

public java.lang.Integer getTxPendingTimer()
Description copied from interface: JoramAdapterMBean
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".

Specified by:
getTxPendingTimer in interface JoramAdapterMBean

getCnxPendingTimer

public java.lang.Integer getCnxPendingTimer()
Description copied from interface: JoramAdapterMBean
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.

Specified by:
getCnxPendingTimer in interface JoramAdapterMBean

Joram ${version}

Copyright © 2005 Scalagent - All rights reserved