[jboss-cvs] JBossAS SVN: r85590 - in branches/Branch_5_x: tomcat/src/main/org/jboss/web/tomcat/service and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 6 22:15:48 EST 2009


Author: scott.stark at jboss.org
Date: 2009-03-06 22:15:48 -0500 (Fri, 06 Mar 2009)
New Revision: 85590

Added:
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/BaseBean.java
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/ConnectorBean.java
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IConnector.java
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IThreadPool.java
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IWebServer.java
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/ThreadPool.java
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/WebServer.java
Modified:
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ServerManagedObjectsTestCase.java
   branches/Branch_5_x/tomcat/src/resources/jboss-beans.xml
Log:
JBAS-5529, add basic web server, connectors managed objects

Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ServerManagedObjectsTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ServerManagedObjectsTestCase.java	2009-03-07 02:38:37 UTC (rev 85589)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ServerManagedObjectsTestCase.java	2009-03-07 03:15:48 UTC (rev 85590)
@@ -21,6 +21,8 @@
  */
 package org.jboss.test.profileservice.test;
 
+import java.net.InetAddress;
+import java.net.URL;
 import java.util.Map;
 import java.util.Set;
 
@@ -31,11 +33,14 @@
 import org.jboss.managed.api.ComponentType;
 import org.jboss.managed.api.ManagedComponent;
 import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.RunState;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.metatype.api.types.EnumMetaType;
 import org.jboss.metatype.api.values.EnumValue;
 import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
 import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
 import org.jboss.profileservice.management.matchers.AliasMatcher;
 import org.jboss.profileservice.spi.ProfileService;
 import org.jboss.test.JBossTestCase;
@@ -208,6 +213,56 @@
       getLog().info(props);
    }
 
