|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--server.ServerComponentFactory
This class only has one responsibility and that is to generate the necessary components for the server and then pass them a CreatesConnection so that they can connect. It is made a singleton to ensure that duplicate sets of components are never unknowingly dispatched to connect (even though this may be checked for on server side as well). The server does not have any knowledge of how to create the components and thus must rely on this class to generate them in the manner that it was compiled to. Component class types are passed into the generate command, which in turn looks up the rule on how to create that type of component and then does so. The reason that rules must be defined is because components may in fact be located on other system, and creating them could require more than just calling "new ComponentType"
Server,
SimulatorComponentGenerator| Nested Class Summary | |
protected static interface |
ServerComponentFactory.ComponentCreator
This interface describes a rule on how to creates a component. |
| Field Summary | |
private HashMap |
creationRules
This map contains all known mapping between component types and how to create them. |
private int |
currentPort
|
private boolean |
generated
Whether the generateComponents method has already been called. |
static int |
MISSION_CONTROL_PORT
|
protected static long |
serialVersionUID
|
protected static server.ServerComponentFactory |
singleton
|
static int |
UAV_MANAGER_PORT
|
static int |
UCAV_MANAGER_PORT
|
| Constructor Summary | |
protected |
ServerComponentFactory()
|
| Method Summary | |
void |
generateComponents(connect.CreatesConnection serverConnection,
Class[] componentTypes)
This method should create all the components necessary specified by the server. |
protected HashMap |
generateRules()
This method should generate the map that connects class types for rules on how to create them. |
protected int |
getNextPort()
Returns the next available port. |
static server.ServerComponentFactory |
instance()
Returns the singleton instance of this factory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final long serialVersionUID
protected static server.ServerComponentFactory singleton
private boolean generated
private int currentPort
public static final int UAV_MANAGER_PORT
public static final int UCAV_MANAGER_PORT
public static final int MISSION_CONTROL_PORT
private final HashMap creationRules
| Constructor Detail |
protected ServerComponentFactory()
| Method Detail |
public static server.ServerComponentFactory instance()
public void generateComponents(connect.CreatesConnection serverConnection,
Class[] componentTypes)
protected int getNextPort()
protected HashMap generateRules()
|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||