Class RpcPacketDispatcher


  • public class RpcPacketDispatcher
    extends java.lang.Object
    Top-level client-side packet dispatcher. Responsible for dispatching packets (and their contents) to the correct processor classes or methods as the packets come in from the server. Also responsible for flow control and sundry other things as explained below. There is one RpcPacketDispatcher object for each RpcServer object.
    • Constructor Detail

      • RpcPacketDispatcher

        public RpcPacketDispatcher​(java.util.Properties props,
                                   RpcServer server)
    • Method Detail

      • dispatch

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> dispatch​(CommandEnv cmdEnv)
                                                                                        throws ConnectionException,
                                                                                               AccessException
        Top-level dispatcher method.

        Dispatch (i.e. process) commands sent from the Perforce server in response to the original user command. This is an arbitrarily complex process, and may or may not involve traffic management, etc., so the implementation here may be less than transparent...

        This method only returns when the entire original command was finished; basically, if it returns at all, things went well; otherwise it throws a suitable exception. Extensive work is actually passed off to the various sub dispatchers, which may do their own client / server messaging.

        Parameters:
        cmdEnv - cmdEnv
        Returns:
        dispatcher
        Throws:
        ConnectionException - on error
        AccessException - on error
      • shutdown

        public void shutdown​(RpcConnection rpcConnection)
                      throws ConnectionException
        Attempt to cleanly shut down the dispatcher; this should involve sending a release2 packet, but this is not always possible, and we suppress any resulting errors.
        Parameters:
        rpcConnection - rpcConnection
        Throws:
        ConnectionException - on error
      • getFlowController

        public FlowControl getFlowController()
      • setFlowController

        protected void setFlowController​(FlowControl flowController)