cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans MBeanUtils.java mbeans-descriptors.xml

2002-03-08 Thread craigmcc

craigmcc02/03/08 11:01:32

  Modified:catalina/src/share/org/apache/catalina/mbeans
MBeanUtils.java mbeans-descriptors.xml
  Log:
  Add mbean definition for CoyoteConnector, refine properties for Ajp13Connector.
  
  Revision  ChangesPath
  1.29  +23 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
  
  Index: MBeanUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- MBeanUtils.java   8 Mar 2002 00:12:29 -   1.28
  +++ MBeanUtils.java   8 Mar 2002 19:01:32 -   1.29
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
 1.28 2002/03/08 00:12:29 craigmcc Exp $
  - * $Revision: 1.28 $
  - * $Date: 2002/03/08 00:12:29 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
 1.29 2002/03/08 19:01:32 craigmcc Exp $
  + * $Revision: 1.29 $
  + * $Date: 2002/03/08 19:01:32 $
*
* 
*
  @@ -109,7 +109,7 @@
*
* @author Craig R. McClanahan
* @author Amy Roh
  - * @version $Revision: 1.28 $ $Date: 2002/03/08 00:12:29 $
  + * @version $Revision: 1.29 $ $Date: 2002/03/08 19:01:32 $
*/
   
   public class MBeanUtils {
  @@ -126,6 +126,8 @@
   private static String exceptions[][] = {
   { org.apache.ajp.tomcat4.Ajp13Connector,
 Ajp13Connector },
  +{ org.apache.coyote.tomcat4.Ajp13Connector,
  +  CoyoteConnector },
   { org.apache.catalina.core.StandardDefaultContext,
 DefaultContext },
   { org.apache.catalina.connector.http10.HttpConnector,
  @@ -693,6 +695,23 @@
 ,address= + httpConnector.getAddress());
   return (name);
   } else if (org.apache.ajp.tomcat4.Ajp13Connector.equals
  +   (connector.getClass().getName())) {
  +try {
  +String address = (String)
  +PropertyUtils.getSimpleProperty(connector, address);
  +Integer port = (Integer)
  +PropertyUtils.getSimpleProperty(connector, port);
  +name = new ObjectName(domain + :type=Connector +
  +  ,service= +
  +  connector.getService().getName() +
  +  ,port= + port +
  +  ,address= + address);
  +return (name);
  +} catch (Exception e) {
  +throw new MalformedObjectNameException
  +(Cannot create object name for  + connector);
  +}
  +} else if (org.apache.coyote.tomcat4.CoyoteConnector.equals
  (connector.getClass().getName())) {
   try {
   String address = (String)
  
  
  
  1.36  +109 -5
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.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- mbeans-descriptors.xml8 Mar 2002 06:58:17 -   1.35
  +++ mbeans-descriptors.xml8 Mar 2002 19:01:32 -   1.36
  @@ -6,7 +6,7 @@
   !--
Descriptions of JMX MBeans for Catalina
   
  - $Id: mbeans-descriptors.xml,v 1.35 2002/03/08 06:58:17 amyroh Exp $
  + $Id: mbeans-descriptors.xml,v 1.36 2002/03/08 19:01:32 craigmcc Exp $
--
   
   mbeans-descriptors
  @@ -80,14 +80,27 @@
 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
   

Re: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans MBeanUtils.java mbeans-descriptors.xml

2002-02-14 Thread Remy Maucherat

   amyroh  02/02/13 23:47:14
  
 Modified:catalina/src/share/org/apache/catalina/mbeans
   MBeanUtils.java mbeans-descriptors.xml
 Log:
 Add additional Catalina components MBeans.
 
  if (managed == null) {
 -//Exception e = new Exception(ManagedBean is not found
  with +mname);
 -//throw new MBeanException(e);
 -return null;
 +Exception e = new Exception(ManagedBean is not found
with
  +mname);
 +throw new MBeanException(e);
 
  As I said before, I think it's a very bad idea to do this, and would
  restrict the audience of the admin webapp to the beginner users of
Tomcat
  (since you get the choice between using the webapp *or* taking advantage
of
  the modularity of Catalina).
 

 At the moment, the other alternative (just skip the components you don't
 know how to create an MBean for) is even worse:
 * Tomcat starts up, the custom components are created,
   but no MBeans for the custom components
 * Admin app shows only the known components, thus mystifying the user
 * User makes a change, via the admin app, to a standard component
 * (When supported) Admin app rewrites server.xml to save the change
 * The unrecognized custom entry disappears from server.xml :-(.

 There will certainly need to be a way to deal with extensibility (i.e.
 user defined Valves, Realms, and so on).  But we need to start from the
 assumption that the admin app must faithfully reproduce *all* of the
 contents of the server.xml file when it supports persistence.  Silently
 ignoring things you don't know about doesn't help achieve that goal.

I agree that it makes the task more complex, but I think that choice makes
the admin webapp a fancy feature, rather than a truly useful feature.

For example, if you write somthing as simple as a custom realm (or extend
one of the base ones) and add it to your server.xml, the admin webapp won't
work anymore (and you'll get some nasty stack trace printed out on your
command line when you start Catalina).

IMO, the pluggability feature should be developped first, rather than later.

Remy


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans MBeanUtils.java mbeans-descriptors.xml

2002-02-13 Thread amyroh

amyroh  02/02/13 23:47:14

  Modified:catalina/src/share/org/apache/catalina/mbeans
MBeanUtils.java mbeans-descriptors.xml
  Log:
  Add additional Catalina components MBeans.
  
  Revision  ChangesPath
  1.25  +39 -56
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
  
  Index: MBeanUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- MBeanUtils.java   12 Feb 2002 19:05:25 -  1.24
  +++ MBeanUtils.java   14 Feb 2002 07:47:14 -  1.25
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
 1.24 2002/02/12 19:05:25 craigmcc Exp $
  - * $Revision: 1.24 $
  - * $Date: 2002/02/12 19:05:25 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
 1.25 2002/02/14 07:47:14 amyroh Exp $
  + * $Revision: 1.25 $
  + * $Date: 2002/02/14 07:47:14 $
*
* 
*
  @@ -109,7 +109,7 @@
*
* @author Craig R. McClanahan
* @author Amy Roh
  - * @version $Revision: 1.24 $ $Date: 2002/02/12 19:05:25 $
  + * @version $Revision: 1.25 $ $Date: 2002/02/14 07:47:14 $
*/
   
   public class MBeanUtils {
  @@ -203,9 +203,8 @@
   String mname = createManagedName(connector);
   ManagedBean managed = registry.findManagedBean(mname);
   if (managed == null) {
  -//Exception e = new Exception(ManagedBean is not found with +mname);
  -//throw new MBeanException(e);
  -return null;
  +Exception e = new Exception(ManagedBean is not found with +mname);
  +throw new MBeanException(e);
   }
   String domain = managed.getDomain();
   if (domain == null)
  @@ -232,9 +231,8 @@
   String mname = createManagedName(context);
   ManagedBean managed = registry.findManagedBean(mname);
   if (managed == null) {
  -//Exception e = new Exception(ManagedBean is not found with +mname);
  -//throw new MBeanException(e);
  -return null;
  +Exception e = new Exception(ManagedBean is not found with +mname);
  +throw new MBeanException(e);
   }
   String domain = managed.getDomain();
   if (domain == null)
  @@ -261,9 +259,8 @@
   String mname = createManagedName(context);
   ManagedBean managed = registry.findManagedBean(mname);
   if (managed == null) {
  -//Exception e = new Exception(ManagedBean is not found with +mname);
  -//throw new MBeanException(e);
  -return null;
  +Exception e = new Exception(ManagedBean is not found with +mname);
  +throw new MBeanException(e);
   }
   String domain = managed.getDomain();
   if (domain == null)
  @@ -290,9 +287,8 @@
   String mname = createManagedName(engine);
   ManagedBean managed = registry.findManagedBean(mname);
   if (managed == null) {
  -//Exception e = new Exception(ManagedBean is not found with +mname);
  -//throw new MBeanException(e);
  -return null;
  +Exception e = new Exception(ManagedBean is not found with +mname);
  +throw new MBeanException(e);
   }
   String domain = managed.getDomain();
   if (domain == null)
  @@ -319,9 +315,8 @@
   String mname = createManagedName(group);
   ManagedBean managed = registry.findManagedBean(mname);
   if (managed == null) {
  -//Exception e = new Exception(ManagedBean is not found with +mname);
  -//throw new MBeanException(e);
  -return null;
  +Exception e = new Exception(ManagedBean is not found with +mname);
  +throw new MBeanException(e);
   }
   String domain = managed.getDomain();
   if (domain == null)
  @@ -348,9 +343,8 @@
   String mname = createManagedName(host);
   ManagedBean managed = registry.findManagedBean(mname);
   if (managed == null) {
  -//Exception e = new Exception(ManagedBean is not found with +mname);
  -//throw new MBeanException(e);
  -return null;
  +Exception e = new Exception(ManagedBean is not found with +mname);
  +throw new MBeanException(e);
   }
   String domain = managed.getDomain();
   if (domain == null)
  @@ -377,9 +371,8 @@
   String mname = createManagedName(loader);
   ManagedBean managed = registry.findManagedBean(mname);
   if (managed == 

Re: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans MBeanUtils.java mbeans-descriptors.xml

2002-02-13 Thread Remy Maucherat

 amyroh  02/02/13 23:47:14

   Modified:catalina/src/share/org/apache/catalina/mbeans
 MBeanUtils.java mbeans-descriptors.xml
   Log:
   Add additional Catalina components MBeans.

if (managed == null) {
   -//Exception e = new Exception(ManagedBean is not found
with +mname);
   -//throw new MBeanException(e);
   -return null;
   +Exception e = new Exception(ManagedBean is not found with
+mname);
   +throw new MBeanException(e);

As I said before, I think it's a very bad idea to do this, and would
restrict the audience of the admin webapp to the beginner users of Tomcat
(since you get the choice between using the webapp *or* taking advantage of
the modularity of Catalina).

Remy


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]