Class RpcPacketDispatcher
- java.lang.Object
-
- com.perforce.p4java.impl.mapbased.rpc.packet.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description 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
Fields Modifier and Type Field Description static java.lang.String
TRACE_PREFIX
-
Constructor Summary
Constructors Constructor Description RpcPacketDispatcher(java.util.Properties props, RpcServer server)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.util.Map<java.lang.String,java.lang.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.
-
-
-
Field Detail
-
TRACE_PREFIX
public static final java.lang.String TRACE_PREFIX
- See Also:
- Constant Field Values
-
-
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 errorAccessException
- 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)
-
-