com.perforce.p4java.impl.mapbased.rpc.packet
Class RpcPacketDispatcher

java.lang.Object
  extended by com.perforce.p4java.impl.mapbased.rpc.packet.RpcPacketDispatcher

public class RpcPacketDispatcher
extends 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.


Nested Class Summary
static class RpcPacketDispatcher.RpcPacketDispatcherMode
          Specifies the mode the dispatcher's currently running in.
static class RpcPacketDispatcher.RpcPacketDispatcherResult
          An enum used by subsidiary function and packet dispatchers to tell this level of dispatcher what to do.
 
Field Summary
static String TRACE_PREFIX
           
 
Constructor Summary
RpcPacketDispatcher(Properties props, RpcServer server)
           
 
Method Summary
 List<Map<String,Object>> dispatch(CommandEnv cmdEnv)
          Top-level dispatcher method.
 FlowControl getFlowController()
           
protected  void setFlowController(FlowControl flowController)
           
 void shutdown(RpcConnection rpcConnection)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE_PREFIX

public static final String TRACE_PREFIX
See Also:
Constant Field Values
Constructor Detail

RpcPacketDispatcher

public RpcPacketDispatcher(Properties props,
                           RpcServer server)
Method Detail

dispatch

public List<Map<String,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.

Throws:
ConnectionException
AccessException

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.

Throws:
ConnectionException

getFlowController

public FlowControl getFlowController()

setFlowController

protected void setFlowController(FlowControl flowController)


Copyright © 2015 Perforce Software. All Rights Reserved.