de.fzj.unicore.uas.client
Class MultiWSRFClient<T extends BaseUASClient>

java.lang.Object
  extended by de.fzj.unicore.uas.client.MultiWSRFClient<T>
Direct Known Subclasses:
ExternalRegistryClient

public class MultiWSRFClient<T extends BaseUASClient>
extends java.lang.Object

Talks to multiple WSRF services in a round-robin or multicast fashion.
TODO support for plain ws

Author:
schuller

Field Summary
protected  java.util.List<T> clients
           
protected static org.apache.log4j.Logger logger
           
static int MULTICAST
          Multicast mode: all services will receive messages
static int PRIMARY_WITH_BACKUP
          The first service is the primary one, the others act as backup
static int ROUNDROBIN
          Roundrobin mode
static int ROUNDROBIN_RETRY_ON_FAILURE
          Roundrobin mode, and calls will be retried if they fail
 
Constructor Summary
MultiWSRFClient()
           
 
Method Summary
 void addClient(T client)
           
 boolean getErrorsOccurred()
           
protected
<Target> java.lang.reflect.InvocationHandler
getInvocationHandler(java.util.List<Target> targets)
           
protected  int getMaxRetries()
           
<Target> Target
makeProxy(java.lang.Class<Target> target)
          create a proxy for the given interface
 boolean removeClient(T client)
           
 void setGlobalRetryPolicy(de.fzj.unicore.wsrflite.xfire.ReliableProxy.RetryDecider policy)
          sets the ReliableProxy.RetryDecider retry policy on all the clients
 void setMaxRetries(int maxRetries)
           
 void setMode(int mode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

MULTICAST

public static final int MULTICAST
Multicast mode: all services will receive messages

See Also:
Constant Field Values

ROUNDROBIN

public static final int ROUNDROBIN
Roundrobin mode

See Also:
Constant Field Values

ROUNDROBIN_RETRY_ON_FAILURE

public static final int ROUNDROBIN_RETRY_ON_FAILURE
Roundrobin mode, and calls will be retried if they fail

See Also:
Constant Field Values

PRIMARY_WITH_BACKUP

public static final int PRIMARY_WITH_BACKUP
The first service is the primary one, the others act as backup

See Also:
Constant Field Values

clients

protected java.util.List<T extends BaseUASClient> clients
Constructor Detail

MultiWSRFClient

public MultiWSRFClient()
Method Detail

addClient

public void addClient(T client)

removeClient

public boolean removeClient(T client)

setGlobalRetryPolicy

public void setGlobalRetryPolicy(de.fzj.unicore.wsrflite.xfire.ReliableProxy.RetryDecider policy)
sets the ReliableProxy.RetryDecider retry policy on all the clients

Parameters:
policy - - the retry policy

setMode

public void setMode(int mode)

makeProxy

public <Target> Target makeProxy(java.lang.Class<Target> target)
                 throws java.lang.Exception
create a proxy for the given interface

Type Parameters:
Target -
Parameters:
target -
Returns:
Throws:
java.lang.Exception

getInvocationHandler

protected <Target> java.lang.reflect.InvocationHandler getInvocationHandler(java.util.List<Target> targets)

getMaxRetries

protected int getMaxRetries()

setMaxRetries

public void setMaxRetries(int maxRetries)

getErrorsOccurred

public boolean getErrorsOccurred()


Copyright © 2006-2010 Research Center Juelich. All Rights Reserved.