org.exolab.jms.server.mipc
Class IpcJmsSessionConnection

java.lang.Object
  |
  +--org.exolab.jms.server.mipc.IpcJmsSessionConnection
All Implemented Interfaces:
org.exolab.core.ipc.NotifierIfc
Direct Known Subclasses:
HttpJmsSessionConnection

public class IpcJmsSessionConnection
extends java.lang.Object
implements org.exolab.core.ipc.NotifierIfc

This is the server side receiver for JmsSession requests. All requests are unpacked and passed on to the appropriate JmsServerSession object.

Version:
$Revision: 1.28 $ $Date: 2003/08/30 07:58:51 $
Author:
Jim Mourikis
See Also:
IpcJmsReceiver, JmsServerConnection, JmsServerConnectionManager, JmsServerSession

Constructor Summary
IpcJmsSessionConnection(IpcJmsServer server)
          Construct a new IpcJmsSessionConnection
 
Method Summary
protected  java.util.Vector acknowledgeMessage(JmsServerSession session, java.lang.Long clientId, java.lang.String id)
          Acknowledge a JmsMessage
protected  java.util.Vector close(JmsServerSession session, org.exolab.core.mipc.MultiplexConnectionIfc connection)
          A close session request has been received.
protected  java.util.Vector commit(JmsServerSession session)
          commit the session
protected  java.util.Vector createBrowser(JmsServerSession session, JmsQueue queue, java.lang.Long clientId, java.lang.String selector, org.exolab.core.mipc.MultiplexConnectionIfc connection, java.lang.String host, java.lang.String port, java.lang.String url)
          Create a new queue browser for the specified session and queue.
protected  java.util.Vector createPublisher(JmsServerSession session, JmsTopic topic)
          Create a new publisher for the given topic.
protected  java.util.Vector createQueue(JmsServerSession session, JmsQueue queue)
          Create a new Queue.
protected  java.util.Vector createReceiver(JmsServerSession session, JmsQueue queue, java.lang.Long consumerId, java.lang.String selector, org.exolab.core.mipc.MultiplexConnectionIfc connection, java.lang.String host, java.lang.String port, java.lang.String url)
          Create a new receiver
protected  java.util.Vector createSender(JmsServerSession session, JmsQueue queue)
          Create a new sender for the given queue.
protected  java.util.Vector createSubscriber(JmsServerSession session, JmsTopic topic, java.lang.String name, java.lang.Long clientId, java.lang.String selector, java.lang.Boolean noLocal, org.exolab.core.mipc.MultiplexConnectionIfc connection, java.lang.String host, java.lang.String port, java.lang.String url)
          Create a new subscriber, and connect back to the client through the MultiplexConnection.
protected  java.util.Vector createTopic(JmsServerSession session, JmsTopic topic)
          Create a new topic
protected  java.util.Vector deleteBrowser(JmsServerSession session, java.lang.Long clientId)
          Delete the queue browser for the specified queue.
protected  java.util.Vector deletePublisher(JmsServerSession session, JmsTopic topic)
          Delete a publisher for the given topic.
protected  java.util.Vector deleteReceiver(JmsServerSession session, java.lang.Long clientId)
          Delete the receiver for this queue.
protected  java.util.Vector deleteSender(JmsServerSession session, java.lang.Long clientId)
          Delete the sender for this queue.
protected  java.util.Vector deleteSubscriber(JmsServerSession session, java.lang.Long clientId)
          Delete a subscriber for the given topic
 void disconnection(java.lang.String id)
          The connection has been broken.
protected  java.util.Vector enableAsynchronousDelivery(JmsServerSession session, java.lang.Long clientId, java.lang.String id, java.lang.Boolean enable)
          Enable or disable asynchronous message delivery.
protected  org.exolab.core.mipc.MultiplexConnectionIfc getConnection(java.lang.String id)
          A convenience routine to get the MutliplexConnection.
protected  JmsServerSession getSession(java.lang.String id, java.util.Vector v)
          A convenience routine to get the session.
 java.io.Serializable notify(java.lang.Object ob, java.lang.String id)
          A new request has been received.
protected  java.util.Vector pack(java.lang.Boolean success, java.lang.Object ob)
          Pack all the data that is required by the server in a vector.
protected  java.util.Vector receiveMessage(JmsServerSession session, java.lang.Long clientId, java.lang.Long wait)
          Receive a message from the provider
protected  java.util.Vector receiveMessages(JmsServerSession session, java.lang.Long clientId, java.lang.Integer count)
          Receive upto count messages from the endpoint
protected  java.util.Vector recover(JmsServerSession session)
          recover the session
protected  java.util.Vector rollback(JmsServerSession session)
          rollback the session
protected  java.util.Vector sendMessage(JmsServerSession session, javax.jms.Message message)
          A JmsMessage has been sent.
protected  java.util.Vector sendMessages(JmsServerSession session, java.util.Vector messages)
          A collection of messages have been sent
protected  java.util.Vector startMessageDelivery(JmsServerSession session)
          Start message delivery for this session.
protected  java.util.Vector stopMessageDelivery(JmsServerSession session)
          Stop message delivery for this session.
 java.util.Vector unsubscribe(JmsServerSession session, java.lang.String name)
          Unsubscribe a durable subscription
protected  java.util.Vector XACommit(JmsServerSession session, javax.transaction.xa.Xid xid, java.lang.Boolean onePhase)
          Commits an XA transaction that is in progress.
protected  java.util.Vector XAEnd(JmsServerSession session, javax.transaction.xa.Xid xid, java.lang.Integer flags)
          Ends the work performed on behalf of a transaction branch.
protected  java.util.Vector XAForget(JmsServerSession session, javax.transaction.xa.Xid xid)
          Tell the resource manager to forget about a heuristically completed transaction branch.
protected  java.util.Vector XAGetResourceManagerId(JmsServerSession session)
          Return the identity of the resource manager.
protected  java.util.Vector XAGetTransactionTimeout(JmsServerSession session)
          Return the transaction timeout for this instance of the resource manager.
protected  java.util.Vector XAPrepare(JmsServerSession session, javax.transaction.xa.Xid xid)
          Ask the resource manager to prepare for a transaction commit of the transaction specified in xid
 java.util.Vector XARecover(JmsServerSession session, java.lang.Integer flag)
          Obtain a list of prepared transaction branches from a resource manager.
protected  java.util.Vector XARollback(JmsServerSession session, javax.transaction.xa.Xid xid)
          Inform the resource manager to roll back work done on behalf of a transaction branch
protected  java.util.Vector XASetTransactionTimeout(JmsServerSession session, java.lang.Integer seconds)
          Set the current transaction timeout value for this XAResource instance.
protected  java.util.Vector XAStart(JmsServerSession session, javax.transaction.xa.Xid xid, java.lang.Integer flags)
          Start work on behalf of a transaction branch specified in xid If TMJOIN is specified, the start is for joining a transaction previously seen by the resource manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IpcJmsSessionConnection

public IpcJmsSessionConnection(IpcJmsServer server)
Construct a new IpcJmsSessionConnection
Parameters:
server - the server instance
Method Detail

notify

public java.io.Serializable notify(java.lang.Object ob,
                                   java.lang.String id)
A new request has been received. Carry out the request, and pass back any relevent data.
Specified by:
notify in interface org.exolab.core.ipc.NotifierIfc
Parameters:
ob - The data received
id - The unique IPC id of the connection
The - unique identifier of this connection.
Returns:
Object Return any requested result. This must never be null.

disconnection

public void disconnection(java.lang.String id)
The connection has been broken.
Specified by:
disconnection in interface org.exolab.core.ipc.NotifierIfc
Parameters:
id - The unique identifier of this connection.

getSession

protected JmsServerSession getSession(java.lang.String id,
                                      java.util.Vector v)
A convenience routine to get the session.
Parameters:
id - The unique IPC id of the connection
v - The vector containing the packed data from the client.
Returns:
JmsServerSession The required session or null if not found.

getConnection

protected org.exolab.core.mipc.MultiplexConnectionIfc getConnection(java.lang.String id)
A convenience routine to get the MutliplexConnection.
Parameters:
id - The unique IPC id of the connection
Returns:
MultiplexConnection The connection associated with the ipc channel.

close

protected java.util.Vector close(JmsServerSession session,
                                 org.exolab.core.mipc.MultiplexConnectionIfc connection)
A close session request has been received.
Parameters:
session - The session to close
Returns:
Vector The result of the request.

acknowledgeMessage

protected java.util.Vector acknowledgeMessage(JmsServerSession session,
                                              java.lang.Long clientId,
                                              java.lang.String id)
Acknowledge a JmsMessage
Parameters:
session - - the session the request is for
clientId - - the identity of the client that sent it
id - The id of the message
Returns:
Vector The result of the request.

sendMessage

protected java.util.Vector sendMessage(JmsServerSession session,
                                       javax.jms.Message message)
A JmsMessage has been sent.
Parameters:
session - The session the request is for.
message - The message to process.
Returns:
Vector The result of the request.

sendMessages

protected java.util.Vector sendMessages(JmsServerSession session,
                                        java.util.Vector messages)
A collection of messages have been sent
Parameters:
session - - the session the request is for.
messages - - the messages to process.
Returns:
Vector - the result of the request.

receiveMessage

protected java.util.Vector receiveMessage(JmsServerSession session,
                                          java.lang.Long clientId,
                                          java.lang.Long wait)
Receive a message from the provider
Parameters:
session - The session the request is for.
clientId - The client identity
wait - How long to wait
Returns:
Vector The result of the request.

receiveMessages

protected java.util.Vector receiveMessages(JmsServerSession session,
                                           java.lang.Long clientId,
                                           java.lang.Integer count)
Receive upto count messages from the endpoint
Parameters:
session - - the session the request is for.
clientId - - the client identity
count - - max number of messages to receive
Returns:
Vector - the result of the request.

createQueue

protected java.util.Vector createQueue(JmsServerSession session,
                                       JmsQueue queue)
Create a new Queue.
Parameters:
session - The session the request is for.
queue - The queue to create
Returns:
Vector The result of the request.

createTopic

protected java.util.Vector createTopic(JmsServerSession session,
                                       JmsTopic topic)
Create a new topic
Parameters:
session - The session the request is for.
topic - The topic to create
Returns:
Vector The result of the request.

createReceiver

protected java.util.Vector createReceiver(JmsServerSession session,
                                          JmsQueue queue,
                                          java.lang.Long consumerId,
                                          java.lang.String selector,
                                          org.exolab.core.mipc.MultiplexConnectionIfc connection,
                                          java.lang.String host,
                                          java.lang.String port,
                                          java.lang.String url)
Create a new receiver
Parameters:
session - The session the request is for.
queue - The queue to create the reciver for
consumerName - The unique name of this consumer, only valid for persitent messages
selector - The selector to filter messages. This may be null.
connection - The MultiplexConnection to the machine the consumer is on
host - The host the client is running on. Only used for http.
port - The port the client is listening on. Only used for http
url - The url for the clients web server. Only used for http
Returns:
Vector The result of the request.

createSender

protected java.util.Vector createSender(JmsServerSession session,
                                        JmsQueue queue)
Create a new sender for the given queue.
Parameters:
session - The session the request is for.
queue - The queue the sender is sending to
Returns:
Vector The result of the request.

createBrowser

