|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AppListener
Listener for application-level events. This listener is called when the application is started for the first time, and when client sessions log in.
An implementation of a AppListener
should implement
the Serializable
interface, so that application listeners
can be stored persistently. When an application is started for the
the first time, its initialize
method is called and it is then persisted. If a given listener has mutable
state that can be changed after this point, it should also implement
the ManagedObject
interface. An implementation must be public and non-abstract, and
have a public, no-argument constructor.
The methods of this listener are called within the context of a
Task
being executed by the TaskManager
. If, during
such an execution, a task invokes one of this listener's methods
and that method throws an exception, that exception implements
ExceptionRetryStatus
, and its shouldRetry
method returns
true
, then the TaskManager
will make
further attempts to retry the task that invoked the listener's
method. It will continue those attempts until either an attempt
succeeds or it notices an exception is thrown that is not
retryable.
For a full description of task execution behavior, see the
documentation for TaskManager.scheduleTask(Task)
.
Method Summary | |
---|---|
void |
initialize(Properties props)
Notifies this listener that the application has been started for the first time. |
ClientSessionListener |
loggedIn(ClientSession session)
Notifies this listener that the specified client session has logged in, and returns a ClientSessionListener for that
session. |
Method Detail |
---|
void initialize(Properties props)
props
- application-specific configuration propertiesClientSessionListener loggedIn(ClientSession session)
ClientSessionListener
for that
session. The returned listener should implement Serializable
so that it can be stored persistently. If the
returned listener does not implement Serializable
,
then the client session is disconnected without completing the
login process.
The returned ClientSessionListener
is notified as
follows:
receivedMessage
method
is invoked with the message.
disconnected
method is
invoked with a boolean
that is true
if the client logged out gracefully, and is false
otherwise.
The session
passed to this method is persisted in
the data manager. The application may remove the session
from the data manager in order to disconnect the
session. If the application does not remove the specified
client session, the client session is removed when the disconnected
method invoked
on the returned listener completes.
A return value of null
has special meaning,
indicating that the specified client session should not
complete the login process and should be disconnected
immediately.
session
- a client session
null
to indicate that the session should
be terminated without completing the login process.
|
Project Darkstar, Version 0.9.9.6 2009-05-08 15:39:40 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |