1 19 package org.netbeans.modules.j2ee.sun.ide.controllers; 20 21 import java.util.List ; 22 import com.sun.appserv.management.config.Enabled; 23 import com.sun.appserv.management.client.AppserverConnectionSource; 24 import com.sun.appserv.management.config.AppClientModuleConfig; 25 import com.sun.appserv.management.config.DeployedItemRefConfig; 26 import com.sun.appserv.management.j2ee.AppClientModule; 27 28 import javax.enterprise.deploy.spi.DeploymentManager ; 29 import org.netbeans.modules.j2ee.sun.bridge.apis.AppserverMgmtControllerBase; 30 31 import org.netbeans.modules.j2ee.sun.util.NodeTypes; 32 33 34 42 public class AppClientModuleController extends AppserverMgmtControllerBase 43 implements DeployedItemsController, EnablerController { 44 45 private AppClientModule appClientModule; 46 private AppClientModuleConfig appClientModuleConfig; 47 48 49 55 public AppClientModuleController(AppClientModule appClientModule, 56 AppserverConnectionSource connection) { 57 super(appClientModule, connection); 58 this.appClientModule = appClientModule; 59 } 60 61 62 68 public AppClientModuleController(final AppClientModule appClientModule, 69 final DeploymentManager dplmtMgr, 70 final AppserverConnectionSource connection) { 71 super(appClientModule, dplmtMgr, connection); 72 this.appClientModule = appClientModule; 73 } 74 75 public AppClientModuleController(final AppClientModule appClientModule, 76 final AppClientModuleConfig appClientModuleConfig, 77 final DeploymentManager dplmtMgr, 78 final AppserverConnectionSource connection) { 79 super(appClientModuleConfig, dplmtMgr, connection); 80 this.appClientModule = appClientModule; 81 this.appClientModuleConfig = appClientModuleConfig; 82 } 83 84 90 public java.util.Map getProperties(List propsToIgnore) { 91 return getJ2EEAndConfigProperties(NodeTypes.APP_CLIENT_MODULE, 92 this.appClientModule, this.appClientModuleConfig, propsToIgnore); 93 } 94 95 103 public javax.management.Attribute setProperty(final String attrName, final Object value) { 104 105 testIfServerInDebug(); 106 107 return ControllerUtil.setAttributeValue(appClientModule, appClientModuleConfig, attrName, value, 108 getMBeanServerConnection()); 109 } 110 111 112 117 public boolean isEnabled() { 118 testIfServerInDebug(); 119 boolean configEnabled = ((Enabled)appClientModuleConfig).getEnabled(); 120 return ControllerUtil.calculateIsEnabled(appClientModuleConfig, configEnabled); 121 } 122 123 124 129 public void setEnabled(boolean enabled) { 130 testIfServerInDebug(); 131 DeployedItemRefConfig config = ControllerUtil.getDeployedItemRefConfig(appClientModuleConfig); 132 if(config != null) 133 config.setEnabled(enabled); 134 } 135 136 } 137 | Popular Tags |