FileDocCategorySizeDatePackage
AOMEntry.javaAPI DocJava SE 5 API7352Fri Aug 26 14:54:26 BST 2005com.sun.corba.se.impl.oa.poa

AOMEntry

public class AOMEntry extends com.sun.corba.se.spi.orbutil.fsm.FSMImpl
AOMEntry represents a Servant or potential Servant in the ActiveObjectMap. It may be in several states to allow for long incarnate or etherealize operations. The methods on this class mostly represent input symbols to the state machine that controls the lifecycle of the entry. A library is used to build the state machine rather than the more usual state pattern so that the state machine transitions are explicitly visible.

Fields Summary
private final Thread[]
etherealizer
private final int[]
counter
private final com.sun.corba.se.impl.orbutil.concurrent.CondVar
wait
final POAImpl
poa
public static final com.sun.corba.se.spi.orbutil.fsm.State
INVALID
public static final com.sun.corba.se.spi.orbutil.fsm.State
INCARN
public static final com.sun.corba.se.spi.orbutil.fsm.State
VALID
public static final com.sun.corba.se.spi.orbutil.fsm.State
ETHP
public static final com.sun.corba.se.spi.orbutil.fsm.State
ETH
public static final com.sun.corba.se.spi.orbutil.fsm.State
DESTROYED
static final com.sun.corba.se.spi.orbutil.fsm.Input
START_ETH
static final com.sun.corba.se.spi.orbutil.fsm.Input
ETH_DONE
static final com.sun.corba.se.spi.orbutil.fsm.Input
INC_DONE
static final com.sun.corba.se.spi.orbutil.fsm.Input
INC_FAIL
static final com.sun.corba.se.spi.orbutil.fsm.Input
ACTIVATE
static final com.sun.corba.se.spi.orbutil.fsm.Input
ENTER
static final com.sun.corba.se.spi.orbutil.fsm.Input
EXIT
private static com.sun.corba.se.spi.orbutil.fsm.Action
incrementAction
private static com.sun.corba.se.spi.orbutil.fsm.Action
decrementAction
private static com.sun.corba.se.spi.orbutil.fsm.Action
throwIllegalStateExceptionAction
private static com.sun.corba.se.spi.orbutil.fsm.Guard
waitGuard
private static com.sun.corba.se.spi.orbutil.fsm.GuardBase
greaterZeroGuard
private static com.sun.corba.se.spi.orbutil.fsm.Guard
zeroGuard
private static com.sun.corba.se.spi.orbutil.fsm.GuardBase
greaterOneGuard
private static com.sun.corba.se.spi.orbutil.fsm.Guard
oneGuard
private static com.sun.corba.se.spi.orbutil.fsm.StateEngine
engine
Constructors Summary
public AOMEntry(POAImpl poa)


     
	engine = StateEngineFactory.create() ;

	//	    State,   Input,     Guard,			Action,		    new State

	engine.add( INVALID, ENTER,				incrementAction,    INCARN	) ;
	engine.add( INVALID, ACTIVATE,				null,		    VALID	) ;
	engine.setDefault( INVALID ) ;

	engine.add( INCARN,  ENTER,	waitGuard,		null,		    INCARN	) ;
	engine.add( INCARN,  EXIT,				null,		    INCARN	) ;
	engine.add( INCARN,  START_ETH,	waitGuard,		null,		    INCARN	) ;
	engine.add( INCARN,  INC_DONE,				null,		    VALID	) ;
	engine.add( INCARN,  INC_FAIL,				decrementAction,    INVALID	) ;  

	engine.add( VALID,   ENTER,				incrementAction,    VALID	) ;
	engine.add( VALID,   EXIT,				decrementAction,    VALID	) ;
	engine.add( VALID,   START_ETH, greaterZeroGuard,	null,		    ETHP	) ;
	engine.add( VALID,   START_ETH, zeroGuard,		null,		    ETH		) ;

	engine.add( ETHP,    ENTER,	waitGuard,		null,		    ETHP	) ;
	engine.add( ETHP,    START_ETH,				null,		    ETHP	) ;
	engine.add( ETHP,    EXIT,	greaterOneGuard,	decrementAction,    ETHP	) ;
	engine.add( ETHP,    EXIT,	oneGuard,		decrementAction,    ETH		) ;

	engine.add( ETH,     START_ETH,				null,		    ETH		) ;
	engine.add( ETH,     ETH_DONE,				null,		    DESTROYED	) ;
	engine.add( ETH,     ENTER,	waitGuard,		null,		    ETH		) ;
	
	engine.setDefault( DESTROYED, throwIllegalStateExceptionAction, DESTROYED ) ;

	engine.done() ;
    
	super( engine, INVALID, ((ORB)poa.getORB()).poaFSMDebugFlag ) ;
	this.poa = poa ;
	etherealizer = new Thread[1] ;
	etherealizer[0] = null ;
	counter = new int[1] ;
	counter[0] = 0 ;
	wait = new CondVar( poa.poaMutex, 
	    ((ORB)poa.getORB()).poaConcurrencyDebugFlag ) ;
    
Methods Summary
public voidactivateObject()

 doIt( ACTIVATE ) ; 
public voidenter()

 doIt( ENTER ) ; 
public voidetherealizeComplete()

 doIt( ETH_DONE ) ; 
public voidexit()

 doIt( EXIT ) ; 
public voidincarnateComplete()

 doIt( INC_DONE ) ; 
public voidincarnateFailure()

 doIt( INC_FAIL ) ; 
public voidstartEtherealize(java.lang.Thread etherealizer)

 
	this.etherealizer[0] = etherealizer ;
	doIt( START_ETH ) ;