org.apache.blur.thrift
Class AbstractCommand<CLIENT,T>

java.lang.Object
  extended by org.apache.blur.thrift.AbstractCommand<CLIENT,T>
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
BlurCommand

public abstract class AbstractCommand<CLIENT,T>
extends Object
implements Cloneable


Constructor Summary
AbstractCommand()
           
 
Method Summary
abstract  T call(CLIENT client)
          Abstract method that will be executed with a CLIENT object.
 T call(CLIENT client, Connection connection)
          If this method is implemented then the call(CLIENT client) method is not called.
 AbstractCommand<CLIENT,T> clone()
           
 boolean isDetachClient()
          Reads if this command is to detach the client from the pool or not.
 void setDetachClient(boolean detachClient)
          Sets the attribute of detach client.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCommand

public AbstractCommand()
Method Detail

isDetachClient

public boolean isDetachClient()
Reads if this command is to detach the client from the pool or not. If detach is set to true, then the user of the call needs to return the client to the pool by calling returnClient on the BlurClientManager.

Returns:
the boolean.

setDetachClient

public void setDetachClient(boolean detachClient)
Sets the attribute of detach client.

Parameters:
detachClient - the boolean value.

call

public T call(CLIENT client,
              Connection connection)
       throws BlurException,
              TException
If this method is implemented then the call(CLIENT client) method is not called. This allows the command to gain access to the Connection object that is not normally needed. Usually used in conjunction with the detachClient attribute.

Parameters:
client - the client.
connection - the connection object.
Returns:
object.
Throws:
BlurException
TException

call

public abstract T call(CLIENT client)
                throws BlurException,
                       TException
Abstract method that will be executed with a CLIENT object. And it will be retried if a TException is throw (that type of exception is assumed to be a problem with the connection to the remote system).

Parameters:
client - the client.
Returns:
object.
Throws:
BlurException
TException

clone

public AbstractCommand<CLIENT,T> clone()
Overrides:
clone in class Object


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.