You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by am...@apache.org on 2001/11/09 03:19:07 UTC
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans StandardServerMBean.java StandardEngineMBean.java StandardServiceMBean.java mbeans-descriptors.xml
amyroh 01/11/08 18:19:07
Modified: catalina/src/share/org/apache/catalina/mbeans
StandardEngineMBean.java StandardServiceMBean.java
mbeans-descriptors.xml
Added: catalina/src/share/org/apache/catalina/mbeans
StandardServerMBean.java
Log:
Added additional operations for mbeans (createObject).
Revision Changes Path
1.2 +73 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java
Index: StandardEngineMBean.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StandardEngineMBean.java 2001/11/02 20:34:47 1.1
+++ StandardEngineMBean.java 2001/11/09 02:19:07 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java,v 1.1 2001/11/02 20:34:47 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2001/11/02 20:34:47 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java,v 1.2 2001/11/09 02:19:07 amyroh Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/11/09 02:19:07 $
*
* ====================================================================
*
@@ -67,7 +67,14 @@
import javax.management.MBeanException;
import javax.management.RuntimeOperationsException;
import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
import org.apache.catalina.Service;
+import org.apache.catalina.Valve;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.valves.AccessLogValve;
+import org.apache.catalina.valves.RemoteAddrValve;
+import org.apache.catalina.valves.RemoteHostValve;
+import org.apache.catalina.valves.RequestDumperValve;
import org.apache.commons.modeler.BaseModelMBean;
@@ -76,7 +83,7 @@
* <code>org.apache.catalina.core.StandardEngine</code> component.</p>
*
* @author Craig R. McClanahan
- * @version $Revision: 1.1 $ $Date: 2001/11/02 20:34:47 $
+ * @version $Revision: 1.2 $ $Date: 2001/11/09 02:19:07 $
*/
public class StandardEngineMBean extends BaseModelMBean {
@@ -119,6 +126,68 @@
// ------------------------------------------------------------- Operations
+
+
+ /**
+ * Create a new AccessLogger.
+ */
+ public AccessLogValve createAccessLogger(int debug, String directory,
+ String pattern, String prefix, boolean resolveHosts, String suffix) {
+
+ AccessLogValve accessLogger = new AccessLogValve();
+
+ //accessLogger.setDebug(debug); FIX ME - no debug property existS
+ accessLogger.setDirectory(directory);
+ accessLogger.setPattern(pattern);
+ accessLogger.setPrefix(prefix);
+ accessLogger.setResolveHosts(resolveHosts);
+ accessLogger.setSuffix(suffix);
+
+ return accessLogger;
+
+ }
+
+
+ /**
+ * Create a new Host.
+ */
+ public Host createHost(String appBase, int debug, String name,
+ boolean unpackWARs) {
+
+ StandardHost host = new StandardHost();
+
+ host.setAppBase(appBase);
+ host.setDebug(debug);
+ host.setName(name);
+ host.setUnpackWARs(unpackWARs);
+
+ return host;
+
+ }
+
+
+ /**
+ * Create a new RequestFilterValve.
+ */
+ public Valve createRequestFilterValve(String type, String allow,
+ int debug, String deny) {
+
+ Valve valve = null;
+ if (type.equals("RemoteAddrValve")) {
+ valve = new RemoteAddrValve();
+ ((RemoteAddrValve)valve).setAllow(allow);
+ ((RemoteAddrValve)valve).setDeny(deny);
+ } else if (type.equals("RemostHostValve")) {
+ valve = new RemoteHostValve();
+ ((RemoteHostValve)valve).setAllow(allow);
+ ((RemoteHostValve)valve).setDeny(deny);
+ } else if (type.equals("RequestDumperValve")) {
+ valve = new RequestDumperValve();
+ }
+
+ return valve;
+
+ }
}
1.2 +31 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java
Index: StandardServiceMBean.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StandardServiceMBean.java 2001/11/07 01:36:36 1.1
+++ StandardServiceMBean.java 2001/11/09 02:19:07 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java,v 1.1 2001/11/07 01:36:36 amyroh Exp $
- * $Revision: 1.1 $
- * $Date: 2001/11/07 01:36:36 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java,v 1.2 2001/11/09 02:19:07 amyroh Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/11/09 02:19:07 $
*
* ====================================================================
*
@@ -66,8 +66,10 @@
import javax.management.MBeanException;
import javax.management.RuntimeOperationsException;
+import org.apache.catalina.Connector;
import org.apache.catalina.Server;
import org.apache.catalina.Service;
+import org.apache.catalina.connector.http.HttpConnector;
import org.apache.commons.modeler.BaseModelMBean;
@@ -76,7 +78,7 @@
* <code>org.apache.catalina.core.StandardService</code> component.</p>
*
* @author Amy Roh
- * @version $Revision: 1.1 $ $Date: 2001/11/07 01:36:36 $
+ * @version $Revision: 1.2 $ $Date: 2001/11/09 02:19:07 $
*/
public class StandardServiceMBean extends BaseModelMBean {
@@ -119,6 +121,31 @@
// ------------------------------------------------------------- Operations
+
+
+ /**
+ * Create a new Connector.
+ */
+ public Connector createConnector(String scheme, int acceptCount, String address,
+ int connectionTimeout, int debug, boolean enableLookups, int maxProcessors,
+ int minProcessors, int port, String proxyName) {
+
+ HttpConnector connector = new HttpConnector();
+
+ connector.setScheme(scheme);
+ connector.setAcceptCount(acceptCount);
+ connector.setAddress(address);
+ connector.setConnectionTimeout(connectionTimeout);
+ connector.setDebug(debug);
+ connector.setEnableLookups(enableLookups);
+ connector.setMaxProcessors(maxProcessors);
+ connector.setMinProcessors(minProcessors);
+ connector.setPort(port);
+ connector.setProxyName(proxyName);
+
+ return connector;
+
+ }
}
1.9 +57 -11 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml
Index: mbeans-descriptors.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- mbeans-descriptors.xml 2001/11/07 01:36:36 1.8
+++ mbeans-descriptors.xml 2001/11/09 02:19:07 1.9
@@ -6,7 +6,7 @@
<!--
Descriptions of JMX MBeans for Catalina
- $Id: mbeans-descriptors.xml,v 1.8 2001/11/07 01:36:36 amyroh Exp $
+ $Id: mbeans-descriptors.xml,v 1.9 2001/11/09 02:19:07 amyroh Exp $
-->
<mbeans-descriptors>
@@ -174,14 +174,14 @@
description="The 'enable DNS lookups' flag for this Connector"
type="boolean"/>
- <attribute name="minProcessors"
- description="The minimum number of processors to start at initialization time"
- type="int"/>
-
<attribute name="maxProcessors"
description="The maximum number of processors allowed"
type="int"/>
+ <attribute name="minProcessors"
+ description="The minimum number of processors to start at initialization time"
+ type="int"/>
+
<attribute name="parent"
description="Parent (Service) that owns this Connector"
type="org.apache.catalina.Service"
@@ -260,14 +260,14 @@
description="The 'enable DNS lookups' flag for this Connector"
type="boolean"/>
- <attribute name="minProcessors"
- description="The minimum number of processors to start at initialization time"
- type="int"/>
-
<attribute name="maxProcessors"
description="The maximum number of processors allowed"
type="int"/>
+ <attribute name="minProcessors"
+ description="The minimum number of processors to start at initialization time"
+ type="int"/>
+
<attribute name="parent"
description="Parent (Service) that owns this Connector"
type="org.apache.catalina.Service"
@@ -563,7 +563,7 @@
description="Parent (Container) that owns this Valve"
type="org.apache.catalina.Container"
writeable="false"/>
-
+
<constructor name="SingleSignOn"/>
</mbean>
@@ -946,6 +946,7 @@
<mbean name="StandardServer"
+ className="org.apache.catalina.mbeans.StandardServerMBean"
description="Standard Server Component"
domain="Catalina"
group="Server"
@@ -970,6 +971,15 @@
type="org.apache.catalina.Service"/>
</operation>
+ <operation name="createService"
+ description="Create a new child Service"
+ impact="ACTION"
+ returnType="org.apache.catalina.Service">
+ <parameter name="name"
+ description="The new Service's name"
+ type="java.lang.String"/>
+ </operation>
+
<operation name="findServices"
description="Return all child Services"
impact="INFO"
@@ -1024,6 +1034,42 @@
type="org.apache.catalina.Connector"/>
</operation>
+ <operation name="createConnector"
+ description="Create a new Connector"
+ impact="ACTION"
+ returnType="org.apache.catalina.Connector">
+ <parameter name="scheme"
+ description="The new Service's name"
+ type="java.lang.String"/>
+ <parameter name="acceptCount"
+ description="The accept count for this Connector"
+ type="int"/>
+ <parameter name="address"
+ description="The IP address on which to bind"
+ type="java.lang.String"/>
+ <parameter name="connectionTimeout"
+ description="Timeout value on the incoming connection"
+ type="int"/>
+ <parameter name="debug"
+ description="The debugging detail level for this component"
+ type="int"/>
+ <parameter name="enableLookups"
+ description="The 'enable DNS lookups' flag for this Connector"
+ type="boolean"/>
+ <parameter name="maxProcessors"
+ description="The maximum number of processors allowed"
+ type="int"/>
+ <parameter name="minProcessors"
+ description="The minimum number of processors to start at initialization time"
+ type="int"/>
+ <parameter name="port"
+ description="TCP port number to listen on"
+ type="int"/>
+ <parameter name="proxyName"
+ description="The server name to which we should pretend requests to this Connector were directed"
+ type="java.lang.String"/>
+ </operation>
+
<operation name="findConnectors"
description="Return all associated Connectors"
impact="ACTION"
@@ -1057,7 +1103,7 @@
description="Parent (Container) that owns this logger"
type="org.apache.catalina.Container"
writeable="false"/>
-
+
<attribute name="verbosity"
description="The verbosity level for above which log messages may be filtered"
type="int"/>
1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java
Index: StandardServerMBean.java
===================================================================
/*
* $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java,v 1.1 2001/11/09 02:19:07 amyroh Exp $
* $Revision: 1.1 $
* $Date: 2001/11/09 02:19:07 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.catalina.mbeans;
import javax.management.MBeanException;
import javax.management.RuntimeOperationsException;
import org.apache.catalina.Server;
import org.apache.catalina.Service;
import org.apache.catalina.core.StandardService;
import org.apache.commons.modeler.BaseModelMBean;
/**
* <p>A <strong>ModelMBean</strong> implementation for the
* <code>org.apache.catalina.core.StandardServer</code> component.</p>
*
* @author Amy Roh
* @version $Revision: 1.1 $ $Date: 2001/11/09 02:19:07 $
*/
public class StandardServerMBean extends BaseModelMBean {
// ----------------------------------------------------------- Constructors
/**
* Construct a <code>ModelMBean</code> with default
* <code>ModelMBeanInfo</code> information.
*
* @exception MBeanException if the initializer of an object
* throws an exception
* @exception RuntimeOperationsException if an IllegalArgumentException
* occurs
*/
public StandardServerMBean()
throws MBeanException, RuntimeOperationsException {
super();
}
// ------------------------------------------------------------- Attributes
// ------------------------------------------------------------- Operations
/**
* Create a new child Service.
*/
public Service createService(String name) {
StandardService service = new StandardService();
service.setName(name);
return service;
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>