protected java.util.Vector createBrowser(JmsServerSession session,
                                         JmsQueue queue,
                                         java.lang.Long clientId,
                                         java.lang.String selector,
                                         org.exolab.core.mipc.MultiplexConnectionIfc connection,
                                         java.lang.String host,
                                         java.lang.String port,
                                         java.lang.String url)
Create a new queue browser for the specified session and queue.
Parameters:
session - session that the request is for
queue - queue to browse
clientId - the client identity
selector - message selector. May be null
connection - the connection to the remote machine
host - The host the client is running on. Only used for http.
port - The port the client is listening on. Only used for http
url - The url for the clients web server. Only used for http
Returns:
Vector result of the request

deleteReceiver

protected java.util.Vector deleteReceiver(JmsServerSession session,
                                          java.lang.Long clientId)
Delete the receiver for this queue.
Parameters:
session - - the session the request is for.
clientId - - the client id
Returns:
Vector The result of the request.

deleteSender

protected java.util.Vector deleteSender(JmsServerSession session,
                                        java.lang.Long clientId)
Delete the sender for this queue.
Parameters:
session - The session the request is for.
clientId - The identity of the client
Returns:
Vector The result of the request.

deleteBrowser

protected java.util.Vector deleteBrowser(JmsServerSession session,
                                         java.lang.Long clientId)
Delete the queue browser for the specified queue.
Parameters:
session - session that the request is for
clientId - the identity of the browser
Returns:
Vector The result of the request.

createSubscriber

protected java.util.Vector createSubscriber(JmsServerSession session,
                                            JmsTopic topic,
                                            java.lang.String name,
                                            java.lang.Long clientId,
                                            java.lang.String selector,
                                            java.lang.Boolean noLocal,
                                            org.exolab.core.mipc.MultiplexConnectionIfc connection,
                                            java.lang.String host,
                                            java.lang.String port,
                                            java.lang.String url)
Create a new subscriber, and connect back to the client through the MultiplexConnection.
Parameters:
session - The session the request is for.
topic - The topic the subscriber is subscribing on
name - The unique name of this subscriber, only valid for persitent messages
selector - The selector to filter messages. This may be null.
connection - The MultiplexConnection to the machine the consumer is on
host - The host the client is running on. Only used for http.
port - The port the client is listening on. Only used for http
url - The url for the clients web server. Only used for http
Returns:
Vector The result of the request.

createPublisher

protected java.util.Vector createPublisher(JmsServerSession session,
                                           JmsTopic topic)
Create a new publisher for the given topic.
Parameters:
session - The session the request is for.
topic - The topic the publisher is publishing to
Returns:
Vector The result of the request.

deleteSubscriber

protected java.util.Vector deleteSubscriber(JmsServerSession session,
                                            java.lang.Long clientId)
Delete a subscriber for the given topic
Parameters:
session - The session the request is for.
clientId - - The client identity of the subscriber to delete
Returns:
Vector The result of the request.

deletePublisher

protected java.util.Vector deletePublisher(JmsServerSession session,
                                           JmsTopic topic)
Delete a publisher for the given topic.
Parameters:
session - The session the request is for.
topic - The topic the publisher is publishing to
Returns:
Vector The result of the request.

unsubscribe

public java.util.Vector unsubscribe(JmsServerSession session,
                                    java.lang.String name)
Unsubscribe a durable subscription
Parameters:
session - the session the request is for
name - the name used to identify the subscription
Returns:
Vector the result of the request.

stopMessageDelivery

protected java.util.Vector stopMessageDelivery(JmsServerSession session)
Stop message delivery for this session.
Parameters:
session - The session the request is for.
Returns:
Vector The result of the request.

enableAsynchronousDelivery

protected java.util.Vector enableAsynchronousDelivery(JmsServerSession session,
                                                      java.lang.Long clientId,
                                                      java.lang.String id,
                                                      java.lang.Boolean enable)
Enable or disable asynchronous message delivery.
Parameters:
session - - the session the request is for.
clientId - - consumer identity
enable - - true to enable
Returns:
Vector - the result of the request.

