View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.engine;
18  
19  import javax.servlet.ServletConfig;
20  
21  import org.apache.jetspeed.PortalContext;
22  import org.apache.jetspeed.components.ComponentManager;
23  import org.apache.jetspeed.exception.JetspeedException;
24  import org.apache.jetspeed.pipeline.Pipeline;
25  import org.apache.jetspeed.request.RequestContext;
26  import org.apache.pluto.services.PortletContainerEnvironment;
27  import org.apache.pluto.services.factory.FactoryManagerService;
28  
29  
30  /***
31   * Engine Abstraction - to run from both unit tests and servlet
32   *
33   * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
34   * @version $Id: Engine.java 187178 2004-08-02 19:00:15Z weaver $
35   */
36  public interface Engine extends JetspeedEngineConstants, FactoryManagerService, PortletContainerEnvironment 
37  {
38      /***
39       * Initializes the engine with a commons configuration, starting all early initable services.
40       *
41       * @throws JetspeedException when the engine fails to initilialize
42       */
43      public void start()
44         throws JetspeedException;
45  
46      
47      /***
48       * Shuts down the Jetspeed engine and all associated services
49       *
50       * @throws JetspeedException when the engine fails to shutdown
51       */
52      public void shutdown()
53         throws JetspeedException;
54  
55      /***
56       * Makes a service request to the engine.
57       *
58       * @param context a <code>RequestContext</code> with the state of the request.
59       * @throws JetspeedException when the engine fails to initilialize
60       */
61      public void service(RequestContext context)
62         throws JetspeedException;
63  
64      /***
65       * Gets the engine's request default pipeline.
66       * 
67       * @return Pipeline The engine's request pipeline.
68       */
69      public Pipeline getPipeline();
70   
71      /***
72       * Gets the specified engine's request pipeline.
73       * 
74       * @return Pipeline A specific request pipeline.
75       */ 
76      public Pipeline getPipeline(String pipelineName);
77   
78      /***
79       * Get the Portal Context associated with running thread of the engine
80       * 
81       * @return PortalContext associated with this engine's thread
82       */
83      public PortalContext getContext();
84  
85      /***
86       * Gets the real path to an application relative resource
87       * 
88       * @param path The application relative resource 
89       * @return String The real path to that resource
90       */
91      public String getRealPath(String path);
92      
93      /***
94       * Get the servlet configuration if this engine is running under a servlet container.
95       * 
96       * @return config The servlet configuration
97       */    
98      public ServletConfig getServletConfig();
99      
100     /***
101      * Returns the the RequestContext associated with the current
102      * thread.  This can be accessed throught <code>org.apache.jetspeed.Jetspeed</code>
103      * environment class.
104      * @return RequestContext associated with the current thread.
105      */
106     public RequestContext getCurrentRequestContext();
107 
108     public ComponentManager getComponentManager();
109     
110     
111 
112 }