Author: thomas.diesler(a)jboss.com
Date: 2007-05-09 08:50:02 -0400 (Wed, 09 May 2007)
New Revision: 3017
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfig.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfigMBean.java
Log:
Add ManagedServerConfig
Added: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfig.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfig.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfig.java 2007-05-09
12:50:02 UTC (rev 3017)
@@ -0,0 +1,76 @@
+/*
+ * 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.ws.core.server;
+
+// $Id$
+
+import java.util.ArrayList;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.management.BasicServerConfig;
+
+/**
+ * A Service Endpoint Registry
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-May-2007
+ */
+public class ManagedServerConfig extends BasicServerConfig implements
ManagedServerConfigMBean
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ManagedServerConfig.class);
+
+ public void create() throws Exception
+ {
+ log.debug("WebServiceHost: " + getWebServiceHost());
+ log.debug("WebServicePort: " + getWebServicePort());
+ log.debug("WebServiceSecurePort: " + getWebServiceSecurePort());
+ MBeanServer server = getMBeanServer();
+ if (server != null)
+ {
+ server.registerMBean(this, OBJECT_NAME);
+ }
+ }
+
+ public void destroy() throws Exception
+ {
+ MBeanServer server = getMBeanServer();
+ if (server != null)
+ {
+ server.unregisterMBean(OBJECT_NAME);
+ }
+ }
+
+ private MBeanServer getMBeanServer()
+ {
+ MBeanServer server = null;
+ ArrayList servers = MBeanServerFactory.findMBeanServer(null);
+ if (servers.size() > 0)
+ {
+ server = (MBeanServer)servers.get(0);
+ }
+ return server;
+ }
+}
Property changes on:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfigMBean.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfigMBean.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfigMBean.java 2007-05-09
12:50:02 UTC (rev 3017)
@@ -0,0 +1,37 @@
+/*
+ * 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.ws.core.server;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.integration.ObjectNameFactory;
+import org.jboss.ws.integration.management.ServerConfig;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ManagedServerConfigMBean extends ServerConfig
+{
+ // default object name
+ static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+}
Property changes on:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ManagedServerConfigMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF