Class RpcPacketDispatcher
java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.packet.RpcPacketDispatcher
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 ClassesModifier and TypeClassDescriptionstatic enumSpecifies the mode the dispatcher's currently running in.static enumAn enum used by subsidiary function and packet dispatchers to tell this level of dispatcher what to do. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondispatch(CommandEnv cmdEnv) Top-level dispatcher method.protected voidsetFlowController(FlowControl flowController) voidshutdown(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 Details
-
TRACE_PREFIX
- See Also:
-
-
Constructor Details
-
RpcPacketDispatcher
-
-
Method Details
-
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.
- Parameters:
cmdEnv- cmdEnv- Returns:
- dispatcher
- Throws:
ConnectionException- on errorAccessException- on error
-
shutdown
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
-
setFlowController
-