Methods Summary |
---|
protected org.jboss.invocation.Invoker | createInvoker()Override the HttpProxyFactory method to create a HttpInvokerProxyHA.
InitialContext iniCtx = new InitialContext();
HAPartition partition = (HAPartition) iniCtx.lookup("/HAPartition/" + partitionName);
/* Create a HATarget for the local invoker mbean stub. The name passed
to the HATarget must be the wrappedJmxInvokerName so that different
more than one HttpProxyFactoryHA may be configured for the same
realJmxInvokerName.
*/
checkInvokerURL();
Serializable invokerStub = super.getInvokerURL();
invokerTarget = new HATarget(partition, wrappedJmxInvokerName.toString(),
invokerStub, HATarget.MAKE_INVOCATIONS_WAIT);
log.debug("Created invoker: "+invokerTarget);
// Create and register the invoker wrapper
MBeanServer mbeanServer = super.getServer();
invokerWrapper = new HAInvokerWrapper(mbeanServer, realJmxInvokerName, invokerTarget);
mbeanServer.registerMBean(invokerWrapper, wrappedJmxInvokerName);
// Create the LoadBalancePolicy instance
LoadBalancePolicy policy = (LoadBalancePolicy) policyClass.newInstance();
// Finally, create the invoker proxy, a HttpInvokerProxyHA
String clusterFamilyName = partitionName + "/" + wrappedJmxInvokerName.toString();
Invoker delegateInvoker = new HttpInvokerProxyHA(invokerTarget.getReplicants(), invokerTarget.getCurrentViewId (),
policy, clusterFamilyName);
return delegateInvoker;
|
protected java.util.ArrayList | defineInterceptors()
ArrayList interceptorClasses = new ArrayList();
interceptorClasses.add(ClientMethodInterceptorHA.class);
interceptorClasses.add(InvokerInterceptor.class);
return interceptorClasses;
|
public void | destroy()Destroys the HATarget
super.destroy();
try
{
invokerTarget.destroy();
}
catch(Exception ignore)
{
}
|
public java.lang.Class | getLoadBalancePolicy()Get the server side mbean that exposes the invoke operation for the
exported interface
return this.policyClass;
|
public java.lang.String | getPartitionName()Get the name of the cluster partition the invoker is deployed in
return this.partitionName;
|
public javax.management.ObjectName | getRealJmxInvokerName()
return realJmxInvokerName;
|
public void | setInvokerName(javax.management.ObjectName jmxInvokerName)Override the superclass method to create a wrapped ObjectName for the
HAInvokerWrapper mbean. This will be the name of the invoker as known
by the proxy. The HAInvokerWrapper is the HttpProxyFactoryHA name +
wrapperType=httpHA
realJmxInvokerName = jmxInvokerName;
ObjectName factoryName = getServiceName();
Hashtable props = factoryName.getKeyPropertyList();
props.put("wrapperType", "httpHA");
try
{
wrappedJmxInvokerName = new ObjectName(factoryName.getDomain(), props);
super.setInvokerName(wrappedJmxInvokerName);
}
catch(MalformedObjectNameException e)
{
throw new IllegalStateException("Was not able to create wrapped ObjectName");
}
|
public void | setLoadBalancePolicy(java.lang.Class policyClass)Set the server side mbean that exposes the invoke operation for the
exported interface
this.policyClass = policyClass;
|
public void | setPartitionName(java.lang.String name)Set the name of the cluster partition the invoker is deployed in
this.partitionName = name;
|
protected void | stopService()Override the HttpProxyFactory stop to unregister the HAInvokerWrapper
mbean
try
{
MBeanServer mbeanServer = super.getServer();
mbeanServer.unregisterMBean(wrappedJmxInvokerName);
}
catch(Exception e)
{
log.debug("Failed to unregister HAInvokerWrapper: "+wrappedJmxInvokerName, e);
}
super.stopService();
|