org.xins.common.service
Class CallConfig

java.lang.Object
  extended byorg.xins.common.service.CallConfig
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HTTPCallConfig, XINSCallConfig

public class CallConfig
extends Object
implements Serializable

Configuration for a service call. Objects of this type specify certain aspects of how a call is executed. For example, for an HTTP service caller, a CallConfig object could specify what HTTP method (GET, POST, etc.) to use.

This base class only specifies the property failOverAllowed, which indicates whether fail-over is unconditionally allowed, even if the request was already received or even processed by the other end.

Thread-safety

This class is thread-safe, and subclasses must be thread-safe as well. When reading or writing a field, the code should synchronize on the lock object returned by getLock(). For example, the failOverAllowed getter and setter methods in this class could be implemented as follows:

public final boolean isFailOverAllowed() {
   synchronized (getLock()) {
      return _failOverAllowed;
   }
}

public final void setFailOverAllowed(boolean allowed) {
   synchronized (getLock()) {
      _failOverAllowed = allowed;
   }
}

Since:
XINS 1.1.0
Version:
$Revision: 1.21 $ $Date: 2006/10/25 11:20:57 $
Author:
Ernst de Haan
See Also:
ServiceCaller, CallRequest, Serialized Form

Constructor Summary
CallConfig()
          Constructs a new CallConfig object.
 
Method Summary
 String describe()
          Describes this configuration.
protected  Object getLock()
          Returns the access controller for the fields in this object.
 boolean isFailOverAllowed()
          Determines whether fail-over is unconditionally allowed.
 void setFailOverAllowed(boolean allowed)
          Configures whether fail-over is unconditionally allowed.
 String toString()
          Returns a textual presentation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CallConfig

public CallConfig()
Constructs a new CallConfig object.

Method Detail

getLock

protected final Object getLock()
Returns the access controller for the fields in this object. Field reading or writing code should synchronize on this object.

Returns:
the lock, never null.

describe

public String describe()
Describes this configuration. The description should be trimmed and should fit in a sentence. Good examples include "HTTP call config #1592 [failOverAllowed=true, method=\"POST\"]" and "HTTP call config #12 [failOverAllowed=false, method=(null)]"

The implementation of this method in class CallConfig returns a descriptive string that contains an instance number and the failOverAllowed setting.

Returns:
the description of this configuration, should never be null, should never be empty and should never start or end with whitespace characters.

toString

public final String toString()
Returns a textual presentation of this object.

The implementation of this method in class CallRequest returns describe().

Returns:
a textual presentation of this object, should never be null.

isFailOverAllowed

public final boolean isFailOverAllowed()
Determines whether fail-over is unconditionally allowed.

Returns:
true if fail-over is unconditionally allowed, even if the request was already received or even processed by the other end, false otherwise.

setFailOverAllowed

public final void setFailOverAllowed(boolean allowed)
Configures whether fail-over is unconditionally allowed.

Parameters:
allowed - true if fail-over is unconditionally allowed, even if the request was already received or even processed by the other end, false otherwise.


See http://www.xins.org/.