|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jivesoftware.smackx.jingle.JingleSessionState
public abstract class JingleSessionState
Implement the Jingle Session state using the State Behavioral pattern. (From the book Design Patterns, AKA GoF.) These classes also employ the Flyweight and Singleton patterns as recommended for the State pattern by GoF. There seems to be three ways to go with the State pattern in Java: interface, abstract class and enums. Most of the accepted models use abstract classes. It wasn't clear to me that any of the three models was superior, so I went with the most common example.
| Constructor Summary | |
|---|---|
JingleSessionState()
|
|
| Method Summary | |
|---|---|
abstract void |
enter()
Called when entering the state. |
abstract void |
exit()
Called when exiting the state. |
static JingleSessionState |
getInstance()
Called when entering the state. |
abstract IQ |
processJingle(JingleSession session,
Jingle jingle,
JingleActionEnum action)
Process an incoming Jingle Packet. |
java.lang.String |
toString()
For debugging just emit the short name of the class. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JingleSessionState()
| Method Detail |
|---|
public static JingleSessionState getInstance()
public abstract void enter()
public abstract void exit()
public abstract IQ processJingle(JingleSession session,
Jingle jingle,
JingleActionEnum action)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||