|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.server.model.TransactionSession
public abstract class TransactionSession
Root class for sessions.
| Field Summary | |
|---|---|
protected static java.util.Map<java.lang.String,TransactionSession> |
allSessions
A map of all active sessions. |
private boolean |
completed
Has this session been completed? |
private static java.util.logging.Logger |
logger
|
| Constructor Summary | |
|---|---|
protected |
TransactionSession(java.lang.String key)
Protected constructor, we only really instantiate specific types of transactions. |
| Method Summary | ||
|---|---|---|
static void |
clearAll()
Clear all transactions. |
|
void |
complete(ChangeSet cs)
All transaction types must implement a completion action. |
|
static void |
completeAll(ChangeSet cs)
Complete all transactions. |
|
static
|
lookup(java.lang.Class<T> type,
FreeColGameObject o1,
FreeColGameObject o2)
Look up a session of specified type given the game objects involved. |
|
static
|
lookup(java.lang.Class<T> type,
java.lang.String s1,
java.lang.String s2)
Look up a session of specified type given the ids of the game objects involved. |
|
protected static java.lang.String |
makeSessionKey(java.lang.Class type,
FreeColGameObject o1,
FreeColGameObject o2)
Make a transaction session key given two game objects. |
|
protected static java.lang.String |
makeSessionKey(java.lang.Class type,
java.lang.String o1,
java.lang.String o2)
Make a transaction session key. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
protected static final java.util.Map<java.lang.String,TransactionSession> allSessions
private boolean completed
| Constructor Detail |
|---|
protected TransactionSession(java.lang.String key)
key - A unique key to lookup this transaction with.| Method Detail |
|---|
public void complete(ChangeSet cs)
cs - A ChangeSet to update with changes that
occur when completing this session.
protected static java.lang.String makeSessionKey(java.lang.Class type,
java.lang.String o1,
java.lang.String o2)
type - An identifier for the type of transaction.o1 - A string to uniquely identify the transaction.o2 - Another string to uniquely identify the transaction.
protected static java.lang.String makeSessionKey(java.lang.Class type,
FreeColGameObject o1,
FreeColGameObject o2)
type - An identifier for the type of transaction.o1 - A FreeColGameObject involved in the session.o2 - Another FreeColGameObject involved in the session.
public static void completeAll(ChangeSet cs)
cs - A ChangeSet to update.public static void clearAll()
public static <T extends TransactionSession> T lookup(java.lang.Class<T> type,
FreeColGameObject o1,
FreeColGameObject o2)
type - The class of session.o1 - The first FreeColGameObject in the session.o2 - The second FreeColGameObject in the session.
public static <T extends TransactionSession> T lookup(java.lang.Class<T> type,
java.lang.String s1,
java.lang.String s2)
type - The class of session.s1 - The id of the first object in the session.s2 - The id of the second object in the session.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||