|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.client.BasicDirector
public class BasicDirector
Handles functionality common to nearly all client directors. They generally need to be session
observers so that they can set themselves up when the client logs on (by overriding clientDidLogon(com.threerings.presents.client.Client)) and clean up after themselves when the client logs off (by overriding clientDidLogoff(com.threerings.presents.client.Client)).
| Field Summary | |
|---|---|
protected boolean |
_availableInStandalone
Whether or not this director is available in standalone mode. |
protected PresentsContext |
_ctx
The application context. |
| Constructor Summary | |
|---|---|
protected |
BasicDirector(PresentsContext ctx)
Derived directors will need to provide the basic director with a context that it can use to register itself with the necessary entities. |
| Method Summary | |
|---|---|
protected void |
assertAvailable()
If this director is not currently available, throws a RuntimeException. |
void |
clientDidLogoff(Client client)
Called after the client has been logged off of the server and has disconnected. |
void |
clientDidLogon(Client client)
Called after the client successfully connected to and authenticated with the server. |
void |
clientObjectDidChange(Client client)
For systems that allow switching screen names after logon, this method is called whenever a screen name change takes place to report that the client object has been replaced to potential client-side subscribers. |
protected void |
clientObjectUpdated(Client client)
Called in three circumstances: when a director is created and we've already logged on; when we first log on and when the client object changes after we've already logged on. |
void |
clientWillLogon(Client client)
Called immediately before a logon is attempted. |
protected void |
fetchServices(Client client)
Derived directors can override this method and obtain any services they'll need during their operation via calls to Client.getService(java.lang.Class. |
protected boolean |
isAvailable()
Checks whether this director is available in the current mode. |
boolean |
isAvailableInStandalone()
Checks whether or not this director is available in standalone mode (defaults to false). |
protected void |
registerServices(Client client)
If a director makes use of bootstrap invocation services which are part of a bootstrap service group, it should register interest in that group here with a call to Client.addServiceGroup(java.lang.String). |
void |
setAvailableInStandalone(boolean available)
Sets whether or not this director is available in standalone mode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PresentsContext _ctx
protected boolean _availableInStandalone
| Constructor Detail |
|---|
protected BasicDirector(PresentsContext ctx)
| Method Detail |
|---|
public void clientWillLogon(Client client)
SessionObserver
clientWillLogon in interface SessionObserverpublic void clientDidLogon(Client client)
SessionObserver
clientDidLogon in interface SessionObserverpublic void clientObjectDidChange(Client client)
SessionObserver
clientObjectDidChange in interface SessionObserverpublic void clientDidLogoff(Client client)
SessionObserver
clientDidLogoff in interface SessionObserverpublic void setAvailableInStandalone(boolean available)
public boolean isAvailableInStandalone()
protected boolean isAvailable()
protected void assertAvailable()
RuntimeException.
protected void clientObjectUpdated(Client client)
protected void registerServices(Client client)
Client.addServiceGroup(java.lang.String).
protected void fetchServices(Client client)
Client.getService(java.lang.Class) . If the director is available, it will
automatically be called when the client logs on or when the director is constructed if it is
constructed after the client is already logged on.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||