예제 #1
0
  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);
  }
예제 #2
0
  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());
  }
예제 #3
0
 /** Returns a hash code for this named object. */
 public int hashCode() {
   return name.hashCode();
 }
예제 #4
0
 public void unregisterBean(ObjectName beanName) throws Exception {
   Integer hash = new Integer(beanName.hashCode());
   beanMap.remove(hash);
 }
예제 #5
0
 @Override
 public int hashCode() {
   return 31
       + sessionContainerName
           .hashCode(); // sessionContainerName must never be null (see constructor)
 }