1 19 package org.netbeans.modules.j2ee.websphere6; 20 21 import java.io.*; 22 23 import javax.enterprise.deploy.spi.*; 24 import javax.enterprise.deploy.spi.factories.*; 25 import javax.enterprise.deploy.spi.exceptions.*; 26 27 import org.openide.util.NbBundle; 28 29 import org.netbeans.modules.j2ee.websphere6.util.WSDebug; 30 31 38 public class WSDeploymentFactory implements DeploymentFactory { 39 40 public static final String SERVER_ROOT_ATTR = "serverRoot"; public static final String DOMAIN_ROOT_ATTR = "domainRoot"; public static final String IS_LOCAL_ATTR = "isLocal"; public static final String HOST_ATTR = "host"; public static final String PORT_ATTR = "port"; public static final String DEBUGGER_PORT_ATTR = "debuggerPort"; public static final String SERVER_NAME_ATTR = "serverName"; public static final String CONFIG_XML_PATH = "configXmlPath"; public static final String ADMIN_PORT_ATTR = "adminPort"; 51 public static final String USERNAME_ATTR = "username"; 52 public static final String PASSWORD_ATTR = "password"; 53 public static final String DEFAULT_HOST_PORT_ATTR="defaultHostPort"; 54 55 58 private static WSDeploymentFactory instance; 59 60 65 public static synchronized DeploymentFactory create() { 66 if (instance == null) { 68 instance = new WSDeploymentFactory(); 69 } 70 71 return instance; 73 } 74 75 83 public DeploymentManager getDeploymentManager(String uri, String username, 84 String password) throws DeploymentManagerCreationException { 85 if (WSDebug.isEnabled()) WSDebug.notify("getDeploymentManager(" + uri + ", " + username + ", " + password + ")"); 89 90 return new WSDeploymentManager(uri, username, password); 92 } 93 94 99 public DeploymentManager getDisconnectedDeploymentManager(String uri) 100 throws DeploymentManagerCreationException { 101 if (WSDebug.isEnabled()) WSDebug.notify("getDisconnectedDeploymentManager(" + uri + ")"); 105 return new WSDeploymentManager(uri); 107 } 108 109 116 public boolean handlesURI(String uri) { 117 if (WSDebug.isEnabled()) WSDebug.notify("handlesURI(" + uri + ")"); 120 return uri == null ? false : (uri.indexOf(WSURIManager.WSURI)>-1); } 123 124 129 public String getProductVersion() { 130 return NbBundle.getMessage(WSDeploymentFactory.class, 131 "TXT_productVersion"); } 133 134 139 public String getDisplayName() { 140 if (WSDebug.isEnabled()) WSDebug.notify("getDisplayName()"); 143 return NbBundle.getMessage(WSDeploymentFactory.class, 144 "TXT_displayName"); } 146 } | Popular Tags |