Author: thomas.diesler(a)jboss.com
Date: 2007-08-03 04:30:50 -0400 (Fri, 03 Aug 2007)
New Revision: 4136
Added:
common/trunk/src/main/java/org/jboss/wsf/common/management/
common/trunk/src/main/java/org/jboss/wsf/common/management/DefaultServerConfig.java
common/trunk/src/main/java/org/jboss/wsf/common/management/DefaultServerConfigMBean.java
Removed:
framework/trunk/ant-import/macros-deploy-wsf.xml
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java
Modified:
common/trunk/.classpath
common/trunk/ant-import/build-thirdparty.xml
common/trunk/version.properties
framework/trunk/.classpath
Log:
Remove dependency on jbossws-framework.jar
Modified: common/trunk/.classpath
===================================================================
--- common/trunk/.classpath 2007-08-03 08:30:19 UTC (rev 4135)
+++ common/trunk/.classpath 2007-08-03 08:30:50 UTC (rev 4136)
@@ -7,7 +7,6 @@
<classpathentry kind="lib" path="thirdparty/jaxb-api.jar"/>
<classpathentry kind="lib" path="thirdparty/jaxrpc-api.jar"/>
<classpathentry kind="lib" path="thirdparty/jaxws-api.jar"/>
- <classpathentry kind="lib"
path="thirdparty/jboss-logging-log4j.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-logging-spi.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-microcontainer.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-common-core.jar"/>
Modified: common/trunk/ant-import/build-thirdparty.xml
===================================================================
--- common/trunk/ant-import/build-thirdparty.xml 2007-08-03 08:30:19 UTC (rev 4135)
+++ common/trunk/ant-import/build-thirdparty.xml 2007-08-03 08:30:50 UTC (rev 4136)
@@ -41,13 +41,12 @@
<get src="${jboss.repository}/junit/${junit}/lib/junit.jar"
dest="${thirdparty.dir}/junit.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/common-core/${jboss-common-core}/lib/jboss-common-core.jar"
dest="${thirdparty.dir}/jboss-common-core.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/common-core/${jboss-common-core}/lib/jboss-common-core-sources.jar"
dest="${thirdparty.dir}/jboss-common-core-sources.jar"
usetimestamp="true" verbose="true"/>
- <get
src="${jboss.repository}/jboss/common-logging-log4j/${jboss-common-logging-log4j}/lib/jboss-logging-log4j.jar"
dest="${thirdparty.dir}/jboss-logging-log4j.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/common-logging-spi/${jboss-common-logging-spi}/lib/jboss-logging-spi.jar"
dest="${thirdparty.dir}/jboss-logging-spi.jar" usetimestamp="true"
verbose="true"/>
+ <get
src="${jboss.repository}/jboss/jbossws-spi/${jbossws-spi}/lib/jbossws-spi.jar"
dest="${thirdparty.dir}/jbossws-spi.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-dependency.jar"
dest="${thirdparty.dir}/jboss-dependency.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-dependency-src.zip"
dest="${thirdparty.dir}/jboss-dependency-src.zip" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-microcontainer.jar"
dest="${thirdparty.dir}/jboss-microcontainer.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-microcontainer-src.zip"
dest="${thirdparty.dir}/jboss-microcontainer-src.zip"
usetimestamp="true" verbose="true"/>
- <get
src="${jboss.repository}/jboss/jbossws-spi/${jbossws-spi}/lib/jbossws-spi.jar"
dest="${thirdparty.dir}/jbossws-spi.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/sun-jaf/${sun-jaf}/lib/activation.jar"
dest="${thirdparty.dir}/activation.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/sun-jaxb/${sun-jaxb}/lib/jaxb-api.jar"
dest="${thirdparty.dir}/jaxb-api.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-api.jar"
dest="${thirdparty.dir}/jaxws-api.jar" usetimestamp="true"
verbose="true"/>
Copied:
common/trunk/src/main/java/org/jboss/wsf/common/management/DefaultServerConfig.java (from
rev 4128,
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java)
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/management/DefaultServerConfig.java
(rev 0)
+++
common/trunk/src/main/java/org/jboss/wsf/common/management/DefaultServerConfig.java 2007-08-03
08:30:50 UTC (rev 4136)
@@ -0,0 +1,226 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.common.management;
+
+//$Id$
+
+import java.io.File;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Set;
+
+import javax.management.AttributeNotFoundException;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+
+/**
+ * Basic implementation of a ServerConfig
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author darran.lofthouse(a)jboss.com
+ * @since 08-May-2006
+ */
+public class DefaultServerConfig implements DefaultServerConfigMBean, ServerConfig
+{
+ private static final Logger log = Logger.getLogger(DefaultServerConfig.class);
+
+ // The MBeanServer
+ private MBeanServer mbeanServer;
+ // The webservice host name that will be used when updating the wsdl
+ private String webServiceHost = UNDEFINED_HOSTNAME;
+ // The webservice port that will be used when updating the wsdl
+ private int webServicePort;
+ // The webservice port that will be used when updating the wsdl
+ private int webServiceSecurePort;
+ // Whether we should always modify the soap address to the deployed endpoing location
+ private boolean modifySOAPAddress;
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ public String getWebServiceHost()
+ {
+ return webServiceHost;
+ }
+
+ public void setWebServiceHost(String host) throws UnknownHostException
+ {
+ if (host == null || host.trim().length() == 0)
+ {
+ log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
+ host = UNDEFINED_HOSTNAME;
+ }
+ if ("0.0.0.0".equals(host))
+ {
+ InetAddress localHost = InetAddress.getLocalHost();
+ log.debug("Using local host: " + localHost.getHostName());
+ host = localHost.getHostName();
+ }
+ this.webServiceHost = host;
+ }
+
+ public void setWebServicePort(int port)
+ {
+ this.webServicePort = port;
+ }
+
+ public void setWebServiceSecurePort(int port)
+ {
+ this.webServiceSecurePort = port;
+ }
+
+ public boolean isModifySOAPAddress()
+ {
+ return modifySOAPAddress;
+ }
+
+ public void setModifySOAPAddress(boolean modify)
+ {
+ this.modifySOAPAddress = modify;
+ }
+
+ public File getServerTempDir()
+ {
+ try
+ {
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)getMbeanServer().getAttribute(oname,
"ServerTempDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getServerDataDir()
+ {
+ try
+ {
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File tmpdir = (File)getMbeanServer().getAttribute(oname,
"ServerDataDir");
+ return tmpdir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public int getWebServicePort()
+ {
+ if (webServicePort <= 0)
+ webServicePort = getConnectorPort("HTTP/1.1", false);
+
+ int localPort = webServicePort;
+ if (localPort <= 0)
+ {
+ // Do not initialize webServicePort with the default, the connector port may
become available later
+ log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
+ localPort = 8080;
+ }
+
+ return localPort;
+ }
+
+ public int getWebServiceSecurePort()
+ {
+ if (webServiceSecurePort <= 0)
+ webServiceSecurePort = getConnectorPort("HTTP/1.1", true);
+
+ int localPort = webServiceSecurePort;
+ if (localPort <= 0)
+ {
+ // Do not initialize webServiceSecurePort with the default, the connector port
may become available later
+ log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
+ localPort = 8443;
+ }
+
+ return localPort;
+ }
+
+ public void create() throws Exception
+ {
+ getMbeanServer().registerMBean(this, DefaultServerConfigMBean.OBJECT_NAME);
+ }
+
+ public void destroy() throws Exception
+ {
+ getMbeanServer().unregisterMBean(DefaultServerConfigMBean.OBJECT_NAME);
+ }
+
+ private int getConnectorPort(final String protocol, final boolean secure)
+ {
+ int port = -1;
+
+ try
+ {
+ ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
+
+ Set connectorNames = getMbeanServer().queryNames(connectors, null);
+ for (Object current : connectorNames)
+ {
+ ObjectName currentName = (ObjectName)current;
+
+ try
+ {
+ int connectorPort = (Integer)getMbeanServer().getAttribute(currentName,
"port");
+ boolean connectorSecure =
(Boolean)getMbeanServer().getAttribute(currentName, "secure");
+ String connectorProtocol =
(String)getMbeanServer().getAttribute(currentName, "protocol");
+
+ if (protocol.equals(connectorProtocol) && secure ==
connectorSecure)
+ {
+ if (port > -1)
+ {
+ log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
+ }
+ else
+ {
+ port = connectorPort;
+ }
+ }
+ }
+ catch (AttributeNotFoundException ignored)
+ {
+ }
+ }
+
+ return port;
+ }
+ catch (JMException e)
+ {
+ return -1;
+ }
+ }
+}
Copied:
common/trunk/src/main/java/org/jboss/wsf/common/management/DefaultServerConfigMBean.java
(from rev 4128,
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java)
===================================================================
---
common/trunk/src/main/java/org/jboss/wsf/common/management/DefaultServerConfigMBean.java
(rev 0)
+++
common/trunk/src/main/java/org/jboss/wsf/common/management/DefaultServerConfigMBean.java 2007-08-03
08:30:50 UTC (rev 4136)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.common.management;
+
+import javax.management.ObjectName;
+
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+
+public interface DefaultServerConfigMBean extends ServerConfig
+{
+ /** The object name in the MBean server */
+ ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+}
Modified: common/trunk/version.properties
===================================================================
--- common/trunk/version.properties 2007-08-03 08:30:19 UTC (rev 4135)
+++ common/trunk/version.properties 2007-08-03 08:30:50 UTC (rev 4136)
@@ -14,12 +14,11 @@
implementation.vendor.id=http://www.jboss.org
# Thirdparty library versions
+jbossws-spi=2.0.1.CR1
+
jboss-common-core=2.0.2.GA
-jboss-common-logging-log4j=2.0.2.GA
jboss-common-logging-spi=2.0.2.GA
jboss-microcontainer=2.0.0.Beta3
-jbossws-common=2.0.1.CR1
-jbossws-spi=2.0.1.CR1
sun-jaf=1.1
sun-jaxb=2.1.4
sun-jaxrpc=1.1
Modified: framework/trunk/.classpath
===================================================================
--- framework/trunk/.classpath 2007-08-03 08:30:19 UTC (rev 4135)
+++ framework/trunk/.classpath 2007-08-03 08:30:50 UTC (rev 4136)
@@ -4,25 +4,14 @@
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>
<classpathentry kind="lib"
path="thirdparty/jboss-common-core.jar"/>
- <classpathentry kind="lib"
path="thirdparty/jboss-container.jar"/>
- <classpathentry kind="lib"
path="thirdparty/jboss-dependency.jar"/>
- <classpathentry kind="lib" path="thirdparty/jboss-deployers.jar"
sourcepath="thirdparty/jboss-deployers-src.zip"/>
- <classpathentry kind="lib"
path="thirdparty/jboss-logging-log4j.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-logging-spi.jar"/>
- <classpathentry kind="lib"
path="thirdparty/jboss-microcontainer.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-xml-binding.jar"/>
<classpathentry kind="lib" path="thirdparty/jaxws-api.jar"/>
<classpathentry kind="lib" path="thirdparty/jsr181-api.jar"/>
- <classpathentry kind="lib"
path="thirdparty/servlet-api.jar"/>
- <classpathentry kind="lib" path="thirdparty/junit.jar"/>
- <classpathentry kind="lib" path="thirdparty/activation.jar"/>
<classpathentry kind="lib"
path="thirdparty/jboss-javaee.jar"/>
<classpathentry kind="lib" path="thirdparty/jaxrpc-api.jar"/>
<classpathentry kind="lib" path="thirdparty/dom4j.jar"/>
- <classpathentry kind="lib" path="thirdparty/ant.jar"/>
- <classpathentry kind="lib" path="thirdparty/getopt.jar"/>
<classpathentry kind="lib" path="thirdparty/saaj-api.jar"/>
- <classpathentry kind="lib" path="thirdparty/jaxb-api.jar"/>
<classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry combineaccessrules="false" kind="src"
path="/common"/>
<classpathentry kind="output" path="output/eclipse"/>
Deleted: framework/trunk/ant-import/macros-deploy-wsf.xml
===================================================================
--- framework/trunk/ant-import/macros-deploy-wsf.xml 2007-08-03 08:30:19 UTC (rev 4135)
+++ framework/trunk/ant-import/macros-deploy-wsf.xml 2007-08-03 08:30:50 UTC (rev 4136)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at
http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
-
-<!-- $Id: macros-deploy-spi.xml 3620 2007-06-18 20:39:56Z heiko.braun(a)jboss.com $
-->
-
-<project>
-
- <macrodef name="macro-deploy-wsf">
- <attribute name="wsflibs"/>
- <attribute name="thirdpartylibs"/>
- <attribute name="jbosshome"/>
- <sequential>
-
- <!-- BIN SCRIPTS -->
- <unzip dest="@{jbosshome}/bin"
src="(a){wsflibs}/jbossws-framework-scripts.zip"/>
- <chmod dir="@{jbosshome}/bin" perm="+x"
includes="*.sh"/>
-
- <!-- CLIENT JARS-->
- <copy todir="@{jbosshome}/client">
- <fileset dir="@{wsflibs}">
- <include name="jbossws-framework.jar"/>
- </fileset>
- <fileset dir="@{thirdpartylibs}">
- <include name="jbossws-common.jar"/>
- <include name="jbossws-spi.jar"/>
- <include name="wsdl4j.jar"/>
- </fileset>
- </copy>
-
- <!-- SERVER JARS-->
- <copy todir="(a){jbosshome}/server/${jboss.server.instance}/lib">
- <fileset dir="@{wsflibs}">
- <include name="jbossws-framework.jar"/>
- </fileset>
- <fileset dir="@{thirdpartylibs}">
- <include name="jbossws-common.jar"/>
- <include name="jbossws-spi.jar"/>
- </fileset>
- </copy>
- </sequential>
- </macrodef>
-
- <macrodef name="macro-undeploy-wsf">
- <attribute name="jbosshome"/>
- <sequential>
- <delete>
- <!-- BIN SCRIPTS -->
- <fileset dir="@{jbosshome}/bin">
- <include name="wsconsume.*"/>
- <include name="wsprovide.*"/>
- </fileset>
-
- <!-- CLIENT JARS-->
- <fileset dir="@{jbosshome}/client">
- <include name="jbossws-common.jar"/>
- <include name="jbossws-framework.jar"/>
- <include name="jbossws-spi.jar"/>
- <include name="wsdl4j.jar"/>
- </fileset>
-
- <!-- SERVER JARS-->
- <fileset dir="(a){jbosshome}/server/${jboss.server.instance}/lib">
- <include name="jbossws-common.jar"/>
- <include name="jbossws-framework.jar"/>
- <include name="jbossws-spi.jar"/>
- </fileset>
- </delete>
- </sequential>
- </macrodef>
-
-</project>
\ No newline at end of file
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java 2007-08-03
08:30:19 UTC (rev 4135)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java 2007-08-03
08:30:50 UTC (rev 4136)
@@ -1,226 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.framework.management;
-
-//$Id$
-
-import java.io.File;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Set;
-
-import javax.management.AttributeNotFoundException;
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.common.ObjectNameFactory;
-import org.jboss.wsf.spi.management.ServerConfig;
-
-/**
- * Basic implementation of a ServerConfig
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author darran.lofthouse(a)jboss.com
- * @since 08-May-2006
- */
-public class DefaultServerConfig implements DefaultServerConfigMBean, ServerConfig
-{
- private static final Logger log = Logger.getLogger(DefaultServerConfig.class);
-
- // The MBeanServer
- private MBeanServer mbeanServer;
- // The webservice host name that will be used when updating the wsdl
- private String webServiceHost = UNDEFINED_HOSTNAME;
- // The webservice port that will be used when updating the wsdl
- private int webServicePort;
- // The webservice port that will be used when updating the wsdl
- private int webServiceSecurePort;
- // Whether we should always modify the soap address to the deployed endpoing location
- private boolean modifySOAPAddress;
-
- public MBeanServer getMbeanServer()
- {
- return mbeanServer;
- }
-
- public void setMbeanServer(MBeanServer mbeanServer)
- {
- this.mbeanServer = mbeanServer;
- }
-
- public String getWebServiceHost()
- {
- return webServiceHost;
- }
-
- public void setWebServiceHost(String host) throws UnknownHostException
- {
- if (host == null || host.trim().length() == 0)
- {
- log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
- host = UNDEFINED_HOSTNAME;
- }
- if ("0.0.0.0".equals(host))
- {
- InetAddress localHost = InetAddress.getLocalHost();
- log.debug("Using local host: " + localHost.getHostName());
- host = localHost.getHostName();
- }
- this.webServiceHost = host;
- }
-
- public void setWebServicePort(int port)
- {
- this.webServicePort = port;
- }
-
- public void setWebServiceSecurePort(int port)
- {
- this.webServiceSecurePort = port;
- }
-
- public boolean isModifySOAPAddress()
- {
- return modifySOAPAddress;
- }
-
- public void setModifySOAPAddress(boolean modify)
- {
- this.modifySOAPAddress = modify;
- }
-
- public File getServerTempDir()
- {
- try
- {
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)getMbeanServer().getAttribute(oname,
"ServerTempDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getServerDataDir()
- {
- try
- {
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File tmpdir = (File)getMbeanServer().getAttribute(oname,
"ServerDataDir");
- return tmpdir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public int getWebServicePort()
- {
- if (webServicePort <= 0)
- webServicePort = getConnectorPort("HTTP/1.1", false);
-
- int localPort = webServicePort;
- if (localPort <= 0)
- {
- // Do not initialize webServicePort with the default, the connector port may
become available later
- log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
- localPort = 8080;
- }
-
- return localPort;
- }
-
- public int getWebServiceSecurePort()
- {
- if (webServiceSecurePort <= 0)
- webServiceSecurePort = getConnectorPort("HTTP/1.1", true);
-
- int localPort = webServiceSecurePort;
- if (localPort <= 0)
- {
- // Do not initialize webServiceSecurePort with the default, the connector port
may become available later
- log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
- localPort = 8443;
- }
-
- return localPort;
- }
-
- public void create() throws Exception
- {
- getMbeanServer().registerMBean(this, DefaultServerConfigMBean.OBJECT_NAME);
- }
-
- public void destroy() throws Exception
- {
- getMbeanServer().unregisterMBean(DefaultServerConfigMBean.OBJECT_NAME);
- }
-
- private int getConnectorPort(final String protocol, final boolean secure)
- {
- int port = -1;
-
- try
- {
- ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
-
- Set connectorNames = getMbeanServer().queryNames(connectors, null);
- for (Object current : connectorNames)
- {
- ObjectName currentName = (ObjectName)current;
-
- try
- {
- int connectorPort = (Integer)getMbeanServer().getAttribute(currentName,
"port");
- boolean connectorSecure =
(Boolean)getMbeanServer().getAttribute(currentName, "secure");
- String connectorProtocol =
(String)getMbeanServer().getAttribute(currentName, "protocol");
-
- if (protocol.equals(connectorProtocol) && secure ==
connectorSecure)
- {
- if (port > -1)
- {
- log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
- }
- else
- {
- port = connectorPort;
- }
- }
- }
- catch (AttributeNotFoundException ignored)
- {
- }
- }
-
- return port;
- }
- catch (JMException e)
- {
- return -1;
- }
- }
-}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java 2007-08-03
08:30:19 UTC (rev 4135)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java 2007-08-03
08:30:50 UTC (rev 4136)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.framework.management;
-
-import javax.management.ObjectName;
-
-import org.jboss.wsf.common.ObjectNameFactory;
-import org.jboss.wsf.spi.management.ServerConfig;
-
-public interface DefaultServerConfigMBean extends ServerConfig
-{
- /** The object name in the MBean server */
- ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServerConfig");
-}