amyroh 02/04/29 20:25:22 Modified: catalina/src/share/org/apache/catalina/mbeans MBeanFactory.java StandardServerMBean.java mbeans-descriptors.xml Log: Add to save the GlobalNamingResources element in Server to conf/server.xml. Edit mbeans-descriptor to synch with MBeanFactory connector methods. Revision Changes Path 1.27 +11 -11 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java Index: MBeanFactory.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- MBeanFactory.java 29 Apr 2002 23:06:26 -0000 1.26 +++ MBeanFactory.java 30 Apr 2002 03:25:22 -0000 1.27 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v 1.26 2002/04/29 23:06:26 amyroh Exp $ - * $Revision: 1.26 $ - * $Date: 2002/04/29 23:06:26 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v 1.27 2002/04/30 03:25:22 amyroh Exp $ + * $Revision: 1.27 $ + * $Date: 2002/04/30 03:25:22 $ * * ==================================================================== * @@ -117,7 +117,7 @@ * <code>org.apache.catalina.core.StandardServer</code> component.</p> * * @author Amy Roh - * @version $Revision: 1.26 $ $Date: 2002/04/29 23:06:26 $ + * @version $Revision: 1.27 $ $Date: 2002/04/30 03:25:22 $ */ public class MBeanFactory extends BaseModelMBean { @@ -274,7 +274,7 @@ service.addConnector((Connector)retobj); // Return the corresponding MBean name - ManagedBean managed = registry.findManagedBean("AjpConnector"); + ManagedBean managed = registry.findManagedBean("CoyoteConnector"); ObjectName oname = MBeanUtils.createObjectName(managed.getDomain(), (Connector)retobj); return (oname.toString()); @@ -359,7 +359,7 @@ /** - * Create a new HTTPConnector + * Create a new HttpConnector * * @param parent MBean Name of the associated parent component * @param address The IP address on which to bind @@ -367,7 +367,7 @@ * * @exception Exception if an MBean cannot be created or registered */ - public String createHTTPConnector(String parent, String address, int port) + public String createHttpConnector(String parent, String address, int port) throws Exception { Object retobj = null; @@ -405,7 +405,7 @@ service.addConnector((Connector)retobj); // Return the corresponding MBean name - ManagedBean managed = registry.findManagedBean("HttpConnector"); + ManagedBean managed = registry.findManagedBean("CoyoteConnector"); ObjectName oname = MBeanUtils.createObjectName(managed.getDomain(), (Connector)retobj); return (oname.toString()); @@ -414,7 +414,7 @@ /** - * Create a new HTTPSConnector + * Create a new HttpsConnector * * @param parent MBean Name of the associated parent component * @param address The IP address on which to bind @@ -422,7 +422,7 @@ * * @exception Exception if an MBean cannot be created or registered */ - public String createHTTPSConnector(String parent, String address, int port) + public String createHttpsConnector(String parent, String address, int port) throws Exception { Object retobj = null; @@ -474,7 +474,7 @@ service.addConnector((Connector)retobj); // Return the corresponding MBean name - ManagedBean managed = registry.findManagedBean("HttpsConnector"); + ManagedBean managed = registry.findManagedBean("CoyoteConnector"); ObjectName oname = MBeanUtils.createObjectName(managed.getDomain(), (Connector)retobj); return (oname.toString()); 1.11 +84 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java Index: StandardServerMBean.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- StandardServerMBean.java 27 Apr 2002 05:09:03 -0000 1.10 +++ StandardServerMBean.java 30 Apr 2002 03:25:22 -0000 1.11 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java,v 1.10 2002/04/27 05:09:03 craigmcc Exp $ - * $Revision: 1.10 $ - * $Date: 2002/04/27 05:09:03 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java,v 1.11 2002/04/30 03:25:22 amyroh Exp $ + * $Revision: 1.11 $ + * $Date: 2002/04/30 03:25:22 $ * * ==================================================================== * @@ -95,6 +95,10 @@ import org.apache.catalina.Service; import org.apache.catalina.Store; import org.apache.catalina.Valve; +import org.apache.catalina.deploy.NamingResources; +import org.apache.catalina.deploy.ContextResource; +import org.apache.catalina.deploy.ContextEnvironment; +import org.apache.catalina.deploy.ResourceParams; import org.apache.catalina.net.ServerSocketFactory; import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.modeler.BaseModelMBean; @@ -105,7 +109,7 @@ * <code>org.apache.catalina.core.StandardServer</code> component.</p> * * @author Amy Roh - * @version $Revision: 1.10 $ $Date: 2002/04/27 05:09:03 $ + * @version $Revision: 1.11 $ $Date: 2002/04/30 03:25:22 $ */ public class StandardServerMBean extends BaseModelMBean { @@ -696,7 +700,79 @@ } + + /** + * Store the specified GlobalNamingResources properties. + * + * @param writer PrintWriter to which we are storing + * @param indent Number of spaces to indent this element + * @param resources Object whose properties are being stored + * + * @exception Exception if an exception occurs while storing + */ + private void storeGlobalNamingResources(PrintWriter writer, int indent, + NamingResources globalNamingResources) throws Exception { + + for (int i = 0; i < indent; i++) { + writer.print(' '); + } + writer.println("<GlobalNamingResources>"); + + for (int i = 0; i < indent + 2; i++) { + writer.print(' '); + } + // Store nested <Environment> elements + ContextEnvironment[] envs = globalNamingResources.findEnvironments(); + if (envs.length > 0) { + writer.print("<Environment"); + } + for (int i = 0; i < envs.length; i++) { + storeAttributes(writer, false, envs[i]); + } + writer.println("/>"); + for (int i = 0; i < indent + 2; i++) { + writer.print(' '); + } + // Store nested <Resource> elements + ContextResource[] resources = globalNamingResources.findResources(); + if (resources.length > 0) { + writer.print("<Resource"); + } + for (int i = 0; i < resources.length; i++) { + storeAttributes(writer, false, resources[i]); + } + writer.println(">"); + for (int i = 0; i < indent + 2; i++) { + writer.print(' '); + } + writer.println("</Resource>"); + + for (int i = 0; i < indent + 2; i++) { + writer.print(' '); + } + // Store nested <ResourceParams> elements + ResourceParams[] resourceParams = globalNamingResources.findResourceParams(); + if (resourceParams.length > 0) { + writer.print("<ResourceParams "); + } + for (int i = 0; i < resourceParams.length; i++) { + storeAttributes(writer, false, resourceParams[i]); + } + writer.println(">"); + for (int i = 0; i < indent + 2; i++) { + writer.print(' '); + } + writer.println("</ResourceParams>"); + + for (int i = 0; i < indent; i++) { + writer.print(' '); + } + writer.println("</GlobalNamingResources>"); + + } + + /** * Store the specified Host properties. * @@ -936,7 +1012,10 @@ writer.println(">"); // Store nested <GlobalNamingResources> element - ; // FIXME + NamingResources globalNamingResources = server.getGlobalNamingResources(); + if (globalNamingResources != null) { + storeGlobalNamingResources(writer, indent + 2, globalNamingResources); + } // Store nested <Listener> elements if (server instanceof Lifecycle) { 1.50 +85 -326 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.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- mbeans-descriptors.xml 29 Apr 2002 23:06:26 -0000 1.49 +++ mbeans-descriptors.xml 30 Apr 2002 03:25:22 -0000 1.50 @@ -6,7 +6,7 @@ <!-- Descriptions of JMX MBeans for Catalina - $Id: mbeans-descriptors.xml,v 1.49 2002/04/29 23:06:26 amyroh Exp $ + $Id: mbeans-descriptors.xml,v 1.50 2002/04/30 03:25:22 amyroh Exp $ --> <mbeans-descriptors> @@ -52,83 +52,6 @@ </mbean> - <mbean name="AjpConnector" - className="org.apache.catalina.mbeans.ClassNameMBean" - description="Implementation of an Ajp connector" - domain="Catalina" - group="Connector" - type="org.apache.coyote.tomcat4.CoyoteConnector"> - - <attribute name="acceptCount" - description="The accept count for this Connector" - type="int"/> - - <attribute name="address" - description="The IP address on which to bind" - type="java.lang.String"/> - - <attribute name="bufferSize" - description="The input buffer size we should create on input streams" - type="int"/> - - <attribute name="className" - description="Fully qualified class name of the managed object" - type="java.lang.String" - writeable="false"/> - - <attribute name="connectionTimeout" - description="Timeout value on the incoming connection" - type="int"/> - - <attribute name="curProcessors" - description="Current number of active processors" - type="int" - writeable="false"/> - - <attribute name="debug" - description="The debugging detail level for this component" - type="int"/> - - <attribute name="secret" - description="Authentication secret (I guess ... not in Javadocs)" - type="java.lang.String"/> - - <attribute name="enableLookups" - description="The 'enable DNS lookups' flag for this Connector" - type="boolean"/> - - <attribute name="redirectPort" - description="The redirect port for non-SSL to SSL redirects" - 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="port" - description="The port number on which we listen for ajp13 requests" - type="int"/> - - <attribute name="scheme" - description="Protocol name for this Connector (http, https)" - type="java.lang.String"/> - - <attribute name="secure" - description="Is this a secure (SSL) Connector?" - type="boolean"/> - - <attribute name="tomcatAuthentication" - description="Should Tomcat perform all authentications?" - type="boolean"/> - - </mbean> - - <mbean name="BasicAuthenticator" className="org.apache.catalina.mbeans.ClassNameMBean" description="An Authenticator and Valve implementation of HTTP BASIC @@ -204,6 +127,82 @@ </mbean> +<mbean name="CoyoteConnector" + className="org.apache.catalina.mbeans.ClassNameMBean" + description="Implementation of a Coyote connector" + domain="Catalina" + group="Connector" + type="org.apache.coyote.tomcat4.CoyoteConnector"> + + <attribute name="acceptCount" + description="The accept count for this Connector" + type="int"/> + + <attribute name="address" + description="The IP address on which to bind" + type="java.lang.String"/> + + <attribute name="bufferSize" + description="The input buffer size we should create on input streams" + type="int"/> + + <attribute name="className" + description="Fully qualified class name of the managed object" + type="java.lang.String" + writeable="false"/> + + <attribute name="connectionTimeout" + description="Timeout value on the incoming connection" + type="int"/> + + <attribute name="curProcessors" + description="Current number of active processors" + type="int" + writeable="false"/> + + <attribute name="debug" + description="The debugging detail level for this component" + type="int"/> + + <attribute name="secret" + description="Authentication secret (I guess ... not in Javadocs)" + type="java.lang.String"/> + + <attribute name="enableLookups" + description="The 'enable DNS lookups' flag for this Connector" + type="boolean"/> + + <attribute name="redirectPort" + description="The redirect port for non-SSL to SSL redirects" + 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="port" + description="The port number on which we listen for ajp13 requests" + type="int"/> + + <attribute name="scheme" + description="Protocol name for this Connector (http, https)" + type="java.lang.String"/> + + <attribute name="secure" + description="Is this a secure (SSL) Connector?" + type="boolean"/> + + <attribute name="tomcatAuthentication" + description="Should Tomcat perform all authentications?" + type="boolean"/> + + </mbean> + <mbean name="DefaultContext" className="org.apache.catalina.mbeans.ClassNameMBean" @@ -486,158 +485,6 @@ type="int"/> </mbean> - - - <mbean name="HttpConnector" - className="org.apache.catalina.mbeans.ClassNameMBean" - description="Implementation of a Http Coyote connector for Tomcat 4.x" - domain="Catalina" - group="Connector" - type="org.apache.coyote.tomcat4.CoyoteConnector"> - - <attribute name="acceptCount" - description="The accept count for this Connector" - type="int"/> - - <attribute name="address" - description="The IP address on which to bind" - type="java.lang.String"/> - - <attribute name="bufferSize" - description="The input buffer size we should create on input streams" - type="int"/> - - <attribute name="className" - description="Fully qualified class name of the managed object" - type="java.lang.String" - writeable="false"/> - - <attribute name="connectionTimeout" - description="Timeout value on the incoming connection" - type="int"/> - - <attribute name="debug" - description="The debugging detail level for this component" - type="int"/> - - <attribute name="enableLookups" - description="The 'enable DNS lookups' flag for this Connector" - type="boolean"/> - - <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="port" - description="The port number on which we listen for ajp13 requests" - type="int"/> - - <attribute name="proxyName" - description="The server name to which we should pretend requests to - this Connector were directed" - type="java.lang.String"/> - - <attribute name="proxyPort" - description="The server port to which we should pretend requests to - this Connector were directed" - type="int"/> - - <attribute name="redirectPort" - description="The redirect port for non-SSL to SSL redirects" - type="int"/> - - <attribute name="scheme" - description="Protocol name for this Connector (http, https)" - type="java.lang.String"/> - - </mbean> - - - <mbean name="HttpsConnector" - className="org.apache.catalina.mbeans.HttpsConnectorMBean" - description="Implementation of a Https Coyote connector for Tomcat 4.x" - domain="Catalina" - group="Connector" - type="org.apache.coyote.tomcat4.CoyoteConnector"> - - <attribute name="acceptCount" - description="The accept count for this Connector" - type="int"/> - - <attribute name="address" - description="The IP address on which to bind" - type="java.lang.String"/> - - <attribute name="bufferSize" - description="The input buffer size we should create on input streams" - type="int"/> - - <attribute name="className" - description="Fully qualified class name of the managed object" - type="java.lang.String" - writeable="false"/> - - <attribute name="clientAuth" - description="Should we require client authentication?" - type="boolean"/> - - <attribute name="connectionTimeout" - description="Timeout value on the incoming connection" - type="int"/> - - <attribute name="debug" - description="The debugging detail level for this component" - type="int"/> - - <attribute name="enableLookups" - description="The 'enable DNS lookups' flag for this Connector" - type="boolean"/> - - <attribute name="keystoreFile" - description="Pathname to the key store file to be used" - type="java.lang.String"/> - - <attribute name="keystorePass" - description="Password for accessing the key store file" - type="java.lang.String"/> - - <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="port" - description="The port number on which we listen for ajp13 requests" - type="int"/> - - <attribute name="proxyName" - description="The server name to which we should pretend requests to - this Connector were directed" - type="java.lang.String"/> - - <attribute name="proxyPort" - description="The server port to which we should pretend requests to - this Connector were directed" - type="int"/> - - <attribute name="redirectPort" - description="The redirect port for non-SSL to SSL redirects" - type="int"/> - - <attribute name="scheme" - description="Protocol name for this Connector (http, https)" - type="java.lang.String"/> - - </mbean> <mbean name="JAASRealm" @@ -876,79 +723,6 @@ </mbean> - <mbean name="JK2Connector" - className="org.apache.catalina.mbeans.ClassNameMBean" - description="Implementation of an JK2 connector" - domain="Catalina" - group="Connector" - type="org.apache.coyote.tomcat4.CoyoteConnector"> - - <attribute name="acceptCount" - description="The accept count for this Connector" - type="int"/> - - <attribute name="address" - description="The IP address on which to bind" - type="java.lang.String"/> - - <attribute name="bufferSize" - description="The input buffer size we should create on input streams" - type="int"/> - - <attribute name="className" - description="Fully qualified class name of the managed object" - type="java.lang.String" - writeable="false"/> - - <attribute name="connectionTimeout" - description="Timeout value on the incoming connection" - type="int"/> - - <attribute name="debug" - description="The debugging detail level for this component" - type="int"/> - - <attribute name="enableLookups" - description="The 'enable DNS lookups' flag for this Connector" - type="boolean"/> - - <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="port" - description="The port number on which we listen for ajp13 requests" - type="int"/> - - <attribute name="processorClassName" - description="Fully qualified class name of Coyote processor class" - type="java.lang.String"/> - - <attribute name="proxyName" - description="The server name to which we should pretend requests to - this Connector were directed" - type="java.lang.String"/> - - <attribute name="proxyPort" - description="The server port to which we should pretend requests to - this Connector were directed" - type="int"/> - - <attribute name="redirectPort" - description="The redirect port for non-SSL to SSL redirects" - type="int"/> - - <attribute name="scheme" - description="Protocol name for this Connector (http, https)" - type="java.lang.String"/> - - </mbean> - <mbean name="JNDIRealm" className="org.apache.catalina.mbeans.ClassNameMBean" @@ -1024,8 +798,8 @@ type="java.lang.String"/> </operation> - <operation name="createAjp13Connector" - description="Create a new Ajp13Connector" + <operation name="createAjpConnector" + description="Create a new AjpConnector" impact="ACTION" returnType="java.lang.String"> <parameter name="parent" @@ -1039,21 +813,6 @@ type="int"/> </operation> - <operation name="createCoyoteConnector" - description="Create a new CoyoteConnector" - impact="ACTION" - returnType="java.lang.String"> - <parameter name="parent" - description="MBean Name of the associated parent component" - type="java.lang.String"/> - <parameter name="address" - description="The IP address on which to bind" - type="java.lang.String"/> - <parameter name="port" - description="TCP port number to listen on" - type="int"/> - </operation> - <operation name="createDefaultContext" description="Create a new DefaultContext" impact="ACTION" @@ -1072,14 +831,14 @@ type="java.lang.String"/> </operation> - <operation name="createHttp10Connector" - description="Create a new HTTP/1.0 Connector" + <operation name="createHttpConnector" + description="Create a new HttpConnector" impact="ACTION" returnType="java.lang.String"> <parameter name="parent" description="MBean Name of the associated parent component" type="java.lang.String"/> - <parameter name="address" + <parameter name="address" description="The IP address on which to bind" type="java.lang.String"/> <parameter name="port" @@ -1087,14 +846,14 @@ type="int"/> </operation> - <operation name="createHttp11Connector" - description="Create a new HTTP/1.1 Connector" + <operation name="createHttpsConnector" + description="Create a new HttpsConnector" impact="ACTION" returnType="java.lang.String"> <parameter name="parent" description="MBean Name of the associated parent component" type="java.lang.String"/> - <parameter name="address" + <parameter name="address" description="The IP address on which to bind" type="java.lang.String"/> <parameter name="port"
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>