protected HAPartition findHAPartitionWithName (String name) throws Exception { return HAPartitionLocator.getHAPartitionLocator().getHAPartition(name, null); }
/** Initializes the cache for use. Prior to this the cache has no store. */ public void create() { // Lookup the parition HAPartition partition = HAPartitionLocator.getHAPartitionLocator().getHAPartition(this.partitionName, null); this.entryMap = partition.getDistributedStateService(); log.debug("Obtained DistributedState from partition=" + this.partitionName); this.now = System.currentTimeMillis(); }
@Override protected void startService() throws Exception { if (this.partition == null) { this.partition = HAPartitionLocator.getHAPartitionLocator().getHAPartition(this.partitionName, null); } // Register as a listener of cluster membership changes this.partition.registerMembershipListener(this); this.log.info("Registered as MembershipListener"); try { this.hostname = InetAddress.getLocalHost().getHostName(); } catch (IOException e) { this.log.warn("Failed to lookup local hostname", e); this.hostname = "<unknown>"; } }
/** 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; }
protected void setupInvokers() throws Exception HAPartition partition = HAPartitionLocator.getHAPartitionLocator().getHAPartition(partitionName, null); this.drm = partition.getDistributedReplicantManager ();
HAPartition partition = HAPartitionLocator.getHAPartitionLocator().getHAPartition(partitionName, null);