1 23 24 26 27 package com.sun.enterprise.management.config; 28 29 import java.util.Map ; 30 31 import javax.management.ObjectName ; 32 33 import com.sun.appserv.management.base.XTypes; 34 35 import com.sun.enterprise.management.config.AMXConfigImplBase; 36 import com.sun.enterprise.management.support.Delegate; 37 import com.sun.appserv.management.config.LBConfig; 38 import com.sun.appserv.management.base.Util; 39 40 41 44 public final class LBConfigImpl extends AMXConfigImplBase 45 implements ConfigFactoryCallback { 46 47 public LBConfigImpl(final Delegate delegate) { 48 super(delegate); 49 } 50 51 public Map <String ,ObjectName > getClusterRefConfigObjectNameMap() { 52 return(getContaineeObjectNameMap(XTypes.CLUSTER_REF_CONFIG)); 53 } 54 55 public Map <String ,ObjectName > getServerRefConfigObjectNameMap() { 56 return(getContaineeObjectNameMap(XTypes.SERVER_REF_CONFIG)); 57 } 58 59 private ClusterRefConfigFactory getClusterRefConfigFactory() { 60 return new ClusterRefConfigFactory(this); 61 } 62 63 public ObjectName createClusterRefConfig(String referencedClusterName, 64 String lbPolicy, String lbPolicyModule) { 65 66 return getClusterRefConfigFactory().create(referencedClusterName, 67 lbPolicy, lbPolicyModule); 68 } 69 70 public void removeClusterRefConfig( final String name) { 71 final Map <String ,ObjectName > items = getClusterRefConfigObjectNameMap(); 72 getClusterRefConfigFactory().remove(Util.getObjectName(items, name)); 73 } 74 75 private ServerRefConfigFactory getServerRefConfigFactory() { 76 return new ServerRefConfigFactory(this); 77 } 78 79 public ObjectName createServerRefConfig(final String referencedServerName, 80 final Map <String ,String > optional) { 81 82 return getServerRefConfigFactory().create(referencedServerName, optional); 83 } 84 85 public ObjectName createServerRefConfig(final String referencedServerName, 86 final String disableTimeoutInMinutes, final boolean lbEnabled, 87 final boolean enabled) { 88 89 return getServerRefConfigFactory().create(referencedServerName, 90 disableTimeoutInMinutes, lbEnabled, enabled); 91 } 92 93 public void removeServerRefConfig( final String name) { 94 final Map <String ,ObjectName > items = getServerRefConfigObjectNameMap(); 95 getServerRefConfigFactory().remove(Util.getObjectName(items, name)); 96 } 97 } | Popular Tags |