public void registerBean(ObjectName beanName, HATarget target) throws Exception { Integer hash = new Integer(beanName.hashCode()); if (beanMap.containsKey(hash)) { log.debug( "Trying to register target " + target + " using an existing hashCode. Already registered: " + hash + "=" + beanMap.get(hash)); throw new IllegalStateException("Trying to register target using an existing hashCode."); } beanMap.put(hash, target); }
public Invoker createProxy(ObjectName beanName, LoadBalancePolicy policy, String proxyFamilyName) throws Exception { Integer hash = new Integer(beanName.hashCode()); HATarget target = (HATarget) beanMap.get(hash); if (target == null) { throw new IllegalStateException("The bean hashCode not found"); } String familyName = proxyFamilyName; if (familyName == null) { familyName = target.getAssociatedPartition().getPartitionName() + "/" + beanName; } return createProxy( getStrictRMIException(), target.getReplicants(), policy, proxyFamilyName, target.getCurrentViewId()); }
/** Returns a hash code for this named object. */ public int hashCode() { return name.hashCode(); }
public void unregisterBean(ObjectName beanName) throws Exception { Integer hash = new Integer(beanName.hashCode()); beanMap.remove(hash); }
@Override public int hashCode() { return 31 + sessionContainerName .hashCode(); // sessionContainerName must never be null (see constructor) }