startMessageDelivery

protected java.util.Vector startMessageDelivery(JmsServerSession session)
Start message delivery for this session.
Parameters:
session - The session the request is for.
Returns:
Vector The result of the request.

recover

protected java.util.Vector recover(JmsServerSession session)
recover the session
Parameters:
session - The session the request is for.
Returns:
Vector The result of the request.

commit

protected java.util.Vector commit(JmsServerSession session)
commit the session
Parameters:
session - The session the request is for.
Returns:
Vector The result of the request.

rollback

protected java.util.Vector rollback(JmsServerSession session)
rollback the session
Parameters:
session - The session the request is for.
Returns:
Vector The result of the request.

XACommit

protected java.util.Vector XACommit(JmsServerSession session,
                                    javax.transaction.xa.Xid xid,
                                    java.lang.Boolean onePhase)
Commits an XA transaction that is in progress.
Parameters:
xid - - the xa transaction identity
onePhase - - treu if it is a one phase commit
Returns:
Vector

XAEnd

protected java.util.Vector XAEnd(JmsServerSession session,
                                 javax.transaction.xa.Xid xid,
                                 java.lang.Integer flags)
Ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource from the transaction branch specified and let the transaction be completedCommits an XA transaction that is in progress.
Parameters:
xid - - the xa transaction identity
flags - - one of TMSUCCESS, TMFAIL, or TMSUSPEND
Returns:
Vector

XAForget

protected java.util.Vector XAForget(JmsServerSession session,
                                    javax.transaction.xa.Xid xid)
Tell the resource manager to forget about a heuristically completed transaction branch.
Parameters:
xid - - the xa transaction identity
Returns:
Vector

XAGetTransactionTimeout

protected java.util.Vector XAGetTransactionTimeout(JmsServerSession session)
Return the transaction timeout for this instance of the resource manager.
Returns:
int - the timeout in seconds

XAPrepare

protected java.util.Vector XAPrepare(JmsServerSession session,
                                     javax.transaction.xa.Xid xid)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid
Parameters:
xid - - the xa transaction identity
Returns:
Vector

XARecover

public java.util.Vector XARecover(JmsServerSession session,
                                  java.lang.Integer flag)
Obtain a list of prepared transaction branches from a resource manager. The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or heuristically completed states.
Parameters:
flag - - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
Xid[] - - the set of Xids to recover
Returns:
Vector

XARollback

protected java.util.Vector XARollback(JmsServerSession session,
                                      javax.transaction.xa.Xid xid)
Inform the resource manager to roll back work done on behalf of a transaction branch
Parameters:
xid - - the xa transaction identity

XASetTransactionTimeout

protected java.util.Vector XASetTransactionTimeout(JmsServerSession session,
                                                   java.lang.Integer seconds)
Set the current transaction timeout value for this XAResource instance.
Parameters:
seconds - - timeout in seconds
Returns:
boolean - true if the new transaction timeout was accepted

XAStart

protected java.util.Vector XAStart(JmsServerSession session,
                                   javax.transaction.xa.Xid xid,
                                   java.lang.Integer flags)
Start work on behalf of a transaction branch specified in xid If TMJOIN is specified, the start is for joining a transaction previously seen by the resource manager
Parameters:
xid - - the xa transaction identity
flags - - One of TMNOFLAGS, TMJOIN, or TMRESUME
Returns:
Vector

XAGetResourceManagerId

protected java.util.Vector XAGetResourceManagerId(JmsServerSession session)
Return the identity of the resource manager.
Parameters:
session - - the session identity
Returns:
Vector

pack

protected java.util.Vector pack(java.lang.Boolean success,
                                java.lang.Object ob)
Pack all the data that is required by the server in a vector. Set the size of the vector to be exactly the right size for efficiency.
Parameters:
success - Boolean indicating success or failure of request.
ob - The Object being returned.
Returns:
Vector The vector containing all the data.


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.