+   public void testWebConnector()
+      throws Exception
+   {
+      // Make a request
+      InetAddress address = InetAddress.getByName(getServerHost());
+      URL root = new URL("http://"+address.getHostAddress()+":8080/");
+      // Load the 
+      ManagementView mgtView = getManagementView();
+      ComponentType type = new ComponentType("MBean", "Web");
+      String name = "jboss.web:name=http-"+address.getHostAddress()+"-8080,type=GlobalRequestProcessor";
+      ManagedComponent mc = mgtView.getComponent(name, type);
+      assertNotNull(name, mc);
+      Map<String, ManagedProperty> props = mc.getProperties();
+      for(ManagedProperty mp : props.values())
+         log.info(mp.getName()+", "+mp.getValue());
+      log.info(root+" content: "+root.openConnection().getContentLength());
+      
+      // {errorCount, bytesReceived, bytesSent, state, requestProcessors, processingTime, requestCount, maxTime}
+      ManagedProperty bytesSent = mc.getProperty("bytesSent");
+      assertNotNull(bytesSent);
+      MetaValue bytesSentMV = bytesSent.getValue();
+      SimpleValue bytesSentSV = (SimpleValue) bytesSentMV;
+      assertTrue("bytesSent > 0", bytesSentSV.compareTo(SimpleValueSupport.wrap(0)) > 0);
+   }
+
+   public void testWebConnectorPool()
+      throws Exception
+   {
+      // Make a request
+      InetAddress address = InetAddress.getByName(getServerHost());
+      URL root = new URL("http://"+address.getHostAddress()+":8080/");
+      // Load the 
+      ManagementView mgtView = getManagementView();
+      ComponentType type = new ComponentType("MBean", "Web");
+      String name = "jboss.web:name=http-"+address.getHostAddress()+"-8080,type=ThreadPool";
+      ManagedComponent mc = mgtView.getComponent(name, type);
+      assertNotNull(name, mc);
+      Map<String, ManagedProperty> props = mc.getProperties();
+      for(ManagedProperty mp : props.values())
+         log.info(mp.getName()+", "+mp.getValue());
+      log.info(root+" content: "+root.openConnection().getContentLength());
+      
+      ManagedProperty currentThreadCount = mc.getProperty("currentThreadCount");
+      assertNotNull(currentThreadCount);
+      MetaValue currentThreadCountMV = currentThreadCount.getValue();
+      SimpleValue currentThreadCountSV = (SimpleValue) currentThreadCountMV;
+      assertTrue("currentThreadCount > 0", currentThreadCountSV.compareTo(SimpleValueSupport.wrap(0)) > 0);
+      assertEquals(mc.getRunState(), RunState.RUNNING);
+   }
+   
    /**
     * Obtain the ProfileService.ManagementView
     * @return

Added: branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/BaseBean.java
===================================================================
--- branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/BaseBean.java	                        (rev 0)
+++ branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/BaseBean.java	2009-03-07 03:15:48 UTC (rev 85590)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.web.tomcat.service.management;
+
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.coyote.RequestGroupInfo;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.mx.util.MBeanProxyExt;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class BaseBean
+{
+   private String domain;
+   private Properties nameProps;
+   private ObjectName mbeanName;
+   private MBeanServer server;
+   private int port;
+   private String address;
+
+   
+   public int getPort()
+   {
+      return port;
+   }
+
+   public void setPort(int port)
+   {
+      this.port = port;
+   }
+
+   public String getAddress()
+   {
+      return address;
+   }
+
+   public void setAddress(String address)
+   {
+      this.address = address;
+   }
+   public String getDomain()
+   {
+      return domain;
+   }
+   public void setDomain(String domain)
+   {
+      this.domain = domain;
+   }
+   public Properties getNameProps()
+   {
+      return nameProps;
+   }
+   public void setNameProps(Properties nameProps)
+   {
+      this.nameProps = nameProps;
+   }
+   public ObjectName getMbeanName()
+   {
+      return mbeanName;
+   }
+   public void setMbeanName(ObjectName mbeanName)
+   {
+      this.mbeanName = mbeanName;
+   }
+   @ManagementProperty()
+   @ManagementObjectID
+   public String getMbeanNameAsString()
+   {
+      return mbeanName.getCanonicalName();
+   }
+   public MBeanServer getServer()
+   {
+      return server;
+   }
+   public void setServer(MBeanServer server)
+   {
+      this.server = server;
+   }
+
+   protected <T> T initProxy(Class<T> clazz)
+   {
+      T mbeanProxy = null;
+      try
+      {
+         mbeanName = new ObjectName(domain, nameProps);
+         mbeanProxy = (T) MBeanProxyExt.create(clazz, mbeanName, server);
+      }
+      catch(Exception e)
+      {
+         throw new IllegalStateException(e);
+      }
+      return mbeanProxy;
+   }
+}

Added: branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/ConnectorBean.java
===================================================================
--- branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/ConnectorBean.java	                        (rev 0)
+++ branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/ConnectorBean.java	2009-03-07 03:15:48 UTC (rev 85590)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.web.tomcat.service.management;
+
+import org.apache.coyote.RequestInfo;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+ at ManagementObject(
+      componentType=@ManagementComponent(type = "MBean", subtype = "Web"),
+      isRuntime=true,
+      properties=ManagementProperties.EXPLICIT)
+public class ConnectorBean extends BaseBean
+{
+   private IConnector mbeanProxy;
+
+
+   @ManagementProperty(use=ViewUse.STATISTIC)
+   public long getBytesReceived()
+      throws Exception
+   {
+      initProxy();
+      return mbeanProxy.getbytesReceived();
+   }
+
+   @ManagementProperty(use=ViewUse.STATISTIC)
+   public long getBytesSent()
+   throws Exception
+   {
+      initProxy();
+      return mbeanProxy.getbytesSent();
+   }
+
+   @ManagementProperty(use=ViewUse.STATISTIC)
+   public int getErrorCount()
+   throws Exception
+   {
+      initProxy();
+      return mbeanProxy.geterrorCount();
+   }
+
+   @ManagementProperty(use=ViewUse.STATISTIC)
+   public long getMaxTime()
+   throws Exception
+   {
+      initProxy();
+      return mbeanProxy.getmaxTime();
+   }
+
+   @ManagementProperty(use=ViewUse.STATISTIC)
+   public long getProcessingTime()
+   throws Exception
+   {
+      initProxy();
+      return mbeanProxy.getprocessingTime();
+   }
+
+   @ManagementProperty(use=ViewUse.STATISTIC)
+   public int getRequestCount()
+   throws Exception
+   {
+      initProxy();
+      return mbeanProxy.getrequestCount();
+   }
+
+   @ManagementProperty(use=ViewUse.STATISTIC)
+   public RequestInfo[] getRequestProcessors()
+   throws Exception
+   {
+      initProxy();
+      return mbeanProxy.getrequestProcessors();
+   }
+
+   @ManagementOperation()
+   public void resetCounters()
+   throws Exception
+   {
+      initProxy();
+      mbeanProxy.resetCounters();
+   }
+
+   
+   protected void initProxy()
+   {
+      if(mbeanProxy == null)
+      {
+         // Set the name property
+         String name = "http-" + getAddress() +"-"+getPort();
+         super.getNameProps().put("name", name);
+         mbeanProxy = super.initProxy(IConnector.class);
+      }
+   }
+   
+}

Added: branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IConnector.java
===================================================================
--- branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IConnector.java	                        (rev 0)
+++ branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IConnector.java	2009-03-07 03:15:48 UTC (rev 85590)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.web.tomcat.service.management;
+
+import org.apache.coyote.RequestInfo;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface IConnector
+{
+  public RequestInfo[] getrequestProcessors();
+  public long getmaxTime();
+  public long getprocessingTime();
+  public int getrequestCount();
+  public int geterrorCount();
+
+  public long getbytesReceived();
+  public long getbytesSent();
+
+  public void resetCounters();
+}

Added: branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IThreadPool.java
===================================================================
--- branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IThreadPool.java	                        (rev 0)
+++ branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IThreadPool.java	2009-03-07 03:15:48 UTC (rev 85590)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.web.tomcat.service.management;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface IThreadPool
+{
+   public int getmaxThreads();
+   public int getcurrentThreadCount();
+   public int getcurrentThreadsBusy();
+   public int getthreadPriority();
+}

Added: branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IWebServer.java
===================================================================
--- branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IWebServer.java	                        (rev 0)
+++ branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/IWebServer.java	2009-03-07 03:15:48 UTC (rev 85590)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.web.tomcat.service.management;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface IWebServer
+{
+   public String[] getFilteredPackages();
+   public String getDefaultSecurityDomain();
+   public String getSessionIdAlphabet();
+   public String getContextMBeanCode();
+}

Added: branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/ThreadPool.java
===================================================================
--- branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/ThreadPool.java	                        (rev 0)
+++ branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/ThreadPool.java	2009-03-07 03:15:48 UTC (rev 85590)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.web.tomcat.service.management;
+
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+ at ManagementObject(
+      componentType=@ManagementComponent(type = "MBean", subtype = "Web"),
+      isRuntime=true,
+      properties=ManagementProperties.EXPLICIT)
+public class ThreadPool extends BaseBean
+{
+   IThreadPool mbeanProxy;
+
+   @ManagementProperty
+   public int getCurrentThreadCount()
+   {
+      initProxy();
+      return mbeanProxy.getcurrentThreadCount();
+   }
+
+   @ManagementProperty
+   public int getCurrentThreadsBusy()
+   {
+      initProxy();
+      return mbeanProxy.getcurrentThreadsBusy();
+   }
+
+   @ManagementProperty
+   public int getMaxThreads()
+   {
+      initProxy();
+      return mbeanProxy.getmaxThreads();
+   }
+
+   @ManagementProperty
+   public int getThreadPriority()
+   {
+      initProxy();
+      return mbeanProxy.getthreadPriority();
+   }
+
+   protected void initProxy()
+   {
+      if(mbeanProxy == null)
+      {
+         // Set the name property
+         String name = "http-" + getAddress() +"-"+getPort();
+         super.getNameProps().put("name", name);
+         mbeanProxy = super.initProxy(IThreadPool.class);
+      }
+   }
+}

Added: branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/WebServer.java
===================================================================
--- branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/WebServer.java	                        (rev 0)
+++ branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/management/WebServer.java	2009-03-07 03:15:48 UTC (rev 85590)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.web.tomcat.service.management;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class WebServer extends BaseBean
+{
+   IWebServer mbeanProxy;
+
+   public String getContextMBeanCode()
+   {
+      initProxy();
+      return mbeanProxy.getContextMBeanCode();
+   }
+
+   public String getDefaultSecurityDomain()
+   {
+      initProxy();
+      return mbeanProxy.getDefaultSecurityDomain();
+   }
+
+   public String[] getFilteredPackages()
+   {
+      initProxy();
+      return mbeanProxy.getFilteredPackages();
+   }
+
+   public String getSessionIdAlphabet()
+   {
+      initProxy();
+      return mbeanProxy.getSessionIdAlphabet();
+   }
+
+   protected void initProxy()
+   {
+      if(mbeanProxy == null)
+      {
+         mbeanProxy = super.initProxy(IWebServer.class);
+      }
+   }
+}

Modified: branches/Branch_5_x/tomcat/src/resources/jboss-beans.xml
===================================================================
--- branches/Branch_5_x/tomcat/src/resources/jboss-beans.xml	2009-03-07 02:38:37 UTC (rev 85589)
+++ branches/Branch_5_x/tomcat/src/resources/jboss-beans.xml	2009-03-07 03:15:48 UTC (rev 85590)
@@ -27,4 +27,57 @@
 
    </bean>
 
+   <bean name="WebServer"
+      class="org.jboss.web.tomcat.service.management.WebServer">
+      <property name="domain">jboss.web</property>
+      <property name="nameProps">
+         <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>service</key>
+               <value>WebServer</value>
+            </entry>
+         </map>
+      </property>
+   </bean>
+
+   <bean name="ConnectorBean-http-${jboss.bind.address}-8080"
+      class="org.jboss.web.tomcat.service.management.ConnectorBean">
+      <property name="domain">jboss.web</property>
+      <property name="nameProps">
+         <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>type</key>
+               <value>GlobalRequestProcessor</value>
+            </entry>
+         </map>
+      </property>
+      <property name="port">
+         <value-factory bean="ServiceBindingManager"
+            method="getIntBinding" >
+            <parameter>jboss.web:service=WebServer</parameter>
+         </value-factory>
+      </property>
+      <property name="address">${jboss.bind.address}</property>
+      <property name="server"><inject bean="JMXKernel" property="mbeanServer"/></property>
+   </bean>
+   <bean name="ThreadPool-http-${jboss.bind.address}-8080"
+      class="org.jboss.web.tomcat.service.management.ThreadPool">
+      <property name="domain">jboss.web</property>
+      <property name="nameProps">
+         <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>type</key>
+               <value>ThreadPool</value>
+            </entry>
+         </map>
+      </property>
+      <property name="port">
+         <value-factory bean="ServiceBindingManager"
+            method="getIntBinding" >
+            <parameter>jboss.web:service=WebServer</parameter>
+         </value-factory>
+      </property>
+      <property name="address">${jboss.bind.address}</property>
+      <property name="server"><inject bean="JMXKernel" property="mbeanServer"/></property>
+   </bean>
 </deployment>




More information about the jboss-cvs-commits mailing list