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); }