com.alipay.remoting
Class AbstractRemotingProcessor<T extends RemotingCommand>

java.lang.Object
  extended by com.alipay.remoting.AbstractRemotingProcessor<T>
Type Parameters:
T -
All Implemented Interfaces:
RemotingProcessor<T>
Direct Known Subclasses:
RpcHeartBeatProcessor, RpcRequestProcessor, RpcResponseProcessor

public abstract class AbstractRemotingProcessor<T extends RemotingCommand>
extends Object
implements RemotingProcessor<T>

Processor to process remoting command.


Constructor Summary
AbstractRemotingProcessor()
          Default constructor.
AbstractRemotingProcessor(CommandFactory commandFactory)
          Constructor.
AbstractRemotingProcessor(CommandFactory commandFactory, ExecutorService executor)
          Constructor.
AbstractRemotingProcessor(ExecutorService executor)
          Constructor.
 
Method Summary
abstract  void doProcess(RemotingContext ctx, T msg)
          Do the process.
 CommandFactory getCommandFactory()
           
 ExecutorService getExecutor()
          Getter method for property executor.
 void process(RemotingContext ctx, T msg, ExecutorService defaultExecutor)
          Process the remoting command with its own executor or with the defaultExecutor if its own if null.
 void setCommandFactory(CommandFactory commandFactory)
           
 void setExecutor(ExecutorService executor)
          Setter method for property executor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRemotingProcessor

public AbstractRemotingProcessor()
Default constructor.


AbstractRemotingProcessor

public AbstractRemotingProcessor(CommandFactory commandFactory)
Constructor.


AbstractRemotingProcessor

public AbstractRemotingProcessor(ExecutorService executor)
Constructor.

Parameters:
executor -

AbstractRemotingProcessor

public AbstractRemotingProcessor(CommandFactory commandFactory,
                                 ExecutorService executor)
Constructor.

Parameters:
executor -
Method Detail

doProcess

public abstract void doProcess(RemotingContext ctx,
                               T msg)
                        throws Exception
Do the process.

Parameters:
ctx -
msg -
Throws:
Exception

process

public void process(RemotingContext ctx,
                    T msg,
                    ExecutorService defaultExecutor)
             throws Exception
Process the remoting command with its own executor or with the defaultExecutor if its own if null.

Specified by:
process in interface RemotingProcessor<T extends RemotingCommand>
Parameters:
ctx -
msg -
defaultExecutor -
Throws:
Exception

getExecutor

public ExecutorService getExecutor()
Getter method for property executor.

Specified by:
getExecutor in interface RemotingProcessor<T extends RemotingCommand>
Returns:
property value of executor

setExecutor

public void setExecutor(ExecutorService executor)
Setter method for property executor.

Specified by:
setExecutor in interface RemotingProcessor<T extends RemotingCommand>
Parameters:
executor - value to be assigned to property executor

getCommandFactory

public CommandFactory getCommandFactory()

setCommandFactory

public void setCommandFactory(CommandFactory commandFactory)


Copyright © 2018. All rights reserved.