public class JmsServerSession extends Object implements ServerSession, MessageListener, Work, WorkListener
Constructor and Description |
---|
JmsServerSession(JmsServerSessionPool pool)
Create a new JmsServerSession
|
Modifier and Type | Method and Description |
---|---|
Session |
getSession()
Return the
ServerSession 's Session . |
void |
onMessage(Message message)
Passes a message to the listener.
|
void |
release()
The
WorkManager might call this method to hint the
active Work instance to complete execution as soon as
possible. |
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 e)
Invoked when a
Work instance has been accepted. |
void |
workCompleted(WorkEvent e)
Invoked when a
Work instance has completed execution. |
void |
workRejected(WorkEvent e)
Invoked when a
Work instance has been rejected. |
void |
workStarted(WorkEvent e)
Invoked when a
Work instance has started execution. |
public JmsServerSession(JmsServerSessionPool pool)
pool
- the server session poolpublic void teardown()
public void onMessage(Message message)
MessageListener
onMessage
in interface MessageListener
message
- the message passed to the listenerpublic Session getSession() throws JMSException
ServerSession
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
.getSession
in interface ServerSession
JMSException
- if the JMS provider fails to get the associated
session for this ServerSession
due
to some internal error.public void start() throws JMSException
ServerSession
Session
's run
method to be called
to process messages that were just assigned to it.start
in interface ServerSession
JMSException
- if the JMS provider fails to start the server
session to process messages due to some internal
error.public void release()
Work
WorkManager
might call this method to hint the
active Work
instance to complete execution as soon as
possible. This would be called on a seperate thread other than the
one currently executing the Work
instance.public void workAccepted(WorkEvent e)
WorkListener
Work
instance has been accepted.workAccepted
in interface WorkListener
e
- A WorkEvent
object that provides more
information about the accepted Work.public void workCompleted(WorkEvent e)
WorkListener
Work
instance has completed execution.workCompleted
in interface WorkListener
e
- A WorkEvent
object that provides more
information about the accepted Work.public void workRejected(WorkEvent e)
WorkListener
Work
instance has been rejected.workRejected
in interface WorkListener
e
- A WorkEvent
object that provides more
information about the accepted Work.public void workStarted(WorkEvent e)
WorkListener
Work
instance has started execution.
This only means that a thread has been allocated.workStarted
in interface WorkListener
e
- A WorkEvent
object that provides more
information about the accepted Work.Copyright © 2018 JBoss by Red Hat. All rights reserved.