001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.engine;
018:
019: import javax.servlet.ServletConfig;
020:
021: import org.apache.jetspeed.PortalContext;
022: import org.apache.jetspeed.components.ComponentManager;
023: import org.apache.jetspeed.exception.JetspeedException;
024: import org.apache.jetspeed.pipeline.Pipeline;
025: import org.apache.jetspeed.request.RequestContext;
026: import org.apache.pluto.services.PortletContainerEnvironment;
027: import org.apache.pluto.services.factory.FactoryManagerService;
028:
029: /**
030: * Engine Abstraction - to run from both unit tests and servlet
031: *
032: * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
033: * @version $Id: Engine.java 187178 2004-08-02 19:00:15Z weaver $
034: */
035: public interface Engine extends JetspeedEngineConstants,
036: FactoryManagerService, PortletContainerEnvironment {
037: /**
038: * Initializes the engine with a commons configuration, starting all early initable services.
039: *
040: * @throws JetspeedException when the engine fails to initilialize
041: */
042: public void start() throws JetspeedException;
043:
044: /**
045: * Shuts down the Jetspeed engine and all associated services
046: *
047: * @throws JetspeedException when the engine fails to shutdown
048: */
049: public void shutdown() throws JetspeedException;
050:
051: /**
052: * Makes a service request to the engine.
053: *
054: * @param context a <code>RequestContext</code> with the state of the request.
055: * @throws JetspeedException when the engine fails to initilialize
056: */
057: public void service(RequestContext context)
058: throws JetspeedException;
059:
060: /**
061: * Gets the engine's request default pipeline.
062: *
063: * @return Pipeline The engine's request pipeline.
064: */
065: public Pipeline getPipeline();
066:
067: /**
068: * Gets the specified engine's request pipeline.
069: *
070: * @return Pipeline A specific request pipeline.
071: */
072: public Pipeline getPipeline(String pipelineName);
073:
074: /**
075: * Get the Portal Context associated with running thread of the engine
076: *
077: * @return PortalContext associated with this engine's thread
078: */
079: public PortalContext getContext();
080:
081: /**
082: * Gets the real path to an application relative resource
083: *
084: * @param path The application relative resource
085: * @return String The real path to that resource
086: */
087: public String getRealPath(String path);
088:
089: /**
090: * Get the servlet configuration if this engine is running under a servlet container.
091: *
092: * @return config The servlet configuration
093: */
094: public ServletConfig getServletConfig();
095:
096: /**
097: * Returns the the RequestContext associated with the current
098: * thread. This can be accessed throught <code>org.apache.jetspeed.Jetspeed</code>
099: * environment class.
100: * @return RequestContext associated with the current thread.
101: */
102: public RequestContext getCurrentRequestContext();
103:
104: public ComponentManager getComponentManager();
105:
106: }
|