org.jboss.resource.adapter.jms.inflow
Class JmsServerSession

java.lang.Object
  extended byorg.jboss.resource.adapter.jms.inflow.JmsServerSession
All Implemented Interfaces:
java.util.EventListener, MessageListener (src) , java.lang.Runnable, ServerSession (src) , Work (src) , WorkListener (src)

public class JmsServerSession
extends java.lang.Object
implements ServerSession (src) , MessageListener (src) , Work (src) , WorkListener (src)

A generic jms session pool.


Constructor Summary
JmsServerSession(JmsServerSessionPool (src)  pool)
          Create a new JmsServerSession
 
Method Summary
 Session (src) getSession()
          Return the ServerSession's Session.
 void onMessage(Message (src)  message)
          Passes a message to the listener.
 void release()
          Invoked by the work manager as a hint to stop processing
 void run()
           
 void setup()
          Setup the session
 void start()
          Cause the Session's run method to be called to process messages that were just assigned to it.
 void teardown()
          Stop the session
 void workAccepted(WorkEvent (src)  e)
          Invoked when work is accepted
 void workCompleted(WorkEvent (src)  e)
          Invoked when work is completed
 void workRejected(WorkEvent (src)  e)
          Invoked when work is rejected
 void workStarted(WorkEvent (src)  e)
          Invoked when work is started
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsServerSession

public JmsServerSession(JmsServerSessionPool (src)  pool)
Create a new JmsServerSession

Parameters:
pool - the server session pool
Method Detail

setup

public void setup()
           throws java.lang.Exception
Setup the session

Throws:
java.lang.Exception

teardown

public void teardown()
Stop the session


onMessage

public void onMessage(Message (src)  message)
Description copied from interface: MessageListener (src)
Passes a message to the listener.

Specified by:
onMessage in interface MessageListener (src)
Parameters:
message - the message passed to the listener

getSession

public Session (src)  getSession()
                   throws JMSException (src) 
Description copied from interface: ServerSession (src)
Return the ServerSession's Session. This must be a Session created by the same Connection that will be dispatching messages to it. The provider will assign one or more messages to the Session and then call start on the ServerSession.

Specified by:
getSession in interface ServerSession (src)
Returns:
the server session's session
Throws:
JMSException (src) - if the JMS provider fails to get the associated session for this ServerSession due to some internal error.

start

public void start()
           throws JMSException (src) 
Description copied from interface: ServerSession (src)
Cause the Session's run method to be called to process messages that were just assigned to it.

Specified by:
start in interface ServerSession (src)
Throws:
JMSException (src) - if the JMS provider fails to start the server session to process messages due to some internal error.

run

public void run()
Specified by:
run in interface java.lang.Runnable

release

public void release()
Description copied from interface: Work (src)
Invoked by the work manager as a hint to stop processing

Specified by:
release in interface Work (src)

workAccepted

public void workAccepted(WorkEvent (src)  e)
Description copied from interface: WorkListener (src)
Invoked when work is accepted

Specified by:
workAccepted in interface WorkListener (src)
Parameters:
e - the event

workCompleted

public void workCompleted(WorkEvent (src)  e)
Description copied from interface: WorkListener (src)
Invoked when work is completed

Specified by:
workCompleted in interface WorkListener (src)
Parameters:
e - the event

workRejected

public void workRejected(WorkEvent (src)  e)
Description copied from interface: WorkListener (src)
Invoked when work is rejected

Specified by:
workRejected in interface WorkListener (src)
Parameters:
e - the event

workStarted

public void workStarted(WorkEvent (src)  e)
Description copied from interface: WorkListener (src)
Invoked when work is started

Specified by:
workStarted in interface WorkListener (src)
Parameters:
e - the event