org.infinispan.remoting.rpc
Class RpcOptionsBuilder

java.lang.Object
  extended by org.infinispan.remoting.rpc.RpcOptionsBuilder

public class RpcOptionsBuilder
extends Object

It builds RpcOptions instances with the options to be used in remote invocations.

Since:
5.3
Author:
Pedro Ruivo

Constructor Summary
RpcOptionsBuilder(long timeout, TimeUnit unit, ResponseMode responseMode, boolean fifoOrder)
           
RpcOptionsBuilder(RpcOptions template)
          Constructor based on existing RpcOptions
 
Method Summary
 RpcOptions build()
           
 boolean equals(Object o)
           
 RpcOptionsBuilder fifoOrder(boolean fifoOrder)
          Note: this option may be set to false if by the current Transport if the ResponseMode.isSynchronous() returns true.
 int hashCode()
           
 RpcOptionsBuilder responseFilter(ResponseFilter responseFilter)
          Sets the ResponseFilter.
 RpcOptionsBuilder responseMode(ResponseMode responseMode)
          Sets the ResponseMode for the remote invocation.
 RpcOptionsBuilder skipReplicationQueue(boolean skipReplicationQueue)
          Sets if the remote invocation must skip the ReplicationQueue.
 RpcOptionsBuilder timeout(long timeout, TimeUnit unit)
          Sets the timeout value and its TimeUnit.
 long timeout(TimeUnit outputTimeUnit)
          See timeout(long, java.util.concurrent.TimeUnit)
 String toString()
           
 RpcOptionsBuilder totalOrder(boolean totalOrder)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RpcOptionsBuilder

public RpcOptionsBuilder(long timeout,
                         TimeUnit unit,
                         ResponseMode responseMode,
                         boolean fifoOrder)

RpcOptionsBuilder

public RpcOptionsBuilder(RpcOptions template)
Constructor based on existing RpcOptions

Parameters:
template - an existing RpcOptions
Method Detail

timeout

public RpcOptionsBuilder timeout(long timeout,
                                 TimeUnit unit)
Sets the timeout value and its TimeUnit.

Parameters:
timeout - timeout value
unit - the TimeUnit of timeout value
Returns:
this instance

timeout

public long timeout(TimeUnit outputTimeUnit)
See timeout(long, java.util.concurrent.TimeUnit)

Returns:
the timeout in TimeUnit.

fifoOrder

public RpcOptionsBuilder fifoOrder(boolean fifoOrder)
Note: this option may be set to false if by the current Transport if the ResponseMode.isSynchronous() returns true.

Parameters:
fifoOrder - if true, it the message will be deliver in First In, First Out (FIFO) order with other sent message with FIFO. Otherwise, the message is delivered as soon as it is received.
Returns:
this instance

totalOrder

public RpcOptionsBuilder totalOrder(boolean totalOrder)
Parameters:
totalOrder - if true, the message will be delivered by a global order, i.e., the same order in all the nodes
Returns:
this instance

responseFilter

public RpcOptionsBuilder responseFilter(ResponseFilter responseFilter)
Sets the ResponseFilter. null by default, meaning it will wait for all or none response depending if the remote invocation is synchronous or asynchronous respectively.

Parameters:
responseFilter -
Returns:
this instance

responseMode

public RpcOptionsBuilder responseMode(ResponseMode responseMode)
Sets the ResponseMode for the remote invocation. See ResponseMode documentation to see the available values.

Parameters:
responseMode -
Returns:
this instance

skipReplicationQueue

public RpcOptionsBuilder skipReplicationQueue(boolean skipReplicationQueue)
Sets if the remote invocation must skip the ReplicationQueue.

Note1: only asynchronous remote invocation may be dispatched to the ReplicationQueue.

Node2: false by default

Parameters:
skipReplicationQueue - true to force skip the ReplicationQueue
Returns:
this instance

build

public final RpcOptions build()
Returns:
an instance of RpcOptions with the current builder options

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

-->

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.