Package net.sf.freecol.server.model
Class TimedSession
- java.lang.Object
-
- net.sf.freecol.server.model.Session
-
- net.sf.freecol.server.model.TimedSession
-
- Direct Known Subclasses:
DiplomacySession
,NativeDemandSession
public abstract class TimedSession extends Session
Root class for timed sessions.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TimedSession(java.lang.String key, long timeout)
Protected constructor, we only really instantiate specific types of transactions.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
cancel()
Cancel the timer task.protected abstract boolean
complete(boolean result)
Complete this task with the given result.boolean
complete(ChangeSet cs)
All transaction types must implement a completion action.-
Methods inherited from class net.sf.freecol.server.model.Session
clearAll, completeAll, findSession, getKey, lookup, lookup, lookup, makeSessionKey, makeSessionKey, register
-
-
-
-
Method Detail
-
complete
protected abstract boolean complete(boolean result)
Complete this task with the given result. By default this will be called (with value == false) when the timer expires.- Parameters:
result
- The result to complete the session with.- Returns:
- The result of the session.
-
cancel
protected void cancel()
Cancel the timer task.
-
complete
public boolean complete(ChangeSet cs)
All transaction types must implement a completion action. This is called by the controller at the end of turn to complete any sessions that have not yet completed, or if the controller gets the required response to complete the session.
-
-