|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.monica.javacom.protocol.MJCLoopBackProtocol
Class for implementing a basic loopback at the server side. This class acts as a top level layer int the MJC hierarchy on the server side. Accepted connections will be forwarded to the destination host.
Constructor Summary | |
MJCLoopBackProtocol(int workPort,
java.lang.String forwardToHost,
int forwardToPort,
int adminPort)
Default constructor. |
Method Summary | |
void |
connectionClosedEvent(MJCReadable readable)
Indicates that the source connection of the specified MJCReadable has been closed. |
void |
errorEvent(java.lang.String errorDescription,
MJCReadable readable)
Indicates that there was an error in the source connection of the specified MJCReadable. |
MJCConfiguration |
getConfiguration()
Returns the MJCConfiguration with which this object is customized. |
MJCReadable |
getReadable()
Returns the MJCReadable from which data will be read. |
java.lang.String |
getReaderName()
Returns the MJC name of the MJCReader. |
java.lang.String |
getReaderVersion()
Returns the MJC version of the MJCReader. |
java.lang.String |
getServerManagerName()
Returns the MJC name of the MJCServerManager. |
java.lang.String |
getServerManagerVersion()
Returns the MJC version of the MJCServerManager. |
void |
newClientHasArrivedEvent(MJCTransport server,
MJCTransport client)
This method will be invoked from the MJCTransport when a new client arrives. |
void |
readEvent(MJCReadable readable)
Indicates that there is data available from the specified MJCReadable. |
void |
run()
Entry point for the thread for each client. |
void |
setConfiguration(MJCConfiguration configuration)
Sets the MJCConfiguration for this object. |
void |
setConfigurationInput(java.lang.String is)
Sets the customization file that will be sent through the network for clients to allow them basic configuration via the server. |
void |
setReadable(MJCReadable readable)
Sets the MJCReadable from which data has to be read. |
void |
start()
This method starts the application. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MJCLoopBackProtocol(int workPort, java.lang.String forwardToHost, int forwardToPort, int adminPort)
int
- workPort: the port number where the clients connectString
- forwardToHost: the host to forward toint
- forwardToPort: the port to forward toint
- adminPort: the administration portMethod Detail |
public void setConfigurationInput(java.lang.String is)
String
- is: the location of the customization filepublic void start()
start
in interface MJCServerManager
public void run()
run
in interface java.lang.Runnable
public void setConfiguration(MJCConfiguration configuration)
MJCConfiguration
- configuration: the MJCConfiguration
object for the customizationpublic MJCConfiguration getConfiguration()
public java.lang.String getServerManagerName()
getServerManagerName
in interface MJCServerManager
public java.lang.String getServerManagerVersion()
getServerManagerVersion
in interface MJCServerManager
public void newClientHasArrivedEvent(MJCTransport server, MJCTransport client)
newClientHasArrivedEvent
in interface MJCServerManager
MJCTransport
- server: the server that has accepted the clientMJCTrabsport
- client: the accepted clientpublic java.lang.String getReaderName()
getReaderName
in interface MJCReader
public java.lang.String getReaderVersion()
getReaderVersion
in interface MJCReader
public void readEvent(MJCReadable readable)
readEvent
in interface MJCReader
MJCReadable
- readable: there is data available from the
readablepublic void connectionClosedEvent(MJCReadable readable)
connectionClosedEvent
in interface MJCReader
MJCReadable
- readable: the MJCReadable whose source connection
has been closedpublic void errorEvent(java.lang.String errorDescription, MJCReadable readable)
errorEvent
in interface MJCReader
String
- errorDescription: the error messageMJCReadable
- readable: the MJCReadable where the error
occuredpublic void setReadable(MJCReadable readable)
setReadable
in interface MJCReader
MJCReadable
- readable: the MJCReadable from which data has
to be readpublic MJCReadable getReadable()
getReadable
in interface MJCReader
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |