cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2005-01-29 Thread pero
pero2005/01/29 11:38:38

  Modified:catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  add destory method that unregister this and all StandardContext MBeans
  
  Revision  ChangesPath
  1.39  +13 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- StandardHost.java 11 Jan 2005 14:01:45 -  1.38
  +++ StandardHost.java 29 Jan 2005 19:38:37 -  1.39
  @@ -781,6 +781,7 @@
   log.debug( Register host  + getName() +  with domain 
+ domain );
   oname=new ObjectName(domain + :type=Host,host= +
   this.getName());
  +controller = oname;
   Registry.getRegistry(null, null)
   .registerComponent(this, oname, null);
   } catch( Throwable t ) {
  @@ -789,6 +790,17 @@
   }
   }
   
  +public void destroy() throws Exception {
  +// destroy our child containers, if any
  +Container children[] = findChildren();
  +super.destroy();
  +for (int i = 0; i  children.length; i++) {
  +if(children[i] instanceof StandardContext)
  +((StandardContext)children[i]).destroy();
  +}
  +  
  +}
  +
   public ObjectName preRegister(MBeanServer server, ObjectName oname ) 
   throws Exception
   {
  
  
  

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



Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2004-08-03 Thread Peter Rossbach
Hello Bill,
I see the change, but I missing the attribute managedResource at the 
Realms.mbeans-descriptors.xml.

Thanx
Peter
[EMAIL PROTECTED] schrieb:
billbarker2004/08/02 20:01:03
 Modified:catalina/src/share/org/apache/catalina/core
   StandardHost.java
 Log:
 Small changes for JMX deployment
 
 -- Create a Deployer for this Host.
 -- Fix the discover orphaned Realm logic.  This still requires that the Realm MBean exposes the managedResource attribute, but it was so broken before that nobody could have been using it.
 
 Revision  ChangesPath
 1.33  +10 -7 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
 
 Index: StandardHost.java
 ===
 RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
 retrieving revision 1.32
 retrieving revision 1.33
 diff -u -r1.32 -r1.33
 --- StandardHost.java	28 Jul 2004 18:02:15 -	1.32
 +++ StandardHost.java	3 Aug 2004 03:01:03 -	1.33
 @@ -29,9 +29,11 @@
  import org.apache.catalina.Context;
  import org.apache.catalina.DefaultContext;
  import org.apache.catalina.Host;
 +import org.apache.catalina.Realm;
  import org.apache.catalina.LifecycleException;
  import org.apache.catalina.Valve;
  import org.apache.catalina.valves.ValveBase;
 +import org.apache.catalina.startup.HostConfig;
  import org.apache.commons.modeler.Registry;
  
  
 @@ -736,12 +738,11 @@
  if( realm == null ) {
  ObjectName realmName=null;
  try {
 -realmName=new ObjectName( domain + :type=Host,host= + getName());
 +realmName=new ObjectName( domain + :type=Realm,host= + getName());
  if( mserver.isRegistered(realmName ) ) {
 -mserver.invoke(realmName, setContext, 
 -new Object[] {this},
 -new String[] { org.apache.catalina.Container }
 -);
 +Realm nrealm = (Realm)mserver.getAttribute(realmName,
 +   managedResource);
 +setRealm(nrealm);
  }
  } catch( Throwable t ) {
  log.debug(No realm for this host  + realmName);
 @@ -830,7 +831,9 @@
  // Register with the Engine
  ObjectName serviceName=new ObjectName(domain + 
  :type=Engine);
 -
 +
 +HostConfig deployer = new HostConfig();
 +addLifecycleListener(deployer);
  if( mserver.isRegistered( serviceName )) {
  log.debug(Registering with the Engine);
  mserver.invoke( serviceName, addChild,
 
 
 

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

 


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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2004-08-03 Thread Bill Barker

- Original Message - 
From: Peter Rossbach [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Monday, August 02, 2004 11:24 PM
Subject: Re: cvs commit:
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core
StandardHost.java


 Hello Bill,

 I see the change, but I missing the attribute managedResource at the
 Realms.mbeans-descriptors.xml.


I just assumed that you'd be doing this one soon enough (since it's on your
wish-list ;-).

Since this feature has obviously never worked (the old code was so wrong in
so many ways :),  I  figured that it could not work for a little while
longer.  It's just something that I noticed while seeing how to get the
admin webapp to play nice with the Deployer.

 Thanx
 Peter

 [EMAIL PROTECTED] schrieb:

 billbarker2004/08/02 20:01:03
 
   Modified:catalina/src/share/org/apache/catalina/core
 StandardHost.java
   Log:
   Small changes for JMX deployment
 
   -- Create a Deployer for this Host.
   -- Fix the discover orphaned Realm logic.  This still requires that
the Realm MBean exposes the managedResource attribute, but it was so
broken before that nobody could have been using it.
 
   Revision  ChangesPath
   1.33  +10 -7
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/Standard
Host.java
 
   Index: StandardHost.java
   ===
   RCS file:
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/cor
e/StandardHost.java,v
   retrieving revision 1.32
   retrieving revision 1.33
   diff -u -r1.32 -r1.33
   --- StandardHost.java 28 Jul 2004 18:02:15 - 1.32
   +++ StandardHost.java 3 Aug 2004 03:01:03 - 1.33
   @@ -29,9 +29,11 @@
import org.apache.catalina.Context;
import org.apache.catalina.DefaultContext;
import org.apache.catalina.Host;
   +import org.apache.catalina.Realm;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.Valve;
import org.apache.catalina.valves.ValveBase;
   +import org.apache.catalina.startup.HostConfig;
import org.apache.commons.modeler.Registry;
 
 
   @@ -736,12 +738,11 @@
if( realm == null ) {
ObjectName realmName=null;
try {
   -realmName=new ObjectName( domain + :type=Host,host=
+ getName());
   +realmName=new ObjectName( domain + :type=Realm,host=
+ getName());
if( mserver.isRegistered(realmName ) ) {
   -mserver.invoke(realmName, setContext,
   -new Object[] {this},
   -new String[] {
org.apache.catalina.Container }
   -);
   +Realm nrealm =
(Realm)mserver.getAttribute(realmName,
   +
managedResource);
   +setRealm(nrealm);
}
} catch( Throwable t ) {
log.debug(No realm for this host  + realmName);
   @@ -830,7 +831,9 @@
// Register with the Engine
ObjectName serviceName=new ObjectName(domain +
:type=Engine);
   -
   +
   +HostConfig deployer = new HostConfig();
   +addLifecycleListener(deployer);
if( mserver.isRegistered( serviceName )) {
log.debug(Registering with the Engine);
mserver.invoke( serviceName, addChild,
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 


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



This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

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

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2004-08-02 Thread billbarker
billbarker2004/08/02 20:01:03

  Modified:catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  Small changes for JMX deployment
  
  -- Create a Deployer for this Host.
  -- Fix the discover orphaned Realm logic.  This still requires that the Realm 
MBean exposes the managedResource attribute, but it was so broken before that nobody 
could have been using it.
  
  Revision  ChangesPath
  1.33  +10 -7 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- StandardHost.java 28 Jul 2004 18:02:15 -  1.32
  +++ StandardHost.java 3 Aug 2004 03:01:03 -   1.33
  @@ -29,9 +29,11 @@
   import org.apache.catalina.Context;
   import org.apache.catalina.DefaultContext;
   import org.apache.catalina.Host;
  +import org.apache.catalina.Realm;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.Valve;
   import org.apache.catalina.valves.ValveBase;
  +import org.apache.catalina.startup.HostConfig;
   import org.apache.commons.modeler.Registry;
   
   
  @@ -736,12 +738,11 @@
   if( realm == null ) {
   ObjectName realmName=null;
   try {
  -realmName=new ObjectName( domain + :type=Host,host= + getName());
  +realmName=new ObjectName( domain + :type=Realm,host= + getName());
   if( mserver.isRegistered(realmName ) ) {
  -mserver.invoke(realmName, setContext, 
  -new Object[] {this},
  -new String[] { org.apache.catalina.Container }
  -);
  +Realm nrealm = (Realm)mserver.getAttribute(realmName,
  +   managedResource);
  +setRealm(nrealm);
   }
   } catch( Throwable t ) {
   log.debug(No realm for this host  + realmName);
  @@ -830,7 +831,9 @@
   // Register with the Engine
   ObjectName serviceName=new ObjectName(domain + 
   :type=Engine);
  -
  +
  +HostConfig deployer = new HostConfig();
  +addLifecycleListener(deployer);
   if( mserver.isRegistered( serviceName )) {
   log.debug(Registering with the Engine);
   mserver.invoke( serviceName, addChild,
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2004-05-26 Thread yoavs
yoavs   2004/05/26 08:41:07

  Modified:catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  Minor JavaDoc fixes (Bugzilla 11212)
  
  Revision  ChangesPath
  1.31  +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- StandardHost.java 12 Apr 2004 22:05:15 -  1.30
  +++ StandardHost.java 26 May 2004 15:41:07 -  1.31
  @@ -328,7 +328,7 @@
   /**
* Set the deploy on startup flag value for this host.
* 
  - * @param autoDeploy The new deploy on startup flag
  + * @param deployOnStartup The new deploy on startup flag
*/
   public void setDeployOnStartup(boolean deployOnStartup) {
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java StandardHostDeployer.java

2004-04-12 Thread luehe
luehe   2004/04/12 15:05:15

  Modified:catalina/src/share/org/apache/catalina Deployer.java
   catalina/src/share/org/apache/catalina/core
StandardHost.java StandardHostDeployer.java
  Log:
  Fixed Bugzilla 28272 (Deploy manager command should use context.xml
  from war file):
  
  Added support for embedded META-INF/context.xml, as mentioned in
  manager-howto.html. If present, META-INF/context.xml is used only if
  neither path nor config params have been specified for the deploy
  action.
  
  Revision  ChangesPath
  1.4   +38 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Deployer.java
  
  Index: Deployer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Deployer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Deployer.java 27 Feb 2004 14:58:38 -  1.3
  +++ Deployer.java 12 Apr 2004 22:05:15 -  1.4
  @@ -125,6 +125,36 @@
   
   
   /**
  + * Installs a new web application from the web application archive at the
  + * specified URL, which must contain a META-INF/context.xml context
  + * configuration file (consisting of a codelt;Contextgt;/code
  + * element).
  + *
  + * pThe web application is installed at the path specified inside the 
  + * embedded META-INF/context.xml. The docBase (if any) specified inside the
  + * embedded META-INF/context.xml is overridden with the web application's
  + * location.
  + *
  + * pIf the installation succeeds, a ContainerEvent of type
  + * codeINSTALL_EVENT/code is sent to all registered listeners,
  + * with the newly created codeContext/code as its argument.
  + *
  + * @param war URL pointing to web application location (WAR-packaged or
  + *unpacked directory)
  + *
  + * @exception IllegalArgumentException if codewar/code is null, or if
  + *the deployment host does not support any context.xml
  + *configuration files
  + * @exception IllegalStateException if the context path specified in the
  + *context configuration file is already in use by an existing
  + *web application
  + * @exception IOException if an input/output error was encountered
  + *during installation
  + */
  +public void install(URL war) throws IOException;
  +
  +
  +/**
* Return the Context for the deployed application that is associated
* with the specified context path (if any); otherwise return
* codenull/code.
  @@ -213,5 +243,12 @@
*/
   public void stop(String contextPath) throws IOException;
   
  +
  +/**
  + * Returns true if context.xml config files are supported.
  + *
  + * @return true of context.xml config files are supported, false otherwise
  + */
  +public boolean isDeployXML();
   
   }
  
  
  
  1.30  +35 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- StandardHost.java 27 Feb 2004 14:58:42 -  1.29
  +++ StandardHost.java 12 Apr 2004 22:05:15 -  1.30
  @@ -866,6 +866,40 @@
   
   
   /**
  + * Installs a new web application from the web application archive at the
  + * specified URL, which must contain a META-INF/context.xml context
  + * configuration file (consisting of a codelt;Contextgt;/code
  + * element).
  + *
  + * pThe web application is installed at the path specified inside the 
  + * embedded META-INF/context.xml. The docBase (if any) specified inside the
  + * embedded META-INF/context.xml is overridden with the web application's
  + * location.
  + *
  + * pIf the installation succeeds, a ContainerEvent of type
  + * codeINSTALL_EVENT/code is sent to all registered listeners,
  + * with the newly created codeContext/code as its argument.
  + *
  + * @param war URL pointing to web application location (WAR-packaged or
  + *unpacked directory)
  + *
  + * @exception IllegalArgumentException if codewar/code is null, or if
  + *this StandardHost does not support any context.xml
  + *configuration files
  + * @exception IllegalStateException if the context path specified in the
  + *context configuration file is already in use by an existing
  + *web application
  + * @exception IOException if an input/output error was encountered
  + *during 

Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java StandardHostDeployer.java

2004-04-12 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:
luehe   2004/04/12 15:05:15

  Modified:catalina/src/share/org/apache/catalina Deployer.java
   catalina/src/share/org/apache/catalina/core
StandardHost.java StandardHostDeployer.java
  Log:
  Fixed Bugzilla 28272 (Deploy manager command should use context.xml
  from war file):
  
  Added support for embedded META-INF/context.xml, as mentioned in
  manager-howto.html. If present, META-INF/context.xml is used only if
  neither path nor config params have been specified for the deploy
  action.
This doesn't make the deployer simpler or less hackish, but I think this 
looks like a good change (assuming you did test it well enough ;) ).

Rémy

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


cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2003-10-06 Thread jfarcand
jfarcand2003/10/06 16:51:46

  Modified:catalina/src/share/org/apache/catalina/util
SchemaResolver.java
   catalina/src/share/org/apache/catalina/startup
ContextConfig.java TldConfig.java
   catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  Cleanup schema validation and add a status message at startup.
  
  Revision  ChangesPath
  1.2   +2 -9  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/SchemaResolver.java
  
  Index: SchemaResolver.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/SchemaResolver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SchemaResolver.java   20 Aug 2002 03:26:37 -  1.1
  +++ SchemaResolver.java   6 Oct 2003 23:51:46 -   1.2
  @@ -101,18 +101,11 @@
   
   
   /**
  - * The XML schema to use for validating an XML instance.
  - */
  -protected String schemaLocation = null;
  -
  -
  -/**
* Create a new codeEntityResolver/code that will redirect
* all remote dtds and schema to a locat destination.
* @param schemaLocation the XML Schema used to validate xml instance.
*/
  -public SchemaResolver(String schemaLocation, Digester digester) {
  -this.schemaLocation = schemaLocation;
  +public SchemaResolver(Digester digester) {
   this.digester = digester;
   }
   
  @@ -162,7 +155,7 @@
   
   // Redirect the schema location to a local destination
   String key = null;
  -if (schemaLocation != null  entityURL == null  systemId != null) {
  +if (entityURL == null  systemId != null) {
   key = systemId.substring(systemId.lastIndexOf('/')+1);
   entityURL = (String)entityValidator.get(key);
   }
  
  
  
  1.37  +4 -7  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
  Index: ContextConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- ContextConfig.java25 Sep 2003 19:27:59 -  1.36
  +++ ContextConfig.java6 Oct 2003 23:51:46 -   1.37
  @@ -493,15 +493,12 @@
   webDigester.setNamespaceAware(namespaceAware);
   webDigester.setValidating(validation);
  
  -if (webDigester.getFactory().getClass().getName().indexOf(xerces)!=-1) {
  +if (webDigester.getFactory().getClass()
  +.getName().indexOf(xerces)!=-1) {
   webDigester = patchXerces(webDigester);
   }
  -
  -url = ContextConfig.class.
  -getResource(Constants.WebSchemaResourcePath_24);
   
  -SchemaResolver webEntityResolver = new SchemaResolver(url.toString(),
  -  webDigester);
  +SchemaResolver webEntityResolver = new SchemaResolver( webDigester);
   
   if (validation) {
   if (webDigester.getFactory().getClass()
  
  
  
  1.32  +3 -4  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/TldConfig.java
  
  Index: TldConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/TldConfig.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- TldConfig.java26 Sep 2003 23:09:08 -  1.31
  +++ TldConfig.java6 Oct 2003 23:51:46 -   1.32
  @@ -457,13 +457,12 @@
   tldDigester.setNamespaceAware(xmlNamespaceAware);
   tldDigester.setValidating(xmlValidation);
   
  -if (tldDigester.getFactory().getClass().getName().indexOf(xerces)!=-1) {
  +if (tldDigester.getFactory().getClass()
  +.getName().indexOf(xerces)!=-1) {
   tldDigester = patchXerces(tldDigester);
   }
   // Set the schemaLocation
  -url = TldConfig.class.getResource(Constants.TldSchemaResourcePath_20);
  -SchemaResolver tldEntityResolver = new SchemaResolver(url.toString(), 
  -  tldDigester);
  +SchemaResolver tldEntityResolver = new SchemaResolver( tldDigester);
   
   if (xmlValidation) {
   if (tldDigester.getFactory().getClass()
  
  
  
  1.23  +8 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2003-10-06 Thread jfarcand
jfarcand2003/10/06 16:54:10

  Modified:catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  One day I will be able to write english properly (probably in 20 years)
  
  Revision  ChangesPath
  1.24  +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- StandardHost.java 6 Oct 2003 23:51:46 -   1.23
  +++ StandardHost.java 6 Oct 2003 23:54:10 -   1.24
  @@ -792,7 +792,7 @@
   }
   
   if (xmlValidation)
  -log.info( XML validation enaled );
  +log.info( XML validation enabled );
   else
   log.info( XML validation disabled );
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java StandardHostDeployer.java

2003-06-21 Thread remm
remm2003/06/21 13:00:23

  Modified:catalina/src/share/org/apache/catalina/core
StandardHost.java StandardHostDeployer.java
  Log:
  - Code cleanup.
  
  Revision  ChangesPath
  1.18  +1 -4  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- StandardHost.java 15 Jun 2003 13:03:35 -  1.17
  +++ StandardHost.java 21 Jun 2003 20:00:22 -  1.18
  @@ -206,7 +206,6 @@
*/
   private DefaultContext defaultContext;
   
  -
   
   /**
* Attribute value used to turn on/off XML validation
  @@ -218,8 +217,6 @@
* Attribute value used to turn on/off XML namespace awarenes.
*/
private boolean xmlNamespaceAware = false;
  -
  -
   
   
   // - Properties
  
  
  
  1.11  +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java
  
  Index: StandardHostDeployer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- StandardHostDeployer.java 15 Jun 2003 07:42:51 -  1.10
  +++ StandardHostDeployer.java 21 Jun 2003 20:00:23 -  1.11
  @@ -289,7 +289,7 @@
   
   // Expand war file if host wants wars unpacked
   if (isWAR  host.isUnpackWARs()) {
  -docBase = ExpandWar.expand(host,war,contextPath);
  +docBase = ExpandWar.expand(host, war, contextPath);
   }
   
   // Install the new web application
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2003-03-18 Thread costin
costin  2003/03/18 23:24:40

  Modified:catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  Updates.
  
  Revision  ChangesPath
  1.6   +35 -24
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StandardHost.java 17 Mar 2003 07:32:53 -  1.5
  +++ StandardHost.java 19 Mar 2003 07:24:40 -  1.6
  @@ -65,6 +65,7 @@
   import java.net.URL;
   import javax.management.ObjectName;
   import javax.management.MBeanServer;
  +import javax.management.MalformedObjectNameException;
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
   import org.apache.catalina.DefaultContext;
  @@ -74,6 +75,7 @@
   import org.apache.catalina.Valve;
   import org.apache.catalina.valves.ErrorDispatcherValve;
   import org.apache.catalina.valves.ValveBase;
  +import org.apache.commons.modeler.Registry;
   
   
   /**
  @@ -759,18 +761,8 @@
   if( started ) {
   return;
   }
  -if( oname==null ) {
  -// not registered in JMX yet - standalone mode
  -try {
  -StandardEngine engine=(StandardEngine)parent;
  -domain=engine.getName();
  -log.info( Register  + domain );
  -oname=new ObjectName(domain + :type=Host,host= +
  -this.getName());
  -} catch( Throwable t ) {
  -log.info(Error registering , t );
  -}
  -}
  +if( ! initialized )
  +init();
   // Set error report valve
   if ((errorReportValveClass != null)
(!errorReportValveClass.equals())) {
  @@ -1031,21 +1023,40 @@
   return aliases;
   }
   
  -public void init() throws Exception {
  +private boolean initialized=false;
  +
  +public void init() {
  +if( initialized ) return;
  +initialized=true;
  +
   // already registered.
  -if( getParent() != null ) return;
  -
  -// Register with the Engine
  -ObjectName serviceName=new ObjectName(domain + :type=Engine);
  -
  -if( mserver.isRegistered( serviceName )) {
  -log.info(Registering with the Engine);
  +if( getParent() == null ) {
   try {
  -mserver.invoke( serviceName, addChild,
  -new Object[] { this },
  -new String[] { org.apache.catalina.Container } );
  +// Register with the Engine
  +ObjectName serviceName=new ObjectName(domain + :type=Engine);
  +
  +if( mserver.isRegistered( serviceName )) {
  +log.info(Registering with the Engine);
  +mserver.invoke( serviceName, addChild,
  +new Object[] { this },
  +new String[] { org.apache.catalina.Container } );
  +}
   } catch( Exception ex ) {
   ex.printStackTrace();
  +}
  +}
  +
  +if( oname==null ) {
  +// not registered in JMX yet - standalone mode
  +try {
  +StandardEngine engine=(StandardEngine)parent;
  +domain=engine.getName();
  +log.info( Register  + domain );
  +oname=new ObjectName(domain + :type=Host,host= +
  +this.getName());
  +Registry.getRegistry().registerComponent(this, oname, null);
  +} catch( Throwable t ) {
  +log.info(Error registering , t );
   }
   }
   }
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2003-03-16 Thread costin
costin  2003/03/16 23:32:53

  Modified:catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  Forgot to mention in the last commit: if no realm is set explicitely, JAAS will be
  created automatically. I'll make it default to the name of the engine - so the
  jaas application id will also match the engine name, jmx domain, jvmroute, etc.
  ( unless explicitely configured otherwise )
  
  In Host - same register itself if not done already. Name no longer includes 
service.
  In embeded case - when the object is created, it'll register itself with the engine
  ( using the same domain name and the well-known name of the engine )
  
  Revision  ChangesPath
  1.5   +29 -4 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StandardHost.java 12 Mar 2003 06:28:55 -  1.4
  +++ StandardHost.java 17 Mar 2003 07:32:53 -  1.5
  @@ -756,7 +756,21 @@
*  that prevents it from being started
*/
   public synchronized void start() throws LifecycleException {
  -
  +if( started ) {
  +return;
  +}
  +if( oname==null ) {
  +// not registered in JMX yet - standalone mode
  +try {
  +StandardEngine engine=(StandardEngine)parent;
  +domain=engine.getName();
  +log.info( Register  + domain );
  +oname=new ObjectName(domain + :type=Host,host= +
  +this.getName());
  +} catch( Throwable t ) {
  +log.info(Error registering , t );
  +}
  +}
   // Set error report valve
   if ((errorReportValveClass != null)
(!errorReportValveClass.equals())) {
  @@ -1018,10 +1032,12 @@
   }
   
   public void init() throws Exception {
  +// already registered.
   if( getParent() != null ) return;
   
  -ObjectName serviceName=new ObjectName(domain +
  -:type=Engine,name=Tomcat-Standalone);
  +// Register with the Engine
  +ObjectName serviceName=new ObjectName(domain + :type=Engine);
  +
   if( mserver.isRegistered( serviceName )) {
   log.info(Registering with the Engine);
   try {
  @@ -1033,4 +1049,13 @@
   }
   }
   }
  +
  +public ObjectName createObjectName(String domain, ObjectName parent)
  +throws Exception
  +{
  +if( log.isDebugEnabled())
  +log.debug(Create ObjectName  + domain +   + parent );
  +return new ObjectName( domain + :type=Host,name= + getName());
  +}
  +
   }
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2003-03-11 Thread costin
costin  2003/03/11 22:28:55

  Modified:catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  - remove unused imports
  - switch to commons-logging
  - lazy creation of the deployer. I did it because of some class loader problems ( but
  the problem was elsewere ) - however it is good because we may use a different 
mechanism.
  The deployment should be done using JMX - registering / unregistering mbeans
  with JSR77 names should be enough.
  
  - moved the extra JMX getters from the wrapper in mbeans/
  - when the host mbean is created directly by JMX, register with the engine
  
  Revision  ChangesPath
  1.4   +80 -35
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardHost.java 15 Jan 2003 03:40:42 -  1.3
  +++ StandardHost.java 12 Mar 2003 06:28:55 -  1.4
  @@ -1,8 +1,4 @@
   /*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
* 
*
* The Apache Software License, Version 1.1
  @@ -66,26 +62,18 @@
   
   
   import java.io.IOException;
  -import java.net.JarURLConnection;
   import java.net.URL;
  -import javax.servlet.ServletContext;
  -import javax.servlet.ServletException;
  -import javax.servlet.http.HttpServletRequest;
  -import javax.servlet.http.HttpServletResponse;
  +import javax.management.ObjectName;
  +import javax.management.MBeanServer;
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
   import org.apache.catalina.DefaultContext;
   import org.apache.catalina.Deployer;
  -import org.apache.catalina.Globals;
  -import org.apache.catalina.HttpRequest;
   import org.apache.catalina.Host;
  -import org.apache.catalina.Lifecycle;
   import org.apache.catalina.LifecycleException;
  -import org.apache.catalina.LifecycleListener;
  -import org.apache.catalina.Request;
  -import org.apache.catalina.Response;
   import org.apache.catalina.Valve;
   import org.apache.catalina.valves.ErrorDispatcherValve;
  +import org.apache.catalina.valves.ValveBase;
   
   
   /**
  @@ -160,7 +148,7 @@
* The codeDeployer/code to whom we delegate application
* deployment requests.
*/
  -private Deployer deployer = new StandardHostDeployer(this);
  +private Deployer deployer = null;
   
   
   /**
  @@ -176,7 +164,6 @@
   private String errorReportValveClass =
   org.apache.catalina.valves.ErrorReportValve;
   
  -
   /**
* The descriptive information string for this implementation.
*/
  @@ -336,7 +323,6 @@
   return (this.defaultContext);
   }
   
  -
   /**
* Return the Java class name of the Context implementation class
* for new web applications.
  @@ -665,14 +651,14 @@
*/
   public Context map(String uri) {
   
  -if (debug  0)
  -log(Mapping request URI ' + uri + ');
  +if (log.isDebugEnabled())
  +log.debug(Mapping request URI ' + uri + ');
   if (uri == null)
   return (null);
   
   // Match on the longest possible context path prefix
  -if (debug  1)
  -log(  Trying the longest context path prefix);
  +if (log.isTraceEnabled())
  +log.trace(  Trying the longest context path prefix);
   Context context = null;
   String mapuri = uri;
   while (true) {
  @@ -687,8 +673,8 @@
   
   // If no Context matches, select the default Context
   if (context == null) {
  -if (debug  1)
  -log(  Trying the default context);
  +if (log.isTraceEnabled())
  +log.trace(  Trying the default context);
   context = (Context) findChild();
   }
   
  @@ -699,8 +685,8 @@
   }
   
   // Return the mapped Context (if any)
  -if (debug  0)
  -log( Mapped to context ' + context.getPath() + ');
  +if (log.isDebugEnabled())
  +log.debug( Mapped to context ' + context.getPath() + ');
   return (context);
   
   }
  @@ -822,7 +808,7 @@
*/
   public void install(String contextPath, URL war) throws IOException {
   
  -deployer.install(contextPath, war);
  +getDelegateDeployer().install(contextPath, war);
   
   }
   
  @@ -853,7 +839,7 @@
*/
   public synchronized void install(URL config, URL war) throws IOException {
   
  -deployer.install(config, war);
  +getDelegateDeployer().install(config, war);
   
   }
   
  @@ -867,7 +853,7 @@
*/
   public Context 

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHost.java

2002-08-20 Thread costin

costin  2002/08/20 20:26:34

  Modified:catalina/src/share/org/apache/catalina Host.java
   catalina/src/share/org/apache/catalina/core
StandardHost.java
  Log:
  Part 2 of the patch to make validation configurable.
  
  Also changed to commons-logging.
  ( I have most of the classes using commons-logging, but I have
  some extra debug and timing info I need to remove - so it'll be
  gradual )
  
  Revision  ChangesPath
  1.2   +36 -4 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Host.java
  
  Index: Host.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Host.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Host.java 18 Jul 2002 16:47:37 -  1.1
  +++ Host.java 21 Aug 2002 03:26:34 -  1.2
  @@ -173,6 +173,38 @@
   public void setName(String name);
   
   
  +/**
  + * Get the server.xml host attribute's xmlNamespaceAware.
  + * @return true if namespace awarenes is enabled.
  + *
  + */
  +public boolean getXmlNamespaceAware();
  +
  +
  +/**
  + * Get the server.xml host attribute's xmlValidation.
  + * @return true if validation is enabled.
  + *
  + */
  +public boolean getXmlValidation();
  +
  +
  +/**
  + * Set the validation feature of the XML parser used when
  + * parsing xml instances.
  + * @param xmlValidation true to enable xml instance validation
  + */
  +public void setXmlValidation(boolean xmlValidation);
  +
  +
  +   /**
  + * Set the namespace aware feature of the XML parser used when
  + * parsing xml instances.
  + * @param xmlNamespaceAware true to enable namespace awareness
  + */
  +public void setXmlNamespaceAware(boolean xmlNamespaceAware);
  +
  +
   // - Public Methods
   
   
  
  
  
  1.2   +60 -7 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StandardHost.java 18 Jul 2002 16:48:08 -  1.1
  +++ StandardHost.java 21 Aug 2002 03:26:34 -  1.2
  @@ -102,7 +102,9 @@
   extends ContainerBase
   implements Deployer, Host {
   
  -
  +private static org.apache.commons.logging.Log log=
  +org.apache.commons.logging.LogFactory.getLog( StandardHost.class );
  +
   // --- Constructors
   
   
  @@ -212,6 +214,21 @@
*/
   private DefaultContext defaultContext;
   
  +
  +
  +/**
  + * Attribute value used to turn on/off XML validation
  + */
  + private boolean xmlValidation = false;
  +
  +
  +/**
  + * Attribute value used to turn on/off XML namespace awarenes.
  + */
  + private boolean xmlNamespaceAware = false;
  +
  +
  +
   
   // - Properties
   
  @@ -502,8 +519,44 @@
   
   }
   
  + /**
  + * Set the validation feature of the XML parser used when
  + * parsing xml instances.
  + * @param xmlValidation true to enable xml instance validation
  + */
  +public void setXmlValidation(boolean xmlValidation){
  +this.xmlValidation = xmlValidation;
  +}
  +
  +/**
  + * Get the server.xml host attribute's xmlValidation.
  + * @return true if validation is enabled.
  + *
  + */
  +public boolean getXmlValidation(){
  +return xmlValidation;
  +}
   
   /**
  + * Get the server.xml host attribute's xmlNamespaceAware.
  + * @return true if namespace awarenes is enabled.
  + *
  + */
  +public boolean getXmlNamespaceAware(){
  +return xmlNamespaceAware;
  +}
  +
  +
  +/**
  + * Set the namespace aware feature of the XML parser used when
  + * parsing xml instances.
  + * @param xmlNamespaceAware true to enable namespace awareness
  + */
  +public void setXmlNamespaceAware(boolean xmlNamespaceAware){
  +this.xmlNamespaceAware=xmlNamespaceAware;
  +}
  +
  +/**
* Host work directory base.
*/
   public String getWorkDir() {
  @@ -641,7 +694,7 @@
   
   // Complain if no Context has been selected
   if (context == null) {
  -log(sm.getString(standardHost.mappingError, uri));
  +log.error(sm.getString(standardHost.mappingError, uri));
   return (null);
   }
   
  @@ -726,7 +779,7 @@
   .newInstance();