|
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 | +--connect.socket.SocketComponentTemplate
| Field Summary | |
private connect.CreatesConnection |
connection
|
private boolean |
debug
|
private static boolean |
DEBUG
|
private int |
numOfPoints
The number of RelayPoint objects constructed for this Component |
protected int |
portNumber
The port number for this socket based component. |
private connect.ComponentEmissary |
representative
|
private static long |
serialVersionUID
|
private ServerSocket |
ss
|
| Constructor Summary | |
SocketComponentTemplate(int portNumber)
|
|
| Method Summary | |
protected abstract boolean |
accept(Class requestingType)
Returns whether this component will accept a connection from the the requesting object of the speicifed type. |
protected abstract boolean |
allowMethod(util.MethodRequest request)
Returns true if this component allows the MethodRequest to be invoked upon itself. |
void |
connect(connect.CreatesConnection cc)
Connects to the component specified by the CreatesConnection. |
private void |
debug(String s)
If in debug mode, print the string. |
protected connect.ComponentEmissary |
getComponentEmissary()
Returns the ComponentEmissary that represents this object. |
connect.CreatesConnection |
getConnection()
Returns the CreatesConnection that opaquely connects to this component. |
protected int |
getMaxPoints()
Returns the maximum number of RelayPoint objects for
this component. |
protected abstract void |
processAcceptedConnection(Class hostType,
connect.ChannelBundle acceptedConnection)
When a component connects to the component that it requested the connection to, this method is called. |
protected void |
processRelayPoint(connect.ChannelBundle bundle)
Continuously reads in objects from the RelayPoint. |
protected abstract void |
processRequestingConnection(connect.ComponentEmissary requesting,
connect.ChannelBundle incomingConnection)
All implementers should extends this method to define their behavior when another component connects. |
void |
spawnRelayPoint(int relayPort)
Generated a RelayPoint that is connected to this
component. |
private void |
startAcceptingThread()
Continuously accept incoming connections and then pass off the ChannelBundle to the implementing class for
behavior based processing. |
private void |
startProcessingThread(connect.ComponentEmissary ce,
connect.ChannelBundle bundle)
|
private void |
startRelayThread(connect.ChannelBundle bundle)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final int portNumber
private static final long serialVersionUID
private static final boolean DEBUG
private connect.CreatesConnection connection
private ServerSocket ss
private final connect.ComponentEmissary representative
private final boolean debug
private int numOfPoints
| Constructor Detail |
public SocketComponentTemplate(int portNumber)
| Method Detail |
protected abstract boolean accept(Class requestingType)
protected abstract boolean allowMethod(util.MethodRequest request)
public void connect(connect.CreatesConnection cc)
connect in interface ComponentCreatesConnection.connect(connect.ComponentEmissary)private void debug(String s)
protected abstract void processAcceptedConnection(Class hostType,
connect.ChannelBundle acceptedConnection)
protected void processRelayPoint(connect.ChannelBundle bundle)
RelayPoint.
MethodRequest objects are expected, and are invoked by
first checking if the allowMethod(MethodRequest) returns
true. A break in the connection to the RelayPoint
does not cause the failure of the Thread responsible
for this component. Extending subclasses should override this
method for additional functionality from the
RelayPoint.
protected abstract void processRequestingConnection(connect.ComponentEmissary requesting,
connect.ChannelBundle incomingConnection)
private void startAcceptingThread()
ChannelBundle to the implementing class for
behavior based processing.
private void startProcessingThread(connect.ComponentEmissary ce,
connect.ChannelBundle bundle)
private void startRelayThread(connect.ChannelBundle bundle)
protected connect.ComponentEmissary getComponentEmissary()
public connect.CreatesConnection getConnection()
getConnection in interface Componentprotected int getMaxPoints()
RelayPoint objects for
this component. By default this returns 0.
Subclassese should override this method to increase the amount
of default RelayPoint objects possible.
spawnRelayPoint(int)public void spawnRelayPoint(int relayPort)
RelayPoint that is connected to this
component. The implementation is designed to create only one
RelayPoint and it is of type SocketRelayComponent. Subclassese may wish to override this
method to change the type of relay point or the number
created.
relayPort - the port on which the construct RelayPoint will listen for requests.
|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||