KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > frontends > ComposableServlet


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.phoenix.frontends;
9
10 import javax.servlet.ServletException JavaDoc;
11 import javax.servlet.http.HttpServlet JavaDoc;
12 import org.apache.avalon.excalibur.i18n.ResourceManager;
13 import org.apache.avalon.excalibur.i18n.Resources;
14 import org.apache.avalon.framework.component.ComponentException;
15 import org.apache.avalon.framework.component.ComponentManager;
16 import org.apache.avalon.framework.component.Composable;
17 import org.apache.avalon.phoenix.components.embeddor.SingleAppEmbeddor;
18 import org.apache.avalon.phoenix.interfaces.Embeddor;
19
20 /**
21  * WARNING: DO NOT USE THIS SERVLET FOR PRODUCTION SERVICE. THIS IS EXPERIMENTAL.
22  * Composable servlet for easy life with <tt>PhoenixServlet</tt>.
23  *
24  * @author <a HREF="mailto:colus@apache.org">Eung-ju Park</a>
25  * @deprecated
26  */

27 public abstract class ComposableServlet
28     extends HttpServlet JavaDoc
29     implements Composable
30 {
31     private static final Resources REZ =
32         ResourceManager.getPackageResources( ComposableServlet.class );
33
34     private SingleAppEmbeddor m_embeddor;
35
36     public void init()
37         throws ServletException JavaDoc
38     {
39         super.init();
40
41         m_embeddor = (SingleAppEmbeddor)getServletContext().getAttribute( Embeddor.ROLE );
42         if( null == m_embeddor )
43         {
44             final String JavaDoc message = REZ.getString( "servlet.error.load" );
45             throw new ServletException JavaDoc( message );
46         }
47
48         try
49         {
50             compose( m_embeddor );
51         }
52         catch( final ComponentException ce )
53         {
54             throw new ServletException JavaDoc( ce );
55         }
56     }
57
58     public void compose( final ComponentManager componentManager )
59         throws ComponentException
60     {
61     }
62 }
63
Popular Tags