org.objectweb.cjdbc.controller.loadbalancer.policies
Class WaitForCompletionPolicy

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.loadbalancer.policies.WaitForCompletionPolicy

public class WaitForCompletionPolicy
extends java.lang.Object

Defines the policy to adopt before returning a result to the client.

Version:
1.0
Author:
Emmanuel Cecchet

Field Summary
static int ALL
          Wait for all nodes to complete the request before returning the result.
static int FIRST
          Return as soon as one node has completed the request.
static int MAJORITY
          Return as soon as a majority (n/2+1) of nodes has completed the request.
private  int policy
          Policy (default is FIRST).
 
Constructor Summary
WaitForCompletionPolicy()
           
 
Method Summary
 java.lang.String getInformation()
          Gives information about the current policy.
 int getPolicy()
          Returns the policy.
 java.lang.String getXml()
          Returns this wait policy in xml format.
 void setPolicy(int policy)
          Sets the policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST

public static final int FIRST
Return as soon as one node has completed the request.

See Also:
Constant Field Values

MAJORITY

public static final int MAJORITY
Return as soon as a majority (n/2+1) of nodes has completed the request.

See Also:
Constant Field Values

ALL

public static final int ALL
Wait for all nodes to complete the request before returning the result.

See Also:
Constant Field Values

policy

private int policy
Policy (default is FIRST).

Constructor Detail

WaitForCompletionPolicy

public WaitForCompletionPolicy()
Method Detail

getPolicy

public int getPolicy()
Returns the policy.

Returns:
an int value

setPolicy

public void setPolicy(int policy)
Sets the policy.

Parameters:
policy - the policy to set

getInformation

public java.lang.String getInformation()
Gives information about the current policy.

Returns:
a String value

getXml

public java.lang.String getXml()
Returns this wait policy in xml format.

Returns:
xml formatted string


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.