Class BIFEDispatcher

    • Field Detail

      • myMediatorClass

        protected String myMediatorClass
      • outConnection

        protected Connection outConnection
      • myInputManager

        protected jade.imtp.leap.JICP.BIFEDispatcher.InputManager myInputManager
      • refreshingInput

        protected boolean refreshingInput
      • refreshingOutput

        protected boolean refreshingOutput
    • Constructor Detail

      • BIFEDispatcher

        public BIFEDispatcher()
    • 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:
        getBackEnd in interface FEConnectionManager
        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
      • dispatch

        public byte[] dispatch​(byte[] payload,
                               boolean flush,
                               int oldSessionId)
                        throws ICPException
        Deliver a serialized command to the BackEnd.
        Specified by:
        dispatch in interface Dispatcher
        Returns:
        The serialized response
        Throws:
        ICPException
      • refreshInp

        protected void refreshInp()
        Close the current InputManager (if any) and start a new one
      • refreshOut

        protected void refreshOut()
        Close the current outConnection (if any) and starts a new thread that asynchronously tries to restore it.
      • run

        public void run()
        Asynchronously restore the OUT connection
        Specified by:
        run in interface Runnable
      • handleInpReconnection

        protected void handleInpReconnection​(Connection c)
      • handleOutReconnection

        protected void handleOutReconnection​(Connection c)
      • sendKeepAlive

        protected void sendKeepAlive()
        Send a KEEP_ALIVE packet to the BE. This is executed within a synchronized block --> Mutual exclusion with dispatch() is guaranteed.
      • prepareDropDownRequest

        protected JICPPacket prepareDropDownRequest()
      • dispatchWhileDropped

        protected void dispatchWhileDropped()