|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.samples.activitysessionEJB.MasterMindGameBean
public class MasterMindGameBean
This is the MasterMindBean Class, part of the ActivitySessions Samples. It is a Stateful Session Bean. The bean will be deployed with an activation policy of ActivitySession. It contains private instance data which is transient.
Field Summary | |
---|---|
static int |
MAX_GUESSES
|
static int |
NUMBER_OF_COLORS
|
static int |
NUMBER_OF_ELEMENTS
|
Constructor Summary | |
---|---|
MasterMindGameBean()
|
Method Summary | |
---|---|
boolean |
calculate(int[] guess)
Calculates the results of the latest guess. |
void |
ejbActivate()
This required callback method is user for lifecycle notification. |
void |
ejbCreate()
This required callback method is user for lifecycle notification. |
void |
ejbPassivate()
This required callback method is user for lifecycle notification. |
void |
ejbRemove()
This required callback method is user for lifecycle notification. |
int[][] |
getGuessArray()
Public accessor for the array of guesses |
int |
getGuessNumber()
Public accessor for the number of guesses made. |
int[][] |
getResultsArray()
Public accessor for the array of results. |
int[] |
getTarget()
Public accessor for the target code. |
void |
newGame()
This method resets the instance variables of the bean to default values and generates a new target code to be guessed. |
void |
setSessionContext(javax.ejb.SessionContext ctx)
This required callback method sets the session context attribute for this SessionBean |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NUMBER_OF_ELEMENTS
public static final int NUMBER_OF_COLORS
public static final int MAX_GUESSES
Constructor Detail |
---|
public MasterMindGameBean()
Method Detail |
---|
public boolean calculate(int[] guess)
guess
- char [] Represents the most recent guess
public int[][] getGuessArray()
public int getGuessNumber()
public int[][] getResultsArray()
public int[] getTarget()
public void newGame()
public void ejbActivate()
ejbActivate
in interface javax.ejb.SessionBean
public void ejbCreate()
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.SessionBean
public void ejbRemove()
ejbRemove
in interface javax.ejb.SessionBean
public void setSessionContext(javax.ejb.SessionContext ctx)
setSessionContext
in interface javax.ejb.SessionBean
ctx
- javax.ejb.SessionContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |