Example #1
0
 public synchronized void checkAndRemoveEmptyServiceClusterProxy(String clusterName)
     throws ApplianceException {
   ServiceClusterProxy serviceClusterProxy =
       (ServiceClusterProxy) serviceClusterProxyMap.get(clusterName);
   if (serviceClusterProxy != null) {
     if (serviceClusterProxy.getFirstServiceCluster() == null) {
       removeServiceCluster(clusterName);
       serviceClusterProxyMap.remove(clusterName);
     }
   } else return;
 }
Example #2
0
 public synchronized void addServiceClusterProxy(ServiceClusterProxy serviceClusterProxy)
     throws ApplianceException {
   if (serviceClusterProxy == null || getServiceCluster(serviceClusterProxy.getName()) != null)
     throw new ApplianceException(INVALID_CLUSTER_OBJECT_MESSAGE);
   Class clusterIf = serviceClusterProxy.getClusterInterfaceClass();
   IServiceCluster serviceCluster =
       (IServiceCluster)
           Proxy.newProxyInstance(
               clusterIf.getClassLoader(),
               new Class[] {IServiceCluster.class, IServiceClusterListener.class, clusterIf},
               serviceClusterProxy);
   if (serviceClusterProxy.getSide() == IServiceCluster.SERVER_SIDE) {
     serverServiceClusters.put(serviceClusterProxy.getType(), serviceCluster);
   } else {
     clientServiceClusters.put(serviceClusterProxy.getType(), serviceCluster);
   }
   serviceClusterProxyMap.put(serviceClusterProxy.getName(), serviceClusterProxy);
 }