org.jboss.invocation.http.interfaces
Class HttpInvokerProxyHA

java.lang.Object
  extended byorg.jboss.invocation.http.interfaces.HttpInvokerProxyHA
All Implemented Interfaces:
java.io.Externalizable, Invoker (src) , InvokerProxyHA (src) , java.rmi.Remote, java.io.Serializable

public class HttpInvokerProxyHA
extends java.lang.Object
implements InvokerProxyHA (src) , Invoker (src) , java.io.Externalizable

The client side Http invoker proxy that posts an invocation to the InvokerServlet using the HttpURLConnection created from a target url. This proxy handles failover using its associated LoadBalancePolicy and current list of URL strings. The candidate URLs are updated dynamically after an invocation if the cluster partitation view has changed.

See Also:
Serialized Form

Field Summary
protected  FamilyClusterInfo (src) familyClusterInfo
           
protected  LoadBalancePolicy (src) loadBalancePolicy
           
protected  java.lang.String proxyFamilyName
           
protected  boolean trace
          Trace level logging flag only set when the proxy is created or read from JNDI
 
Fields inherited from interface org.jboss.invocation.Invoker (src)
ID
 
Constructor Summary
HttpInvokerProxyHA()
           
HttpInvokerProxyHA(java.util.ArrayList targets, long viewId, LoadBalancePolicy (src)  policy, java.lang.String proxyFamilyName)
           
 
Method Summary
 FamilyClusterInfo (src) getClusterInfo()
           
 java.lang.Object getRemoteTarget()
           
 java.lang.Object getRemoteTarget(Invocation (src)  invocationBasedRouting)
           
 java.lang.String getServerHostName()
          A free form String identifier for this delegate invoker, can be clustered or target node This should evolve in a more advanced meta-inf object
 java.lang.Object invoke(Invocation (src)  invocation)
          This method builds a MarshalledInvocation from the invocation passed in and then does a post to the target URL.
 void readExternal(java.io.ObjectInput in)
          Un-externalize this instance.
 void remoteTargetHasFailed(java.lang.Object target)
           
protected  void removeDeadTarget(java.lang.Object target)
           
protected  void resetView()
           
protected  int totalNumberOfTargets()
           
 void updateClusterInfo(java.util.ArrayList targets, long viewId)
           
 void writeExternal(java.io.ObjectOutput out)
          Externalize this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loadBalancePolicy

protected LoadBalancePolicy (src)  loadBalancePolicy

proxyFamilyName

protected java.lang.String proxyFamilyName

familyClusterInfo

protected FamilyClusterInfo (src)  familyClusterInfo

trace

protected transient boolean trace
Trace level logging flag only set when the proxy is created or read from JNDI

Constructor Detail

HttpInvokerProxyHA

public HttpInvokerProxyHA()

HttpInvokerProxyHA

public HttpInvokerProxyHA(java.util.ArrayList targets,
                          long viewId,
                          LoadBalancePolicy (src)  policy,
                          java.lang.String proxyFamilyName)
Parameters:
targets - the list of URLs through which clients should contact the InvokerServlet.
policy - the policy for choosing among targets ClusteringTargetsRepository under which this proxy is to be stored
proxyFamilyName - the name into the
Method Detail

updateClusterInfo

public void updateClusterInfo(java.util.ArrayList targets,
                              long viewId)
Specified by:
updateClusterInfo in interface InvokerProxyHA (src)

getServerHostName

public java.lang.String getServerHostName()
                                   throws java.lang.Exception
Description copied from interface: Invoker (src)
A free form String identifier for this delegate invoker, can be clustered or target node This should evolve in a more advanced meta-inf object

Specified by:
getServerHostName in interface Invoker (src)
Throws:
java.lang.Exception

getClusterInfo

public FamilyClusterInfo (src)  getClusterInfo()

getRemoteTarget

public java.lang.Object getRemoteTarget()

getRemoteTarget

public java.lang.Object getRemoteTarget(Invocation (src)  invocationBasedRouting)

remoteTargetHasFailed

public void remoteTargetHasFailed(java.lang.Object target)

totalNumberOfTargets

protected int totalNumberOfTargets()

removeDeadTarget

protected void removeDeadTarget(java.lang.Object target)

resetView

protected void resetView()

invoke

public java.lang.Object invoke(Invocation (src)  invocation)
                        throws java.lang.Exception
This method builds a MarshalledInvocation from the invocation passed in and then does a post to the target URL.

Specified by:
invoke in interface Invoker (src)
Parameters:
invocation - A pointer to the invocation object
Returns:
Return value of method invocation.
Throws:
java.lang.Exception - Failed to invoke method.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Externalize this instance.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Un-externalize this instance.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException