Package jade.imtp.leap.JICP
Class FrontEndDispatcher
- java.lang.Object
-
- jade.imtp.leap.JICP.FrontEndDispatcher
-
- All Implemented Interfaces:
FEConnectionManager,TimerListener,Dispatcher,Runnable
- Direct Known Subclasses:
FrontEndSDispatcher
public class FrontEndDispatcher extends Object implements FEConnectionManager, Dispatcher, TimerListener, Runnable
Single full-duplex connection based Front End side dispatcher class- Author:
- Giovanni Caire - TILAB
-
-
Field Summary
Fields Modifier and Type Field Description protected StringbindHostprotected intbindPortprotected longconnectionTimeoutprotected StringmyMediatorClassbooleanrefreshingConnection
-
Constructor Summary
Constructors Constructor Description FrontEndDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]dispatch(byte[] payload, boolean flush, int oldSessionId)Deliver a serialized command to the BackEnd.voiddoTimeOut(Timer t)Mutual exclusion with updateKeepAlive(), updateConnectionDropDown() and clearTimers()BackEndgetBackEnd(FrontEnd fe, Properties props)Connect to a remote BackEnd and return a stub to communicate with itprotected JICPConnectiongetConnection(TransportAddress ta)subclasses may overwrite this to provide their version of a JICPConnectionprotected voidhandleReconnection(Connection c)protected JICPPacketprepareDropDownRequest()voidrun()voidshutdown()Make this FrontEndDispatcher terminate.protected voidundrop()
-
-
-
Method Detail
-
getBackEnd
public BackEnd getBackEnd(FrontEnd fe, Properties props) throws IMTPException
Connect to a remote BackEnd and return a stub to communicate with it- Specified by:
getBackEndin interfaceFEConnectionManager- Parameters:
fe- The FrontEnd container that is requesting the connection setup.props- Additional (implementation dependent) connection configuration properties.- Returns:
- A stub of the remote BackEnd.
- Throws:
IMTPException
-
shutdown
public void shutdown()
Make this FrontEndDispatcher terminate.- Specified by:
shutdownin interfaceFEConnectionManager
-
dispatch
public byte[] dispatch(byte[] payload, boolean flush, int oldSessionId) throws ICPExceptionDeliver a serialized command to the BackEnd.- Specified by:
dispatchin interfaceDispatcher- Returns:
- The serialized response
- Throws:
ICPException
-
getConnection
protected JICPConnection getConnection(TransportAddress ta) throws IOException
subclasses may overwrite this to provide their version of a JICPConnection- Parameters:
ta-- Returns:
- Throws:
IOException
-
handleReconnection
protected void handleReconnection(Connection c)
-
doTimeOut
public void doTimeOut(Timer t)
Mutual exclusion with updateKeepAlive(), updateConnectionDropDown() and clearTimers()- Specified by:
doTimeOutin interfaceTimerListener
-
prepareDropDownRequest
protected JICPPacket prepareDropDownRequest()
-
undrop
protected void undrop() throws ICPException- Throws:
ICPException
-
-