|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ha.framework.interfaces.HARMIClient
public class HARMIClient
Field Summary | |
---|---|
protected static Method |
EQUALS
Object.equals(java.lang.Object) method reference. |
protected static Method |
HASH_CODE
Object.hashCode() method reference. |
protected String |
key
|
protected org.jboss.ha.client.loadbalance.LoadBalancePolicy |
loadBalancePolicy
|
protected Object |
local
|
protected static Method |
TO_STRING
Object.toString() method reference. |
protected boolean |
trace
|
Constructor Summary | |
---|---|
HARMIClient()
|
|
HARMIClient(List targets,
org.jboss.ha.client.loadbalance.LoadBalancePolicy policy,
String key)
|
|
HARMIClient(List targets,
long initViewId,
org.jboss.ha.client.loadbalance.LoadBalancePolicy policy,
String key,
Object local)
|
Method Summary | |
---|---|
Method |
findLocalMethod(Method method,
Object[] args)
|
Object |
getRemoteTarget()
|
Object |
invoke(Object proxy,
Method method,
Object[] args)
Invoke the given method, locally if possible; if not then invoke against a remote server . |
Object |
invokeRemote(Object proxy,
Method method,
Object[] args)
Invoke the given method against a remote server. |
boolean |
isLocal()
|
void |
remoteTargetHasFailed(Object target)
|
protected void |
removeDeadTarget(Object target)
|
void |
updateClusterInfo(ArrayList targets,
long viewId)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Method TO_STRING
Object.toString()
method reference.
protected static final Method HASH_CODE
Object.hashCode()
method reference.
protected static final Method EQUALS
Object.equals(java.lang.Object)
method reference.
protected String key
protected org.jboss.ha.client.loadbalance.LoadBalancePolicy loadBalancePolicy
protected transient Object local
protected transient boolean trace
Constructor Detail |
---|
public HARMIClient()
public HARMIClient(List targets, org.jboss.ha.client.loadbalance.LoadBalancePolicy policy, String key)
public HARMIClient(List targets, long initViewId, org.jboss.ha.client.loadbalance.LoadBalancePolicy policy, String key, Object local)
Method Detail |
---|
public void updateClusterInfo(ArrayList targets, long viewId)
public Object getRemoteTarget()
public void remoteTargetHasFailed(Object target)
public Method findLocalMethod(Method method, Object[] args) throws Exception
Exception
public Object invokeRemote(Object proxy, Method method, Object[] args) throws Throwable
RemoteException
subtypes, catch the exception and
attempt to fail over to another server.
Failover will only be attempted if the remote call throws an exception whose type indicates the call never reached the server:
All other exception types will not be caught.
If one of the above exception types is caught when invoking against the
last known server, then a RemoteException
will be thrown. This
exception will include as its cause
either
NoSuchObjectException
that was caughtNoSuchObjectException
that was caught,
the exception thrown on the last failover attemptNoSuchObjectException
as
the cause, as that exception indicates that a server was listening on
the expected address and port but that this client has an RMI stub that
is out of sync with the server. This would typically happen due to
a server restart or service redeploy. Knowledge of this failure condition
could potentially be useful to the caller.
proxy
- the proxy object that's being invokedmethod
- the method to invokeargs
- arguments to the method
null
Throwable
- Throwable thrown when making remote call, or the
RemoteException
discussed above.public boolean isLocal()
isLocal
in interface HARMIProxy
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke against a remote server
.
invoke
in interface InvocationHandler
Throwable
invokeRemote(Object, Method, Object[])
protected void removeDeadTarget(Object target)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |