|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgcs.GcsMessageListener
public abstract class GcsMessageListener
GcsMessageListener object allows blocking reception of messages through the listener message reception system. It is accomplished by calling getNewMessages()
method. It activates the listener and blocks until at least one message is available or stopListener()
is called. Upon new message arrival the listener is deactivated and message retrieved by the client.
Field Summary | |
---|---|
protected boolean |
active
|
protected ProfileEntity |
mySessionReference
|
protected java.util.List<GcsMessage> |
newMessages
|
protected boolean |
quitting
|
Constructor Summary | |
---|---|
protected |
GcsMessageListener(ProfileEntity mySessionReference)
Constructor. |
Method Summary | |
---|---|
protected abstract void |
activateListener()
Sets up the listener from the connection. |
protected abstract void |
deactivateListener()
Removes the listener from the connection. |
abstract java.util.List<GcsMessage> |
getNewMessages()
Used for retrieving new messages. |
abstract boolean |
isActive()
Used to check the state of the GcsMessageListener. |
abstract void |
stopListener()
Deactivates the listener and causes the getNewMessages() to
continue when it is blocked. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gcs.GcsAdvancedMessageListener |
---|
membershipMessageReceived, regularMessageReceived |
Field Detail |
---|
protected ProfileEntity mySessionReference
protected java.util.List<GcsMessage> newMessages
protected boolean quitting
protected boolean active
Constructor Detail |
---|
protected GcsMessageListener(ProfileEntity mySessionReference)
ProfileEntity
reference given by the argument is
used for retrieving the GcsConnection
necessary for the listener
to be set up or later removed.
mySessionReference
- Method Detail |
---|
protected abstract void activateListener() throws GcsException
GcsException
- if the listener can not be set upprotected abstract void deactivateListener() throws GcsException
GcsException
public abstract java.util.List<GcsMessage> getNewMessages() throws GcsException
stopListener()
is called.
GcsException
- if problem were encountered during reception of the messagespublic abstract void stopListener() throws GcsException
getNewMessages()
to
continue when it is blocked.
GcsException
- if listener could not be deactivatedpublic abstract boolean isActive()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |