Index: packager/nucleus-base/lib/templates/domain.xml =================================================================== --- packager/nucleus-base/lib/templates/domain.xml (revision 33412) +++ packager/nucleus-base/lib/templates/domain.xml (working copy) @@ -144,7 +144,7 @@ - -Dosgi.shell.telnet.port=6666 + -Dosgi.shell.telnet.port=%%%OSGI_SHELL_TELNET_PORT%%% -Dosgi.shell.telnet.maxconn=1 Index: admin/cli-optional/src/main/java/com/sun/enterprise/admin/cli/optional/CreateDomainCommand.java =================================================================== --- admin/cli-optional/src/main/java/com/sun/enterprise/admin/cli/optional/CreateDomainCommand.java (revision 33412) +++ admin/cli-optional/src/main/java/com/sun/enterprise/admin/cli/optional/CreateDomainCommand.java (working copy) @@ -98,6 +98,7 @@ private static final String DEFAULT_JMS_PASSWORD = "admin"; private static final int DEFAULT_IIOP_PORT = 3700; private static final int DEFAULT_JMX_PORT = 8686; + private static final int DEFAULT_OSGI_SHELL_TELNET_PORT = 6666; private static final int PORT_MAX_VAL = 65535; private static final int PORTBASE_ADMINPORT_SUFFIX = 48; private static final int PORTBASE_HTTPSSL_SUFFIX = 81; @@ -107,6 +108,7 @@ private static final int PORTBASE_JMS_SUFFIX = 76; private static final int PORTBASE_IIOP_SUFFIX = 37; private static final int PORTBASE_JMX_SUFFIX = 86; + private static final int PORTBASE_OSGI_SHELL_SUFFIX = 66; private static final char ESCAPE_CHAR = '\\'; private static final char EQUAL_SIGN = '='; @@ -287,6 +289,14 @@ sb.append(DomainConfig.K_JMX_PORT); sb.append("="); sb.append(String.valueOf(portbase + PORTBASE_JMX_SUFFIX)); + sb.append(":"); + + verifyPortBasePortIsValid(DomainConfig.K_OSGI_SHELL_TELNET_PORT, + portbase + PORTBASE_OSGI_SHELL_SUFFIX); + sb.append(DomainConfig.K_OSGI_SHELL_TELNET_PORT); + sb.append("="); + sb.append(String.valueOf(portbase + PORTBASE_OSGI_SHELL_SUFFIX)); + options.put(DOMAIN_PROPERTIES, sb.toString()); } @@ -577,6 +587,11 @@ Integer.toString(DEFAULT_JMX_PORT), "JMX_ADMIN"); + final Integer osgiShellTelnetPort = getPort(domainProperties, + DomainConfig.K_OSGI_SHELL_TELNET_PORT, null, + Integer.toString(DEFAULT_OSGI_SHELL_TELNET_PORT), + "OSGI_SHELL"); + boolean saveMasterPassword = getSaveMasterPassword(masterPassword); checkPortPrivilege(new Integer[]{ @@ -592,7 +607,7 @@ saveMasterPassword, instancePort, jmsUser, jmsPassword, jmsPort, orbPort, httpSSLPort, iiopSSLPort, - iiopMutualAuthPort, jmxPort, + iiopMutualAuthPort, jmxPort, osgiShellTelnetPort, domainProperties); if (getOption(TEMPLATE) != null) { domainConfig.put(DomainConfig.K_TEMPLATE_NAME, getOption(TEMPLATE)); Index: admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/pe/PEDomainXmlTokens.java =================================================================== --- admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/pe/PEDomainXmlTokens.java (revision 33412) +++ admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/pe/PEDomainXmlTokens.java (working copy) @@ -36,10 +36,7 @@ package com.sun.enterprise.admin.servermgmt.pe; -import java.io.File; -import com.sun.enterprise.util.OS; -import com.sun.enterprise.util.io.FileUtils; import com.sun.enterprise.admin.util.TokenValue; import com.sun.enterprise.admin.util.TokenValueSet; import com.sun.enterprise.admin.servermgmt.DomainConfig; @@ -72,6 +69,8 @@ public static final String ORB_MUTUALAUTH_PORT_TOKEN_NAME= "ORB_MUTUALAUTH_PORT"; + public static final String OSGI_SHELL_TELNET_PORT_TOKEN_NAME = "OSGI_SHELL_TELNET_PORT"; + //This token is used for SE/EE only now, but it is likely that we will want to expose it //in PE (i.e. to access the exposed Mbeans). Remember that the http jmx port (used by //asadmin) will not be exposed pubically. @@ -152,8 +151,12 @@ tv = new TokenValue(DOMAIN_NAME_TOKEN_NAME, domainConfig.getRepositoryName()); tokens.add(tv); - + final Integer osgiShellTelnetPort = + (Integer)domainConfig.get(DomainConfig.K_OSGI_SHELL_TELNET_PORT); + tv = new TokenValue(OSGI_SHELL_TELNET_PORT_TOKEN_NAME, osgiShellTelnetPort.toString()); + tokens.add(tv); + return ( tokens ); } } Index: admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/DomainConfig.java =================================================================== --- admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/DomainConfig.java (revision 33412) +++ admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/DomainConfig.java (working copy) @@ -40,8 +40,6 @@ import java.util.Properties; import java.util.Iterator; -import java.util.HashSet; -import java.util.Set; import java.util.Map; import com.sun.enterprise.universal.glassfish.ASenvPropertyReader; @@ -78,7 +76,9 @@ public static final String K_TEMPLATE_NAME = "template.name"; public static final String K_HTTP_SSL_PORT = "http.ssl.port"; public static final String K_IIOP_SSL_PORT = "orb.ssl.port"; - public static final String K_IIOP_MUTUALAUTH_PORT = "orb.mutualauth.port"; + public static final String K_IIOP_MUTUALAUTH_PORT = "orb.mutualauth.port"; + public static final String K_OSGI_SHELL_TELNET_PORT = "osgi.shell.telnet.port"; + public static final String K_DEBUG = "domain.debug"; public static final String K_VERBOSE = "domain.verbose"; public static final String K_VALIDATE_PORTS = "domain.validatePorts"; @@ -118,7 +118,7 @@ String jmsUser, String jmsPassword, Integer jmsPort, Integer orbPort, Integer httpSSLPort, Integer iiopSSLPort, Integer iiopMutualAuthPort, - Integer jmxAdminPort, + Integer jmxAdminPort, Integer osgiShellTelnetPort, Properties domainProperties) throws DomainException { this(domainName, domainRoot); @@ -137,6 +137,7 @@ put(K_IIOP_SSL_PORT, iiopSSLPort); put(K_IIOP_MUTUALAUTH_PORT, iiopMutualAuthPort); put(K_JMX_PORT, jmxAdminPort); + put(K_OSGI_SHELL_TELNET_PORT, osgiShellTelnetPort); if(domainProperties!=null) { Iterator iterator = domainProperties.keySet().iterator(); Index: admin/server-mgmt/src/main/resources/lib/templates/domain.xml =================================================================== --- admin/server-mgmt/src/main/resources/lib/templates/domain.xml (revision 33412) +++ admin/server-mgmt/src/main/resources/lib/templates/domain.xml (working copy) @@ -154,7 +154,7 @@ - -Dosgi.shell.telnet.port=6666 + -Dosgi.shell.telnet.port=%%%OSGI_SHELL_TELNET_PORT%%% -Dosgi.shell.telnet.maxconn=1