/** * @param targets the list of URLs through which clients should contact the * InvokerServlet. * @param policy the policy for choosing among targets ClusteringTargetsRepository under * which this proxy is to be stored * @param proxyFamilyName the name into the */ public HttpInvokerProxyHA(List targets, long viewId, LoadBalancePolicy policy, String proxyFamilyName) { this.familyClusterInfo = ClusteringTargetsRepository.initTarget (proxyFamilyName, targets, viewId); this.loadBalancePolicy = policy; this.proxyFamilyName = proxyFamilyName; this.trace = log.isTraceEnabled(); if( trace ) log.trace("Init, cluterInfo: "+familyClusterInfo+", policy="+loadBalancePolicy); }
public Object invoke (Invocation mi) throws Throwable { Object data = mi.getValue ("DO_FAIL_DURING_NEXT_CALL"); if (data != null && data instanceof java.lang.Boolean && data.equals (java.lang.Boolean.TRUE)) { // Clear the instruction mi.setValue ("DO_FAIL_DURING_NEXT_CALL", Boolean.FALSE, PayloadKey.AS_IS); if (proxyFamilyName == null) { proxyFamilyName = getProxyFamilyName(mi); } // Clear the targets to simulate exhausting them all FamilyClusterInfo info = ClusteringTargetsRepository.getFamilyClusterInfo(proxyFamilyName); for (Object target: info.getTargets()) info.removeDeadTarget(target); throw new ServiceUnavailableException("Service unavailable", new Exception("Test")); } return getNext().invoke(mi); }
/** Un-externalize this instance. */ public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { List targets = (List) in.readObject(); long vid = in.readLong (); this.loadBalancePolicy = (LoadBalancePolicy) in.readObject(); this.proxyFamilyName = (String)in.readObject(); this.trace = log.isTraceEnabled(); // keep a reference on our family object this.familyClusterInfo = ClusteringTargetsRepository.initTarget(this.proxyFamilyName, targets, vid); if( trace ) log.trace("Init, clusterInfo: "+familyClusterInfo+", policy="+loadBalancePolicy); } }
public HARMIClient(List<?> targets, long initViewId, LoadBalancePolicy policy, String key, Object local) { this.familyClusterInfo = ClusteringTargetsRepository.initTarget (key, targets, initViewId); //this.targets = targets; this.loadBalancePolicy = policy; if (this.loadBalancePolicy instanceof org.jboss.ha.framework.interfaces.LoadBalancePolicy) { ((org.jboss.ha.framework.interfaces.LoadBalancePolicy)this.loadBalancePolicy).init(this); } this.key = key; this.local = local; this.trace = log.isTraceEnabled(); if( trace ) log.trace("Init, cluterInfo: "+familyClusterInfo+", policy="+loadBalancePolicy); }
public UnifiedInvokerHAProxy(InvokerLocator locator, boolean isStrictRMIException, List<?> targets, LoadBalancePolicy policy, String proxyFamilyName, long viewId) { super(); // JBAS-8636 avoid calling init() until we correctly set the subsystem this.familyClusterInfo = ClusteringTargetsRepository.initTarget(proxyFamilyName, targets, viewId); this.loadBalancePolicy = policy; this.proxyFamilyName = proxyFamilyName; trace = log.isTraceEnabled(); setSubSystem("invokerha"); setStrictRMIException(isStrictRMIException); init(locator); }
this.familyClusterInfo = ClusteringTargetsRepository.initTarget (this.key, targets, vid);
this.familyClusterInfo = ClusteringTargetsRepository.initTarget(this.proxyFamilyName, targets, vid);
ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicantList()); families.put(proxyFamilyName, target); ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicantList()); families.put(proxyFamilyName, target); advisor.insertInterceptor(0, new ReplicantsManagerInterceptor(families));