/** Override the HttpProxyFactory method to create a HttpInvokerProxyHA. * @return an invoker proxy * @throws Exception */ protected Invoker createInvoker() throws Exception { HAPartition partition = HAPartitionLocator.getHAPartitionLocator().getHAPartition(partitionName, null); /* 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.getReplicantList(), invokerTarget.getCurrentViewId (), policy, clusterFamilyName); return delegateInvoker; }
if (state == ServiceMBean.STARTED) mode = HATarget.ENABLE_INVOCATIONS; target = new HATarget(partition, replicantName, invokerHA.getStub(), mode); invokerHA.registerBean(getServiceName(), target);
target = new HATarget(partition, replicantName, jrmp.getStub (), HATarget.MAKE_INVOCATIONS_WAIT); jrmp.registerBean(jmxName, target);
if (target == null) target = new HATarget(partition, proxyFamilyName, locator, HATarget.ENABLE_INVOCATIONS); ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicantList()); families.put(proxyFamilyName, target); target = new HATarget(partition, proxyFamilyName, locator, HATarget.ENABLE_INVOCATIONS); ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicantList()); families.put(proxyFamilyName, target);