|
JMS Conector demo (OC4J 10g R3) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectDealer
| Field Summary | |
(package private) MyChannel |
chan
|
(package private) static int |
count
|
(package private) static int |
current_player
|
(package private) static boolean |
game_started
|
private MessageDrivenContext |
m_ctx
|
(package private) static int |
NUM_PARTICIPANTS
|
(package private) static int |
NUM_PLAYERS
|
(package private) static java.lang.String[] |
player
|
(package private) static java.util.Random |
rand
|
(package private) static int[] |
score
|
| Constructor Summary | |
Dealer()
|
|
| Method Summary | |
private boolean |
dealerIsAhead()
Indicates if the dealer is winning. |
void |
ejbCreate()
Called when the server wants to create a new instance of this MDB. |
void |
ejbRemove()
Called when the server no longer wants to keep this MDB instance. |
private void |
notifyPlayer(GameEvent event)
Let the players know whose turn it is. |
void |
onMessage(Message msg)
This method is called whenever a message is sent to the queue associated with this MDB. |
private void |
processJoinRequest(GameEvent event)
Process PLAYER_JOIN_REQUEST events. |
private void |
processTurn(GameEvent event)
Process PLAYER_REDRAWS and PLAYER_PASSES events. |
private int |
randomValue()
Return a random value between 1 and 100. |
private void |
sendValue(GameEvent event)
Let all players know the current score of some player. |
void |
setMessageDrivenContext(MessageDrivenContext ctx)
Remember the context for this MDB. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private MessageDrivenContext m_ctx
MyChannel chan
static boolean game_started
static final int NUM_PLAYERS
static final int NUM_PARTICIPANTS
static int count
static java.lang.String[] player
static int[] score
static int current_player
static java.util.Random rand
| Constructor Detail |
public Dealer()
| Method Detail |
public void setMessageDrivenContext(MessageDrivenContext ctx)
ctx - the context for this MDBpublic void ejbCreate()
public void ejbRemove()
ejbCreate.
private int randomValue()
private void sendValue(GameEvent event)
throws java.lang.Exception
event - an event object for this method to use - its
contents on method invocation are unimportant and on method
return are undefined
java.lang.Exception
private void notifyPlayer(GameEvent event)
throws java.lang.Exception
event - an event object for this method to use - its
contents on method invocation are unimportant and on method
return are undefined
java.lang.Exception
private void processJoinRequest(GameEvent event)
throws java.lang.Exception
event - the PLAYER_JOIN_REQUEST event
java.lang.Exceptionprivate boolean dealerIsAhead()
private void processTurn(GameEvent event)
throws java.lang.Exception
event - the PLAYER_REDRAWS or PLAYER_PASSES event
java.lang.Exceptionpublic void onMessage(Message msg)
DestinationName property in the orion-ejb-jar.xml file.)
msg - assumed to be a javax.jms.ObjectMessage containting a GameEvent object
|
JMS Conector demo (OC4J 10g R3) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||