org.jppf.server.nio
Class NioServerFactory<S extends Enum<S>,T extends Enum<T>>

java.lang.Object
  extended by org.jppf.server.nio.NioServerFactory<S,T>
Type Parameters:
S - the type safe enumeration of the states.
T - the type safe enumeration of the state transitions.
Direct Known Subclasses:
MultiplexerServerFactory, MultiplexerServerFactory

public abstract class NioServerFactory<S extends Enum<S>,T extends Enum<T>>
extends Object

Instances of this class provide a mapping of enumerated values for states and transitions to the actual corresponding objects.

Author:
Laurent Cohen

Field Summary
static int R
          A short name for read channel operations.
static int RW
          A short name for read and write channel operations.
protected  NioServer<S,T> server
          The server for which this factory is intended.
protected  Map<S,NioState<T>> stateMap
          Map of all states for a class server.
protected  Map<T,NioTransition<S>> transitionMap
          Map of all states for a class server.
static int W
          A short name for wirte channel operations.
 
Constructor Summary
protected NioServerFactory(NioServer<S,T> server)
          Initialize this factory with the specified server.
 
Method Summary
abstract  Map<S,NioState<T>> createStateMap()
          Create the map of all possible states.
abstract  Map<T,NioTransition<S>> createTransitionMap()
          Create the map of all possible states.
 NioServer<S,T> getServer()
          Get the server for which this factory is intended.
 NioState<T> getState(S name)
          Get a state given its name.
 NioTransition<S> getTransition(T name)
          Get a transition given its name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RW

public static final int RW
A short name for read and write channel operations.

See Also:
Constant Field Values

R

public static final int R
A short name for read channel operations.

See Also:
Constant Field Values

W

public static final int W
A short name for wirte channel operations.

See Also:
Constant Field Values

stateMap

protected Map<S extends Enum<S>,NioState<T extends Enum<T>>> stateMap
Map of all states for a class server.


transitionMap

protected Map<T extends Enum<T>,NioTransition<S extends Enum<S>>> transitionMap
Map of all states for a class server.


server

protected NioServer<S extends Enum<S>,T extends Enum<T>> server
The server for which this factory is intended.

Constructor Detail

NioServerFactory

protected NioServerFactory(NioServer<S,T> server)
Initialize this factory with the specified server.

Parameters:
server - the server for which to initialize.
Method Detail

createStateMap

public abstract Map<S,NioState<T>> createStateMap()
Create the map of all possible states.

Returns:
a mapping of the states enumeration to the corresponding NioStateInstances.

createTransitionMap

public abstract Map<T,NioTransition<S>> createTransitionMap()
Create the map of all possible states.

Returns:
a mapping of the states enumeration to the corresponding NioStateInstances.

getState

public NioState<T> getState(S name)
Get a state given its name.

Parameters:
name - the name of the state to lookup.
Returns:
an NioState instance.

getTransition

public NioTransition<S> getTransition(T name)
Get a transition given its name.

Parameters:
name - the name of the transition to lookup.
Returns:
an NioTransition instance.

getServer

public NioServer<S,T> getServer()
Get the server for which this factory is intended.

Returns:
an NioServer instance.


Copyright © 2005-2010 JPPF Team.