proyal 2003/02/13 06:13:44 Modified: sevak/src/java/org/apache/avalon/apps/sevak Sevak.java Added: sevak/src/java/org/apache/avalon/apps/sevak SevakContext.java Log: Contribution from Ben Hogan * Allow a SevakContext to be passed to the deploy method * SevakContext holds a ServiceManager, Logger and Context to be applied to web applications Revision Changes Path 1.5 +55 -14 avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/Sevak.java Index: Sevak.java =================================================================== RCS file: /home/cvs/avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/Sevak.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Sevak.java 12 Jan 2003 14:17:40 -0000 1.4 +++ Sevak.java 13 Feb 2003 14:13:44 -0000 1.5 @@ -1,18 +1,59 @@ /* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE file. - */ -package org.apache.avalon.apps.sevak; -import org.apache.avalon.framework.service.ServiceManager; + ============================================================================ + The Apache Software License, Version 1.1 + ============================================================================ + + Copyright (C) @year@ The Apache Software Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modifica- + tion, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: "This product includes software + developed by the Apache Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if + and wherever such third-party acknowledgments normally appear. + + 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation" + must not be used to endorse or promote products derived from this software + without prior written permission. For written permission, please contact + [EMAIL PROTECTED] + + 5. Products derived from this software may not be called "Apache", nor may + "Apache" appear in their name, without prior written permission of the + Apache Software Foundation. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + This software consists of voluntary contributions made by many individuals + on behalf of the Apache Software Foundation. For more information on the + Apache Software Foundation, please see <http://www.apache.org/>. + +*/ +package org.apache.avalon.apps.sevak; import java.io.File; /** - * Web Server Interface (Catalina is the target implementation) + * Sevak defines an interface that servlet containers can be wrapped behind + * * @author Vinay Chandrasekharan<[EMAIL PROTECTED]> * @version 1.0 */ @@ -27,16 +68,17 @@ * @param pathToWebAppFolder path can be a war-archive or exploded directory * @throws SevakException Thrown when context already exists */ - void deploy(String context, File pathToWebAppFolder) throws SevakException; + void deploy( String context, File pathToWebAppFolder ) throws SevakException; /** * Deploy the given Web Application * @param context Context for the the webapp * @param pathToWebAppFolder path can be a war-archive or exploded directory - * @param serviceManager The service manager to use for (optional) Serviceable servlets. + * @param sevakContext the context that is applied to the servlet on instantiation. * @throws SevakException Thrown when context already exists */ - void deploy(String context, File pathToWebAppFolder, ServiceManager serviceManager) throws SevakException; + void deploy( String context, File pathToWebAppFolder, SevakContext sevakContext ) + throws SevakException; /** @@ -44,6 +86,5 @@ * @param context Context for the the webapp * @throws SevakException Thrown if context does NOT exist */ - void undeploy(String context) throws SevakException; - + void undeploy( String context ) throws SevakException; } 1.1 avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/SevakContext.java Index: SevakContext.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) @year@ The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact [EMAIL PROTECTED] 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more information on the Apache Software Foundation, please see <http://www.apache.org/>. */ package org.apache.avalon.apps.sevak; import org.apache.avalon.framework.logger.Logger; import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.context.Context; /** * Holder class for objects to be used when creating servlets under Sevak * * If a servlet is LogEnabled then the logger is set on the servlet. * If a servlet is Servicable then the serviceManager is set on the servlet. * If a servlet is Contextualizable then the context is set on the servlet * @author Ben Hogan */ public class SevakContext { private ServiceManager m_serviceManager; private Logger m_logger; private Context m_context; public SevakContext( Context context, ServiceManager serviceManager, Logger logger ) { m_context = context; m_serviceManager = serviceManager; m_logger = logger; } public ServiceManager getServiceManager() { return m_serviceManager; } public Logger getLogger() { return m_logger; } public Context getContext() { return m_context; } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]