cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java Catalina.java

2005-08-31 Thread remm
remm2005/08/31 07:06:40

  Modified:webapps/docs changelog.xml
   catalina/src/share/org/apache/catalina/startup Embedded.java
Catalina.java
  Log:
  - Fix FIXME: Allow configuration of stream redirection in Embedded.
  
  Revision  ChangesPath
  1.366 +3 -0  jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.365
  retrieving revision 1.366
  diff -u -r1.365 -r1.366
  --- changelog.xml 30 Aug 2005 22:39:36 -  1.365
  +++ changelog.xml 31 Aug 2005 14:06:40 -  1.366
  @@ -40,6 +40,9 @@
 
   36343: Only normalize out backslash on Windows platforms. 
(billbarker)
 
  +  
  +Allow configuring standard stream redirection (remm)
  +  
   
 
 
  
  
  
  1.28  +43 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Embedded.java 8 Dec 2004 14:34:56 -   1.27
  +++ Embedded.java 31 Aug 2005 14:06:40 -  1.28
  @@ -46,6 +46,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.tomcat.util.IntrospectionUtils;
  +import org.apache.tomcat.util.log.SystemLogHandler;
   
   
   /**
  @@ -140,6 +141,12 @@
   
   
   /**
  + * Is standard streams redirection enabled ?
  + */
  +protected boolean redirectStreams = true;
  +
  +
  +/**
* The set of Engines that have been deployed in this server.  Normally
* there will only be one.
*/
  @@ -219,6 +226,31 @@
   
   
   /**
  + * Return true if redirction of standard streams is enabled.
  + */
  +public boolean isRedirectStreams() {
  +
  +return (this.redirectStreams);
  +
  +}
  +
  +
  +/**
  + * Enables or disables naming support.
  + *
  + * @param useNaming The new use naming value
  + */
  +public void setRedirectStreams(boolean redirectStreams) {
  +
  +boolean oldRedirectStreams = this.redirectStreams;
  +this.redirectStreams = redirectStreams;
  +support.firePropertyChange("redirectStreams", new 
Boolean(oldRedirectStreams),
  +   new Boolean(this.redirectStreams));
  +
  +}
  +
  +
  +/**
* Return the default Realm for our Containers.
*/
   public Realm getRealm() {
  @@ -932,6 +964,16 @@
   
   }
   
  +
  +protected void initStreams() {
  +if (redirectStreams) {
  +// Replace System.out and System.err with a custom PrintStream
  +SystemLogHandler systemlog = new SystemLogHandler(System.out);
  +System.setOut(systemlog);
  +System.setErr(systemlog);
  +}
  +}
  +
   
   //  Private 
Methods
   
  
  
  
  1.38  +3 -7  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- Catalina.java 30 Jun 2005 13:04:34 -  1.37
  +++ Catalina.java 31 Aug 2005 14:06:40 -  1.38
  @@ -31,7 +31,6 @@
   import org.apache.catalina.core.StandardServer;
   import org.apache.tomcat.util.digester.Digester;
   import org.apache.tomcat.util.digester.Rule;
  -import org.apache.tomcat.util.log.SystemLogHandler;
   import org.xml.sax.Attributes;
   import org.xml.sax.InputSource;
   
  @@ -480,11 +479,8 @@
   return;
   }
   
  -// Replace System.out and System.err with a custom PrintStream
  -// TODO: move to Embedded, make it configurable
  -SystemLogHandler systemlog = new SystemLogHandler(System.out);
  -System.setOut(systemlog);
  -System.setErr(systemlog);
  +// Stream redirection
  +initStreams();
   
   // Start the new server
   if (server instanceof Lifecycle) {
  
  
  

-
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/startup Embedded.java

2004-12-08 Thread Shapira, Yoav

Hi,
Well, Catalina.java extends Embedded and does contain a complete working
example.  It's every bit as useful as the one in Embedded.java was.
Nonetheless, you're right that the JavaDoc update was overdue.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Jacek Laskowski [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, December 08, 2004 11:38 AM
>To: Tomcat Developers List
>Subject: Re: cvs commit: jakarta-tomcat-
>catalina/catalina/src/share/org/apache/catalina/startup Embedded.java
>
>
>[EMAIL PROTECTED] wrote:
>> yoavs   2004/12/08 06:35:58
>>
>>   Modified:catalina/src/share/org/apache/catalina/startup Tag:
>> TOMCAT_5_0 Embedded.java
>>   Log:
>>   Updated JavaDoc to reflect the fact there's no longer a complete
>example in main().
>
>I wish I knew that before I started to wire Tomcat into Geronimo ;)
>
>Jacek
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
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/startup Embedded.java

2004-12-08 Thread Jacek Laskowski
[EMAIL PROTECTED] wrote:
yoavs   2004/12/08 06:35:58
  Modified:catalina/src/share/org/apache/catalina/startup Tag:
TOMCAT_5_0 Embedded.java
  Log:
  Updated JavaDoc to reflect the fact there's no longer a complete example in 
main().
I wish I knew that before I started to wire Tomcat into Geronimo ;)
Jacek
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2004-12-08 Thread yoavs
yoavs   2004/12/08 06:35:58

  Modified:catalina/src/share/org/apache/catalina/startup Tag:
TOMCAT_5_0 Embedded.java
  Log:
  Updated JavaDoc to reflect the fact there's no longer a complete example in 
main().
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.16.2.1  +3 -9  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  --- Embedded.java 10 Jun 2004 18:59:48 -  1.16
  +++ Embedded.java 8 Dec 2004 14:35:58 -   1.16.2.1
  @@ -94,14 +94,8 @@
