com.alipay.remoting
Class ProcessorManager

java.lang.Object
  extended by com.alipay.remoting.ProcessorManager

public class ProcessorManager
extends Object

Manager of processors
Maintains the relationship between command and command processor through command code.


Constructor Summary
ProcessorManager()
           
 
Method Summary
 ExecutorService getDefaultExecutor()
          Getter method for property defaultExecutor.
 RemotingProcessor<?> getProcessor(CommandCode cmdCode)
          Get the specific processor with command code of cmdCode if registered, otherwise the default processor is returned.
 void registerDefaultExecutor(ExecutorService executor)
          Set the default executor.
 void registerDefaultProcessor(RemotingProcessor<?> processor)
          Register the default processor to process command with no specific processor registered.
 void registerProcessor(CommandCode cmdCode, RemotingProcessor<?> processor)
          Register processor to process command that has the command code of cmdCode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessorManager

public ProcessorManager()
Method Detail

registerProcessor

public void registerProcessor(CommandCode cmdCode,
                              RemotingProcessor<?> processor)
Register processor to process command that has the command code of cmdCode.

Parameters:
cmdCode -
processor -

registerDefaultProcessor

public void registerDefaultProcessor(RemotingProcessor<?> processor)
Register the default processor to process command with no specific processor registered.

Parameters:
processor -

getProcessor

public RemotingProcessor<?> getProcessor(CommandCode cmdCode)
Get the specific processor with command code of cmdCode if registered, otherwise the default processor is returned.

Parameters:
cmdCode -
Returns:

getDefaultExecutor

public ExecutorService getDefaultExecutor()
Getter method for property defaultExecutor.

Returns:
property value of defaultExecutor

registerDefaultExecutor

public void registerDefaultExecutor(ExecutorService executor)
Set the default executor.

Parameters:
executor -


Copyright © 2018. All rights reserved.