* To initiate a normal shutdown, call the stop() method of
* this object.
* 
  - * IMPLEMENTATION NOTE:  The main() method of
  - * this class is a simple example that exercizes the features of dynamically
  - * starting and stopping various components.  You can execute this by 
executing
  - * the following steps (on a Unix platform):
  - * 
  - *   cd $CATALINA_HOME
  - *   ./bin/catalina.sh embedded
  - * 
  + * @see org.apache.catalina.startup.Catalina#main for a complete example
  + * of how Tomcat is set up and launche as an Embedded application.
*
* @author Craig R. McClanahan
* @version $Revision$ $Date$
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2004-12-08 Thread yoavs
yoavs   2004/12/08 06:34:56

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  Updatd JavaDoc to reflect the fact there's no longer a complete example in 
main().
  
  Revision  ChangesPath
  1.27  +3 -9  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Embedded.java 3 Nov 2004 12:02:45 -   1.26
  +++ Embedded.java 8 Dec 2004 14:34:56 -   1.27
  @@ -92,14 +92,8 @@
* To initiate a normal shutdown, call the stop() method of
* this object.
* 
  - * IMPLEMENTATION NOTE:  The main() method of
  - * this class is a simple example that exercizes the features of dynamically
  - * starting and stopping various components.  You can execute this by 
executing
  - * the following steps (on a Unix platform):
  - * 
  - *   cd $CATALINA_HOME
  - *   ./bin/catalina.sh embedded
  - * 
  + * @see org.apache.catalina.startup.Catalina#main For a complete example
  + * of how Tomcat is set up and launched as an Embedded application.
*
* @author Craig R. McClanahan
* @version $Revision$ $Date$
  
  
  

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



Re: (Case 69727) cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2004-11-03 Thread techsupport
Hello,

This is an automatic notification to inform you that your inquiry has been received 
and assigned case number 69727.

Your request is important to us and we are committed to responding to your requests as 
quickly as we can. We answer e-mail on a first-in, first-out basis.

If you wish to submit any new information on your query, simply reply to this e-mail 
and type your new message at the top of the e-mail message area.  Please make sure you 
mention Case 69727 in your Subject line when you follow-up on your inquiry.

Thank you,

Mabry Software Technical Support


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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2004-11-03 Thread remm
remm2004/11/03 04:02:48

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  - Fix bug 32031: using createConnector with "http" protocol.
  
  Revision  ChangesPath
  1.26  +3 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Embedded.java 23 Oct 2004 16:54:23 -  1.25
  +++ Embedded.java 3 Nov 2004 12:02:45 -   1.26
  @@ -394,6 +394,8 @@
   connector = new Connector("org.apache.jk.server.JkCoyoteHandler");
   } else if (protocol.equals("memory")) {
   connector = new 
Connector("org.apache.coyote.memory.MemoryProtocolHandler");
  +} else if (protocol.equals("http")) {
  +connector = new Connector();
   } else if (protocol.equals("https")) {
   connector = new Connector();
   connector.setScheme("https");
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java LocalStrings.properties

2004-09-17 Thread luehe
luehe   2004/09/17 08:07:27

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
LocalStrings.properties
  Log:
  Follow established naming conventions of error strings
  
  Revision  ChangesPath
  1.23  +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Embedded.java 16 Sep 2004 22:21:45 -  1.22
  +++ Embedded.java 17 Sep 2004 15:07:27 -  1.23
  @@ -716,7 +716,7 @@
String loginMethod) {
   if (!(authenticator instanceof Valve)) {
   throw new IllegalArgumentException(
  -sm.getString("authenticator.notInstanceOfValve"));
  +sm.getString("embedded.authenticatorNotInstanceOfValve"));
   }
   if (authenticators == null) {
   synchronized (this) {
  
  
  
  1.7   +1 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/LocalStrings.properties,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LocalStrings.properties   17 Sep 2004 15:01:30 -  1.6
  +++ LocalStrings.properties   17 Sep 2004 15:07:27 -  1.7
  @@ -1,4 +1,3 @@
  -authenticator.notInstanceOfValve=Specified Authenticator is not a Valve
   contextConfig.applicationClose=Error closing application web.xml
   contextConfig.applicationConfig=Configuration error in application web.xml
   contextConfig.applicationListener=Exception creating listener of class {0}
  @@ -31,6 +30,7 @@
   embedded.alreadyStarted=Embedded service has already been started
   embedded.noEngines=No engines have been defined yet
   embedded.notStarted=Embedded service has not yet been started
  +embedded.authenticatorNotInstanceOfValve=Specified Authenticator is not a Valve
   engineConfig.cce=Lifecycle event data object {0} is not an Engine
   engineConfig.start=EngineConfig: Processing START
   engineConfig.stop=EngineConfig: Processing STOP
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java ContextConfig.java

2004-09-16 Thread luehe
luehe   2004/09/16 15:21:45

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
ContextConfig.java
  Log:
  Provide mechanism to override the login-method-to-authenticator mappings
  specified in Authenticators.properties, or provide custom Authenticator
  implementations.
  
  Revision  ChangesPath
  1.22  +40 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Embedded.java 14 Sep 2004 13:20:03 -  1.21
  +++ Embedded.java 16 Sep 2004 22:21:45 -  1.22
  @@ -21,7 +21,9 @@
   import java.io.File;
   import java.io.IOException;
   import java.net.InetAddress;
  +import java.util.HashMap;
   
  +import org.apache.catalina.Authenticator;
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
   import org.apache.catalina.Engine;
  @@ -31,6 +33,7 @@
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Loader;
   import org.apache.catalina.Realm;
  +import org.apache.catalina.Valve;
   import org.apache.catalina.connector.Connector;
   import org.apache.catalina.core.StandardContext;
   import org.apache.catalina.core.StandardEngine;
  @@ -150,6 +153,12 @@
   
   
   /**
  + * Custom mappings of login methods to authenticators
  + */
  +protected HashMap authenticators;
  +
  +
  +/**
* Descriptive information about this server implementation.
*/
   protected static final String info =
  @@ -448,6 +457,7 @@
   context.setPath(path);
   
   ContextConfig config = new ContextConfig();
  +config.setCustomAuthenticators(authenticators);
   ((Lifecycle) context).addLifecycleListener(config);
   
   return (context);
  @@ -687,6 +697,35 @@
   log.debug(" Removing this Host");
   host.getParent().removeChild(host);
   
  +}
  +
  +
  +/*
  + * Maps the specified login method to the specified authenticator, allowing
  + * the mappings in org/apache/catalina/startup/Authenticators.properties
  + * to be overridden.
  + *
  + * @param authenticator Authenticator to handle authentication for the
  + * specified login method
  + * @param loginMethod Login method that maps to the specified authenticator
  + *
  + * @throws IllegalArgumentException if the specified authenticator does not
  + * implement the org.apache.catalina.Valve interface
  + */
  +public void addAuthenticator(Authenticator authenticator,
  + String loginMethod) {
  +if (!(authenticator instanceof Valve)) {
  +throw new IllegalArgumentException(
  +sm.getString("authenticator.notInstanceOfValve"));
  +}
  +if (authenticators == null) {
  +synchronized (this) {
  +if (authenticators == null) {
  +authenticators = new HashMap();
  +}
  +}
  +}
  +authenticators.put(loginMethod, authenticator);
   }
   
   
  
  
  
  1.55  +73 -38
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.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- ContextConfig.java16 Sep 2004 15:30:33 -  1.54
  +++ ContextConfig.java16 Sep 2004 22:21:45 -  1.55
  @@ -24,6 +24,7 @@
   import java.io.InputStream;
   import java.net.URL;
   import java.util.Properties;
  +import java.util.Map;
   
   import javax.servlet.ServletContext;
   
  @@ -72,6 +73,13 @@
   
   // - Instance Variables
   
  +
  +/*
  + * Custom mappings of login methods to authenticators
  + */
  +private Map customAuthenticators;
  +
  +
   /**
* The set of Authenticators that we know how to configure.  The key is
* the name of the implemented authentication method, and the value is
  @@ -207,6 +215,17 @@
   }
   
   
  +/**
  + * Sets custom mappings of login methods to authenticators.
  + *
  + * @param customAuthenticators Custom mappings of login methods to
  + * authenticators
  + */
  +public void setCustomAuthenticators(Map customAuthenticators) {
  +this.customAuthenticators = customAuthenticators;
  +}
  +
  +
   // ---

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2004-09-14 Thread remm
remm2004/09/14 06:20:03

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  - Fix classname of the connector.
  - Remove socket factory.
  
  Revision  ChangesPath
  1.21  +2 -34 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Embedded.java 29 Aug 2004 16:46:13 -  1.20
  +++ Embedded.java 14 Sep 2004 13:20:03 -  1.21
  @@ -177,16 +177,6 @@
   
   
   /**
  - * The socket factory that will be used when a secure
  - * Connector is created.  If a standard Connector is created, the
  - * internal (to the Connector class default socket factory class)
  - * will be used instead.
  - */
  -protected String socketFactory =
  -"org.apache.catalina.net.SSLSocketFactory";
  -
  -
  -/**
* Has this component been started yet?
*/
   protected boolean started = false;
  @@ -248,28 +238,6 @@
   
   }
   
  -
  -/**
  - * Return the secure socket factory class name.
  - */
  -public String getSocketFactory() {
  -
  -return (this.socketFactory);
  -
  -}
  -
  -
  -/**
  - * Set the secure socket factory class name.
  - *
  - * @param socketFactory The new secure socket factory class name
  - */
  -public void setSocketFactory(String socketFactory) {
  -
  -this.socketFactory = socketFactory;
  -
  -}
  -
   public void setAwait(boolean b) {
   await = b;
   }
  @@ -414,7 +382,7 @@
   try {
   
   Class clazz = 
  -Class.forName("org.apache.coyote.tomcat5.CoyoteConnector");
  +Class.forName("org.apache.catalina.connector.Connector");
   connector = (Connector) clazz.newInstance();
   
   if (address != null) {
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2004-06-10 Thread luehe
luehe   2004/06/10 11:59:48

  Modified:catalina/src/share/org/apache/catalina/core
StandardService.java
   catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  Removed "debug" instance var and accessor methods from Embedded.java, which now 
inherits them from superclass
  
  Revision  ChangesPath
  1.13  +9 -7  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardService.java
  
  Index: StandardService.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardService.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StandardService.java  10 Jun 2004 01:09:03 -  1.12
  +++ StandardService.java  10 Jun 2004 18:59:48 -  1.13
  @@ -57,12 +57,6 @@
   
   
   /**
  - * The debugging detail level for this component.
  - */
  -private int debug = 0;
  -
  -
  -/**
* Descriptive information about this component implementation.
*/
   private static final String info =
  @@ -99,6 +93,12 @@
   
   
   /**
  + * The debugging detail level for this component.
  + */
  +protected int debug = 0;
  +
  +
  +/**
* The property change support for this component.
*/
   protected PropertyChangeSupport support = new PropertyChangeSupport(this);
  @@ -203,8 +203,10 @@
*/
   public void setDebug(int debug) {
   
  +int oldDebug = this.debug;
   this.debug = debug;
  -
  +support.firePropertyChange("debug", new Integer(oldDebug),
  +   new Integer(this.debug));
   }
   
   
  
  
  
  1.16  +1 -32 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Embedded.java 10 Jun 2004 18:44:28 -  1.15
  +++ Embedded.java 10 Jun 2004 18:59:48 -  1.16
  @@ -145,12 +145,6 @@
   
   
   /**
  - * The debugging detail level for this component.
  - */
  -protected int debug = 0;
  -
  -
  -/**
* Is naming enabled ?
*/
   protected boolean useNaming = true;
  @@ -219,31 +213,6 @@
   
   
   // - Properties
  -
  -
  -/**
  - * Return the debugging detail level for this component.
  - */
  -public int getDebug() {
  -
  -return (this.debug);
  -
  -}
  -
  -
  -/**
  - * Set the debugging detail level for this component.
  - *
  - * @param debug The new debugging detail level
  - */
  -public void setDebug(int debug) {
  -
  -int oldDebug = this.debug;
  -this.debug = debug;
  -support.firePropertyChange("debug", new Integer(oldDebug),
  -   new Integer(this.debug));
  -
  -}
   
   
   /**
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2004-06-10 Thread luehe
luehe   2004/06/10 11:44:29

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  Removed redundant PropertyChangeSupport instance var and related methods, which are 
inherited from superclass
  
  Revision  ChangesPath
  1.15  +1 -31 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Embedded.java 10 Jun 2004 01:09:03 -  1.14
  +++ Embedded.java 10 Jun 2004 18:44:28 -  1.15
  @@ -217,11 +217,6 @@
*/
   protected boolean await = false;
   
  -/**
  - * The property change support for this component.
  - */
  -protected PropertyChangeSupport support = new PropertyChangeSupport(this);
  -
   
   // - Properties
   
  @@ -430,18 +425,6 @@
   
   
   /**
  - * Add a property change listener to this component.
  - *
  - * @param listener The listener to add
  - */
  -public void addPropertyChangeListener(PropertyChangeListener listener) {
  -
  -support.addPropertyChangeListener(listener);
  -
  -}
  -
  -
  -/**
* Create, configure, and return a new TCP/IP socket connector
* based on the specified properties.
*
  @@ -819,19 +802,6 @@
   if( log.isDebugEnabled() )
   log.debug(" Removing this Host");
   host.getParent().removeChild(host);
  -
  -}
  -
  -
  -
  -/**
  - * Remove a property change listener from this component.
  - *
  - * @param listener The listener to remove
  - */
  -public void removePropertyChangeListener(PropertyChangeListener listener) {
  -
  -support.removePropertyChangeListener(listener);
   
   }
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2004-06-09 Thread luehe
luehe   2004/06/09 18:09:03

  Modified:catalina/src/share/org/apache/catalina/core
StandardService.java
   catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  Fixed Bugzilla 29472 ("Embedded overrides add/remove Connector, but not 
findConnectors")
  
  Revision  ChangesPath
  1.12  +23 -21
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardService.java
  
  Index: StandardService.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardService.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StandardService.java  27 Feb 2004 14:58:42 -  1.11
  +++ StandardService.java  10 Jun 2004 01:09:03 -  1.12
  @@ -57,18 +57,6 @@
   
   
   /**
  - * The set of Connectors associated with this Service.
  - */
  -private Connector connectors[] = new Connector[0];
  -
  -
  -/**
  - * The Container associated with this Service.
  - */
  -private Container container = null;
  -
  -
  -/**
* The debugging detail level for this component.
*/
   private int debug = 0;
  @@ -82,12 +70,6 @@
   
   
   /**
  - * Has this component been initialized?
  - */
  -private boolean initialized = false;
  -
  -
  -/**
* The name of this service.
*/
   private String name = null;
  @@ -122,6 +104,26 @@
   protected PropertyChangeSupport support = new PropertyChangeSupport(this);
   
   
  +/**
  + * The set of Connectors associated with this Service.
  + */
  +protected Connector connectors[] = new Connector[0];
  +
  +
  +/**
  + * The Container associated with this Service. (In the case of the
  + * org.apache.catalina.startup.Embedded subclass, this holds the most
  + * recently added Engine.)
  + */
  +protected Container container = null;
  +
  +
  +/**
  + * Has this component been initialized?
  + */
  +protected boolean initialized = false;
  +
  +
   // - Properties
   
   
  @@ -285,7 +287,7 @@
   try {
   connector.initialize();
   } catch (LifecycleException e) {
  -e.printStackTrace(System.err);
  +log.error("Connector.initialize", e);
   }
   }
   
  @@ -293,7 +295,7 @@
   try {
   ((Lifecycle) connector).start();
   } catch (LifecycleException e) {
  -;
  +log.error("Connector.start", e);
   }
   }
   
  @@ -360,7 +362,7 @@
   try {
   ((Lifecycle) connectors[j]).stop();
   } catch (LifecycleException e) {
  -;
  +log.error("Connector.stop", e);
   }
   }
   connectors[j].setContainer(null);
  
  
  
  1.14  +8 -77 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Embedded.java 27 Feb 2004 14:58:48 -  1.13
  +++ Embedded.java 10 Jun 2004 01:09:03 -  1.14
  @@ -145,12 +145,6 @@
   
   
   /**
  - * The set of Connectors that have been deployed in this server.
  - */
  -protected Connector connectors[] = new Connector[0];
  -
  -
  -/**
* The debugging detail level for this component.
*/
   protected int debug = 0;
  @@ -397,28 +391,11 @@
   throw new IllegalStateException
   (sm.getString("embedded.noEngines"));
   
  -// Configure this Connector as needed
  -connector.setContainer(engines[engines.length - 1]);
  -
  -// Add this Connector to our set of defined Connectors
  -Connector results[] = new Connector[connectors.length + 1];
  -for (int i = 0; i < connectors.length; i++)
  -results[i] = connectors[i];
  -results[connectors.length] = connector;
  -connectors = results;
  -
  -// Start this Connector if necessary
  -if (started) {
  -try {
  -connector.initialize();
  -if (connector instanceof Lifecycle) {
  -((Lifecycle) connector).start();
  -}
  -} catch (LifecycleException e) {
  -log.error("Connector.start", e);
  -}
  -}
  -
 

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2003-10-14 Thread remm
remm2003/10/14 14:34:58

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  - Canonicalize catalinaBase and catalinaHome.
  - Fix bug 23799.
  
  Revision  ChangesPath
  1.11  +22 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Embedded.java 2 Sep 2003 21:22:00 -   1.10
  +++ Embedded.java 14 Oct 2003 21:34:58 -  1.11
  @@ -64,6 +64,8 @@
   
   import java.beans.PropertyChangeListener;
   import java.beans.PropertyChangeSupport;
  +import java.io.File;
  +import java.io.IOException;
   import java.net.InetAddress;
   
   import org.apache.catalina.Connector;
  @@ -1126,12 +1128,31 @@
   }
   }
   if (catalinaHome != null) {
  +File home = new File(catalinaHome);
  +if (!home.isAbsolute()) {
  +try {
  +catalinaHome = home.getCanonicalPath();
  +} catch (IOException e) {
  +catalinaHome = home.getAbsolutePath();
  +}
  +}
   System.setProperty("catalina.home", catalinaHome);
   }
   
   if (System.getProperty("catalina.base") == null) {
   System.setProperty("catalina.base",
  System.getProperty("catalina.home"));
  +} else {
  +String catalinaBase = System.getProperty("catalina.base");
  +File base = new File(catalinaBase);
  +if (!base.isAbsolute()) {
  +try {
  +catalinaBase = base.getCanonicalPath();
  +} catch (IOException e) {
  +catalinaBase = base.getAbsolutePath();
  +}
  +}
  +System.setProperty("catalina.base", catalinaBase);
   }
   
   }
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2003-08-14 Thread remm
remm2003/08/12 02:04:09

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  - Remove extra setLogger call in createContext.
  
  Revision  ChangesPath
  1.9   +1 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Embedded.java 16 Jul 2003 00:18:11 -  1.8
  +++ Embedded.java 12 Aug 2003 09:04:08 -  1.9
  @@ -646,7 +646,6 @@
   context.setDebug(debug);
   context.setDocBase(docBase);
   context.setPath(path);
  - context.setLogger(logger);
   
   ContextConfig config = new ContextConfig();
   config.setDebug(debug);
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2003-07-15 Thread luehe
luehe   2003/07/15 17:18:11

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  - Added Embedded.createConnector() methods that take address of type
String (instead of java.net.InetAddress), since the InetAddress is
always converted to a string (and stored with the Connector's
properties) anyways
  
  - Fixed problem that was caused by the fact that the InetAddress
passed to Embedded.createConnector() was converted to a string using
InetAddress.toString(), and added to the Connector's
properties. However, InetAddress.toString() returns a string of the
form "/".
  
Setting the address property on the underlying Http11Protocol would
always fail, because IntrospectionUtils.setProperty() would parse the
address string into an InetAddress like this:
  
  InetAddress.getByName(value);
  
which throws a java.net.UnknownHostException (due to "value" being of
the form "/"). Unfortunately, the exception is
being swallowed.
  
The fix in Embedded.createConnector() checks of the address string
contains a '/', and only stores the IP part of the address with the
Connector's properties.
  
  Revision  ChangesPath
  1.8   +35 -10
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Embedded.java 29 May 2003 16:59:35 -  1.7
  +++ Embedded.java 16 Jul 2003 00:18:11 -  1.8
  @@ -516,33 +516,58 @@
* Create, configure, and return a new TCP/IP socket connector
* based on the specified properties.
*
  - * @param address InetAddress to listen to, or null
  - *  to listen on all address on this server
  + * @param address InetAddress to bind to, or null if the
  + * connector is supposed to bind to all addresses on this server
* @param port Port number to listen to
  - * @param secure Should this port be SSL-enabled?
  + * @param secure true if the generated connector is supposed to be
  + * SSL-enabled, and false otherwise
*/
   public Connector createConnector(InetAddress address, int port,
boolean secure) {
  + return createConnector(address != null? address.toString() : null,
  +port, secure);
  +}
   
  -if( log.isDebugEnabled() )
  -log.debug("Creating connector for address='" +
  -   ((address == null) ? "ALL" : address.getHostAddress()) +
  -   "' port='" + port + "' secure='" + secure + "'");
  -
  +public Connector createConnector(String address, int port,
  + boolean secure) {
   String protocol = "http";
   if (secure) {
   protocol = "https";
   }
   
   return createConnector(address, port, protocol);
  -
   }
   
   
   public Connector createConnector(InetAddress address, int port,
String protocol) {
  + return createConnector(address != null? address.toString() : null,
  +port, protocol);
  +}
  +
  +public Connector createConnector(String address, int port,
  +  String protocol) {
   
   Connector connector = null;
  +
  + if (address != null) {
  + /*
  +  * InetAddress.toString() returns a string of the form
  +  * "/". Get the latter part, so that the
  +  * address can be parsed (back) into an InetAddress using
  +  * InetAddress.getByName().
  +  */
  + int index = address.indexOf('/');
  + if (index != -1) {
  + address = address.substring(index + 1);
  + }
  + }
  +
  + if (log.isDebugEnabled()) {
  +log.debug("Creating connector for address='" +
  +   ((address == null) ? "ALL" : address) +
  +   "' port='" + port + "' protocol='" + protocol + "'");
  + }
   
   try {
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2003-05-30 Thread luehe
luehe   2003/05/29 09:59:36

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  Have all contexts inherit Embedded's logger, as mentioned in
  Embedded's constructor:
  
* @param logger Logger implementation to be inherited by all components
*  (unless overridden further down the container hierarchy)
  
  This fixes Bugtraq 4866227 ("Nothing is written to the server.log file
  when calling ServletContext.log")
  
  Revision  ChangesPath
  1.7   +2 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Embedded.java 20 Mar 2003 23:36:13 -  1.6
  +++ Embedded.java 29 May 2003 16:59:35 -  1.7
  @@ -621,6 +621,7 @@
   context.setDebug(debug);
   context.setDocBase(docBase);
   context.setPath(path);
  + context.setLogger(logger);
   
   ContextConfig config = new ContextConfig();
   config.setDebug(debug);
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2003-03-20 Thread costin
costin  2003/03/20 15:36:14

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  Few small enhancements.
  
  Make Embedded extend StandardService. It includes an Engine and connectors -
  just like Service. This will allow us to harmonize the 2 use cases.
  ( I'm also adding code to create a StandardServer if none is found - so exactly
  the same object model and JMX naming will be used in both embeded and standalone )
  
  Also removed the test main().
  
  Revision  ChangesPath
  1.6   +25 -117   
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Embedded.java 7 Feb 2003 01:07:13 -   1.5
  +++ Embedded.java 20 Mar 2003 23:36:13 -  1.6
  @@ -1,7 +1,4 @@
   /*
  - * $Header$
  - * $Revision$
  - * $Date$
*
* 
*
  @@ -68,8 +65,6 @@
   import java.beans.PropertyChangeListener;
   import java.beans.PropertyChangeSupport;
   import java.net.InetAddress;
  -import java.util.Enumeration;
  -import java.util.Properties;
   
   import org.apache.tomcat.util.IntrospectionUtils;
   
  @@ -79,18 +74,18 @@
   import org.apache.catalina.Engine;
   import org.apache.catalina.Host;
   import org.apache.catalina.Lifecycle;
  -import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Loader;
   import org.apache.catalina.Logger;
   import org.apache.catalina.Realm;
  +import org.apache.catalina.Service;
   import org.apache.catalina.core.StandardContext;
   import org.apache.catalina.core.StandardEngine;
   import org.apache.catalina.core.StandardHost;
  +import org.apache.catalina.core.StandardService;
   import org.apache.catalina.loader.WebappLoader;
   import org.apache.catalina.logger.FileLogger;
  -import org.apache.catalina.logger.SystemOutLogger;
   import org.apache.catalina.net.ServerSocketFactory;
   import org.apache.catalina.realm.MemoryRealm;
   import org.apache.catalina.security.SecurityConfig;
  @@ -99,6 +94,10 @@
   import org.apache.commons.logging.LogFactory;
   import org.apache.commons.logging.Log;
   
  +import javax.management.ObjectName;
  +import javax.naming.InitialContext;
  +import javax.naming.NamingException;
  +
   
   /**
* Convenience class to embed a Catalina servlet container environment
  @@ -157,7 +156,7 @@
* @version $Revision$ $Date$
*/
   
  -public class Embedded implements Lifecycle {
  +public class Embedded  extends StandardService implements Lifecycle {
   private static Log log = LogFactory.getLog(Embedded.class);
   
   // --- Constructors
  @@ -410,7 +409,6 @@
   }
   
   public void setCatalinaHome( String s ) {
  -System.out.println("Setting home "+ s);
   System.setProperty( "catalina.home", s);
   }
   
  @@ -418,11 +416,17 @@
   System.setProperty( "catalina.base", s);
   }
   
  +public String getCatalinaHome() {
  +return System.getProperty("catalina.home");
  +}
  +
  +public String getCatalinaBase() {
  +return System.getProperty("catalina.base");
  +}
   
   
   // - Public Methods
   
  -
   /**
* Add a new Connector to the set of defined Connectors.  The newly
* added Connector will be associated with the most recently added Engine.
  @@ -583,7 +587,6 @@
   
   }
   
  -
   /**
* Create, configure, and return a Context that will process all
* HTTP requests received from one of the associated Connectors,
  @@ -974,12 +977,15 @@
*/
   public void start() throws LifecycleException {
   
  -if( log.isDebugEnabled() )
  -log.debug("Starting embedded server");
  +if( log.isInfoEnabled() )
  +log.info("Starting tomcat server");
   
   // Validate the setup of our required system properties
   initDirs();
   
  +// Initialize some naming specific properties
  +initNaming();
  +
   // Validate and update our current component state
   if (started)
   throw new LifecycleException
  @@ -987,21 +993,6 @@
   lifecycle.fireLifecycleEvent(START_EVENT, null);
   started = true;
   
  -// Initialize some naming specific properties
  -if (!useNaming) {
  -System.setProperty("catalina.useNaming", "false");
  -} else {
  -System.setProperty("catalina.useNaming", "true");
  -Str

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java Catalina.java

2003-02-06 Thread jfarcand
jfarcand2003/02/06 17:07:14

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
Catalina.java
  Log:
  Move the security configuration inside Embedded to allow security protection when 
this class is used.
  
  Revision  ChangesPath
  1.5   +15 -5 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Embedded.java 14 Jan 2003 22:41:01 -  1.4
  +++ Embedded.java 7 Feb 2003 01:07:13 -   1.5
  @@ -93,6 +93,7 @@
   import org.apache.catalina.logger.SystemOutLogger;
   import org.apache.catalina.net.ServerSocketFactory;
   import org.apache.catalina.realm.MemoryRealm;
  +import org.apache.catalina.security.SecurityConfig;
   import org.apache.catalina.util.LifecycleSupport;
   import org.apache.catalina.util.StringManager;
   import org.apache.commons.logging.LogFactory;
  @@ -185,7 +186,8 @@
   super();
   setLogger(logger);
   setRealm(realm);
  -
  +setSecurityProtection();
  +
   }
   
   
  @@ -1238,5 +1240,13 @@
   
   }
   
  +/**
  + * Set the security package access/protection.
  + */
  +protected void setSecurityProtection(){
  +SecurityConfig securityConfig = SecurityConfig.newInstance();
  +securityConfig.setPackageDefinition();
  +securityConfig.setPackageAccess();
  +}
   
   }
  
  
  
  1.14  +4 -9  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Catalina.java 29 Jan 2003 22:32:09 -  1.13
  +++ Catalina.java 7 Feb 2003 01:07:13 -   1.14
  @@ -75,7 +75,6 @@
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.Server;
   import org.apache.catalina.core.StandardServer;
  -import org.apache.catalina.security.SecurityConfig;
   import org.apache.commons.digester.Digester;
   import org.apache.commons.digester.Rule;
   import org.apache.tomcat.util.log.SystemLogHandler;
  @@ -486,10 +485,6 @@
   long t2 = System.currentTimeMillis();
   log.debug( "Server.xml processed " + (t2 - t1));
   
  -// TODO: move to Embedded
  -SecurityConfig securityConfig = SecurityConfig.newInstance();
  -securityConfig.setPackageDefinition();
  -securityConfig.setPackageAccess();
   
   // Replace System.out and System.err with a custom PrintStream
   // TODO: move to Embedded, make it configurable
  
  
  

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




cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2003-01-14 Thread remm
remm2003/01/14 14:41:01

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  - Oops.
  
  Revision  ChangesPath
  1.4   +7 -16 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Embedded.java 14 Jan 2003 22:39:42 -  1.3
  +++ Embedded.java 14 Jan 2003 22:41:01 -  1.4
  @@ -1140,18 +1140,6 @@
new MemoryRealm());
   embedded.setDebug(5);
   embedded.setLogger(new SystemOutLogger());
  -/*
  -String home = System.getProperty("catalina.home");
  -if (home == null) {
  -System.err.println("You must set the 'catalina.home' system property");
  -System.exit(1);
  -}
  -String base = System.getProperty("catalina.base");
  -if (base == null) {
  -base = home;
  -System.setProperty("catalina.base", base);
  -}
  -*/
   
   // Start up this embedded server (to prove we can dynamically
   // add and remove containers and connectors later)
  @@ -1161,6 +1149,9 @@
   System.err.println("start: " + e.toString());
   e.printStackTrace();
   }
  +
  +String home = System.getProperty("catalina.home");
  +String base = System.getProperty("catalina.base");
   
   // Assemble and install a very basic container hierarchy
   // that simulates a portion of the one configured in server.xml
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2003-01-14 Thread remm
remm2003/01/14 14:39:43

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  - Update connectors section.
  - Beautify.
  
  Revision  ChangesPath
  1.3   +35 -31
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Embedded.java 5 Dec 2002 15:53:57 -   1.2
  +++ Embedded.java 14 Jan 2003 22:39:42 -  1.3
  @@ -541,7 +541,7 @@
   try {
   
   Class clazz = 
  -Class.forName("org.apache.coyote.tomcat4.CoyoteConnector");
  +Class.forName("org.apache.coyote.tomcat5.CoyoteConnector");
   connector = (Connector) clazz.newInstance();
   
   if (address != null) {
  @@ -549,19 +549,21 @@
  "" + address);
   }
   IntrospectionUtils.setProperty(connector, "port", "" + port);
  -IntrospectionUtils.setProperty(connector, "useURIValidationHack", 
  -   "" + false);
   
   if (protocol.equals("ajp")) {
   IntrospectionUtils.setProperty
   (connector, "protocolHandlerClassName",
"org.apache.jk.server.JkCoyoteHandler");
  +} else if (protocol.equals("memory")) {
  +IntrospectionUtils.setProperty
  +(connector, "protocolHandlerClassName",
  + "org.apache.coyote.memory.MemoryProtocolHandler");
   } else if (protocol.equals("https")) {
   connector.setScheme("https");
   connector.setSecure(true);
   try {
   Class serverSocketFactoryClass = Class.forName
  -("org.apache.coyote.tomcat4.CoyoteServerSocketFactory");
  +   ("org.apache.coyote.tomcat5.CoyoteServerSocketFactory");
   ServerSocketFactory factory = 
   (ServerSocketFactory) 
   serverSocketFactoryClass.newInstance();
  @@ -1052,6 +1054,7 @@
   
   // -- Protected Methods
   
  +
   /** Initialize naming - this should only enable java:env and root naming.
* If tomcat is embeded in an application that already defines those -
* it shouldn't do it.
  @@ -1085,37 +1088,36 @@
   }
   }
   
  +
   protected void initDirs() {
  -String catalinaHome=System.getProperty("catalina.home");
  -if ( catalinaHome== null) {
  +
  +String catalinaHome = System.getProperty("catalina.home");
  +if (catalinaHome == null) {
   // Backwards compatibility patch for J2EE RI 1.3
   String j2eeHome = System.getProperty("com.sun.enterprise.home");
  -if (j2eeHome != null)
  +if (j2eeHome != null) {
   catalinaHome=System.getProperty("com.sun.enterprise.home");
  -else if( System.getProperty("catalina.base") !=null ) {
  -catalinaHome=System.getProperty("catalina.base" );
  +} else if (System.getProperty("catalina.base") != null) {
  +catalinaHome = System.getProperty("catalina.base");
   } else {
  -// Original embeded behavior
  -//throw new LifecycleException
  -//("Must set 'catalina.home' system property");
  -// Catalina behavior
  -//System.setProperty("catalina.home",
  -//System.getProperty("user.dir"));
  -// use IntrospectionUtils and guess the dir
  -catalinaHome=IntrospectionUtils.guessInstall("catalina.home",
  -   "catalina.base","catalina.jar");
  -if( catalinaHome==null)
  -catalinaHome=IntrospectionUtils.guessInstall("tomcat.install",
  -   "catalina.home","tomcat.jar");
  -
  +// Use IntrospectionUtils and guess the dir
  +catalinaHome = IntrospectionUtils.guessInstall
  +("catalina.home", "catalina.base", "catalina.jar");
  +if (catalinaHome == null) {
  +catalinaHome = IntrospectionUtils.guessInstall
  +("tomcat.install", "catalina.home", "tomcat.jar");
  +}
   }
   }
  -if( catalinaHome!=null )
  -System.setProperty( "catalin.home", catalinaHome);
  +if (catalinaHome != null) {
  

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Embedded.java

2002-12-05 Thread costin
costin  2002/12/05 07:53:57

  Modified:catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  Move to c-l.
  
  A bit of refactoring in catalina.home initialization - to make it
  consistent to Catalina ( the server.xml init ). Also added a check with
  IntrospectionUtils ( using the classpath ).
  
  I added some methods from Catalina, again - to make them more consistent.
  Catalina will extend Embeded and add only the server.xml processing.
  
  Please review and let me know if you don't like it !
  
  Revision  ChangesPath
  1.2   +142 -65   
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Embedded.java 18 Jul 2002 16:47:49 -  1.1
  +++ Embedded.java 5 Dec 2002 15:53:57 -   1.2
  @@ -95,6 +95,8 @@
   import org.apache.catalina.realm.MemoryRealm;
   import org.apache.catalina.util.LifecycleSupport;
   import org.apache.catalina.util.StringManager;
  +import org.apache.commons.logging.LogFactory;
  +import org.apache.commons.logging.Log;
   
   
   /**
  @@ -155,7 +157,7 @@
*/
   
   public class Embedded implements Lifecycle {
  -
  +private static Log log = LogFactory.getLog(Embedded.class);
   
   // --- Constructors
   
  @@ -264,6 +266,10 @@
*/
   protected boolean started = false;
   
  +/**
  + * Use await.
  + */
  +protected boolean await = false;
   
   /**
* The property change support for this component.
  @@ -393,6 +399,24 @@
   
   }
   
  +public void setAwait(boolean b) {
  +await = b;
  +}
  +
  +public boolean isAwait() {
  +return await;
  +}
  +
  +public void setCatalinaHome( String s ) {
  +System.out.println("Setting home "+ s);
  +System.setProperty( "catalina.home", s);
  +}
  +
  +public void setCatalinaBase( String s ) {
  +System.setProperty( "catalina.base", s);
  +}
  +
  +
   
   // - Public Methods
   
  @@ -407,8 +431,8 @@
*/
   public synchronized void addConnector(Connector connector) {
   
  -if (debug >= 1) {
  -logger.log("Adding connector (" + connector.getInfo() + ")");
  +if( log.isDebugEnabled() ) {
  +log.debug("Adding connector (" + connector.getInfo() + ")");
   }
   
   // Make sure we have a Container to send requests to
  @@ -434,7 +458,7 @@
   ((Lifecycle) connector).start();
   }
   } catch (LifecycleException e) {
  -logger.log("Connector.start", e);
  +log.error("Connector.start", e);
   }
   }
   
  @@ -448,8 +472,8 @@
*/
   public synchronized void addEngine(Engine engine) {
   
  -if (debug >= 1)
  -logger.log("Adding engine (" + engine.getInfo() + ")");
  +if( log.isDebugEnabled() )
  +log.debug("Adding engine (" + engine.getInfo() + ")");
   
   // Add this Engine to our set of defined Engines
   Engine results[] = new Engine[engines.length + 1];
  @@ -463,7 +487,7 @@
   try {
   ((Lifecycle) engine).start();
   } catch (LifecycleException e) {
  -logger.log("Engine.start", e);
  +log.error("Engine.start", e);
   }
   }
   
  @@ -494,8 +518,8 @@
   public Connector createConnector(InetAddress address, int port,
boolean secure) {
   
  -if (debug >= 1)
  -logger.log("Creating connector for address='" +
  +if( log.isDebugEnabled() )
  +log.debug("Creating connector for address='" +
  ((address == null) ? "ALL" : address.getHostAddress()) +
  "' port='" + port + "' secure='" + secure + "'");
   
  @@ -543,12 +567,12 @@
   serverSocketFactoryClass.newInstance();
   connector.setFactory(factory);
   } catch (Exception e) {
  -logger.log("Couldn't load SSL server socket factory.");
  +log.error("Couldn't load SSL server socket factory.");
   }
   }
   
   } catch (Exception e) {
  -logger.log("Couldn't create connector.");
  +log.error("Couldn't create connector.");
   } 
   
   return (connector);
  @@ -581,8 +605,8 @@
*/
   public Context createContext(String path, String docBase) {
   
  -if (debu