Class TurbineConfig
- All Implemented Interfaces:
- jakarta.servlet.ServletConfig,- jakarta.servlet.ServletContext,- org.apache.avalon.framework.activity.Disposable,- org.apache.avalon.framework.activity.Initializable
- Direct Known Subclasses:
- TurbineXmlConfig
If you need to use Turbine outside of a servlet container, you can use this class for initialization of the Turbine servlet.
 TurbineConfig config = new TurbineConfig(".", "conf/TurbineResources.properties");
 
 All paths referenced in TurbineResources.properties and the path to the properties file itself (the second argument) will be resolved relative to the directory given as the first argument of the constructor, here - the directory where application was started. Don't worry about discarding the references to objects created above. They are not needed, once everything is initialized.
 In order to initialize the Services Framework outside of the Turbine Servlet,
 you need to call the init() method. By default, this will
 initialize the Resource and Logging Services and any other services you
 have defined in your TurbineResources.properties file.
 
- Version:
- $Id$
- Author:
- Quinton McCombs, Rafal Krzewski, Jon S. Stevens, Daniel Rall, Henning P. Schmiedehausen, Eric Pugh
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionServlet container (or emulator) attributes.static final StringServlet initialization parameter name for the path to TurbineConfiguration.xml file used by TurbineTurbine servlet initialization parameters.static final StringDefault value of TurbineResources.properties file path (/WEB-INF/conf/TurbineResources.properties).static final StringServlet initialization parameter name for the path to Turbine.properties file used by Turbineprotected FileFilenames are looked up in this directory.protected intFields inherited from interface jakarta.servlet.ServletContextORDERED_LIBS, TEMPDIR
- 
Constructor SummaryConstructorsConstructorDescriptionTurbineConfig(String path, String properties) Constructs a TurbineConfig.Constructs a new TurbineConfig.TurbineConfig(String path, Map<String, String> initParams) Constructs a new TurbineConfig.
- 
Method SummaryModifier and TypeMethodDescriptionjakarta.servlet.FilterRegistration.DynamicNot implemented.jakarta.servlet.FilterRegistration.DynamicNot implemented.jakarta.servlet.FilterRegistration.DynamicNot implemented.jakarta.servlet.ServletRegistration.DynamicaddJspFile(String servletName, String jspFile) voidaddListener(Class<? extends EventListener> listenerClass) Not implemented.voidaddListener(String className) Not implemented.<T extends EventListener>
 voidaddListener(T t) Not implemented.jakarta.servlet.ServletRegistration.DynamicaddServlet(String servletName, jakarta.servlet.Servlet servlet) Not implemented.jakarta.servlet.ServletRegistration.DynamicaddServlet(String servletName, Class<? extends jakarta.servlet.Servlet> servletClass) Not implemented.jakarta.servlet.ServletRegistration.DynamicaddServlet(String servletName, String className) Not implemented.<T extends jakarta.servlet.Filter>
 TcreateFilter(Class<T> clazz) Not implemented.<T extends EventListener>
 TcreateListener(Class<T> clazz) Not implemented.<T extends jakarta.servlet.Servlet>
 TcreateServlet(Class<T> clazz) Not implemented.voiddeclareRoles(String... roleNames) Not implemented.voiddispose()Shutdown the Turbine System, lifecycle styleReturns the servlet container attribute with the given name, or null if there is no attribute by that name.Returns an Enumeration containing the attribute names available within this servlet context.Not implemented.jakarta.servlet.ServletContextgetContext(String s) Not implemented.Returns the context path.Set<jakarta.servlet.SessionTrackingMode> Not implemented.intNot implemented.intNot implemented.Set<jakarta.servlet.SessionTrackingMode> Not implemented.jakarta.servlet.FilterRegistrationgetFilterRegistration(String filterName) Not implemented.Not implemented.getInitParameter(String name) Retrieves an initialization parameter.Retrieves an Enumeration of initialization parameter names.jakarta.servlet.descriptor.JspConfigDescriptorNot implemented.intNot implemented.Not implemented.intNot implemented.jakarta.servlet.RequestDispatcherNot implemented.getRealPath(String path) Translates a path relative to the web application root into an absolute path.jakarta.servlet.RequestDispatcherNot implemented.Returns a URL to the resource that is mapped to a specified path.Returns the resource located at the named path as anInputStreamobject.Not implemented.Not implemented.jakarta.servlet.ServletContextReturns a reference to the object cast onto ServletContext type.Returns the context name.Returns the servlet name.jakarta.servlet.ServletRegistrationgetServletRegistration(String servletName) Not implemented.Not implemented.jakarta.servlet.SessionCookieConfigNot implemented.intReturns a reference to the Turbine servlet that was initialized.Not implemented.voidInitialization requiring a HTTPGETrequest.voidCauses this class to initialize itself which in turn initializes all of the Turbine Services that need to be initialized.voidLogs a message.voidLogs an error message.voidNot implemented.voidsetAttribute(String s, Object o) Not implemented.booleansetInitParameter(String name, String value) Not implemented.voidsetRequestCharacterEncoding(String encoding) voidsetResponseCharacterEncoding(String encoding) voidsetSessionTimeout(int sessionTimeout) in minutesvoidsetSessionTrackingModes(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes) Not implemented.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.ServletContextsetRequestCharacterEncoding, setResponseCharacterEncoding
- 
Field Details- 
timeout
- 
CONFIGURATION_PATH_KEYServlet initialization parameter name for the path to TurbineConfiguration.xml file used by Turbine- See Also:
 
- 
PROPERTIES_PATH_KEYServlet initialization parameter name for the path to Turbine.properties file used by Turbine- See Also:
 
- 
PROPERTIES_PATH_DEFAULTDefault value of TurbineResources.properties file path (/WEB-INF/conf/TurbineResources.properties).- See Also:
 
- 
rootFilenames are looked up in this directory.
- 
attributesServlet container (or emulator) attributes.
- 
initParamsTurbine servlet initialization parameters.
 
- 
- 
Constructor Details- 
TurbineConfigConstructs a new TurbineConfig. This is the general form of the constructor. You can provide a path to search for files, and a name-value map of init parameters.For the list of recognized init parameters, see Turbineclass.- Parameters:
- path- The web application root (i.e. the path for file lookup).
- attributes- Servlet container (or emulator) attributes.
- initParams- initialization parameters.
 
- 
TurbineConfigConstructs a new TurbineConfig. This is the general form of the constructor. You can provide a path to search for files, and a name-value map of init parameters.For the list of recognized init parameters, see Turbineclass.- Parameters:
- path- The web application root (i.e. the path for file lookup).
- initParams- initialization parameters.
 
- 
TurbineConfigConstructs a TurbineConfig. This is a specialized constructor that allows to configure Turbine easily in the common setups. Check alsoTurbineXmlConfigto load aCONFIGURATION_PATH_KEY.- Parameters:
- path- The web application root (i.e. the path for file lookup).
- properties- the relative path to TurbineResources.properties file
 
 
- 
- 
Method Details- 
initializeCauses this class to initialize itself which in turn initializes all of the Turbine Services that need to be initialized.- Specified by:
- initializein interface- org.apache.avalon.framework.activity.Initializable
 
- 
initInitialization requiring a HTTPGETrequest.- Parameters:
- data- the Turbine request
 
- 
disposeShutdown the Turbine System, lifecycle style- Specified by:
- disposein interface- org.apache.avalon.framework.activity.Disposable
 
- 
getTurbineReturns a reference to the Turbine servlet that was initialized.- Returns:
- a ServletContext reference
 
- 
getServletContextReturns a reference to the object cast onto ServletContext type.- Specified by:
- getServletContextin interface- jakarta.servlet.ServletConfig
- Returns:
- a ServletContext reference
 
- 
getRealPathTranslates a path relative to the web application root into an absolute path.- Specified by:
- getRealPathin interface- jakarta.servlet.ServletContext
- Parameters:
- path- A path relative to the web application root.
- Returns:
- An absolute version of the supplied path, or nullif the translated path doesn't map to a file or directory.
 
- 
getInitParameterRetrieves an initialization parameter.- Specified by:
- getInitParameterin interface- jakarta.servlet.ServletConfig
- Specified by:
- getInitParameterin interface- jakarta.servlet.ServletContext
- Parameters:
- name- the name of the parameter.
- Returns:
- the value of the parameter.
 
- 
getInitParameterNamesRetrieves an Enumeration of initialization parameter names.- Specified by:
- getInitParameterNamesin interface- jakarta.servlet.ServletConfig
- Specified by:
- getInitParameterNamesin interface- jakarta.servlet.ServletContext
- Returns:
- an Enumeration of initialization parameter names.
 
- 
getServletNameReturns the servlet name. Fixed value "Turbine" is returned.- Specified by:
- getServletNamein interface- jakarta.servlet.ServletConfig
- Returns:
- the servlet name.
 
- 
getServletContextNameReturns the context name. Fixed value "Turbine" is returned- Specified by:
- getServletContextNamein interface- jakarta.servlet.ServletContext
- Returns:
- the context name
 
- 
getContextPathReturns the context path. Fixed value "/turbine" is returned- Specified by:
- getContextPathin interface- jakarta.servlet.ServletContext
- Returns:
- the context path
 
- 
getResourceReturns a URL to the resource that is mapped to a specified path. The path must begin with a "/" and is interpreted as relative to the current context root.- Specified by:
- getResourcein interface- jakarta.servlet.ServletContext
- Parameters:
- s- the path to the resource
- Returns:
- a URL pointing to the resource
- Throws:
- MalformedURLException- if unable to parse path
 
- 
getResourceAsStreamReturns the resource located at the named path as anInputStreamobject.- Specified by:
- getResourceAsStreamin interface- jakarta.servlet.ServletContext
- Parameters:
- s- the path to the resource
- Returns:
- an InputStream object from which the resource can be read
 
- 
logLogs a message.- Specified by:
- login interface- jakarta.servlet.ServletContext
- Parameters:
- m- a message.
 
- 
logLogs an error message.- Specified by:
- login interface- jakarta.servlet.ServletContext
- Parameters:
- m- a message.
- t- a Throwable object.
 
- 
getAttributeReturns the servlet container attribute with the given name, or null if there is no attribute by that name.- Specified by:
- getAttributein interface- jakarta.servlet.ServletContext
 
- 
getAttributeNamesReturns an Enumeration containing the attribute names available within this servlet context.- Specified by:
- getAttributeNamesin interface- jakarta.servlet.ServletContext
 
- 
getContextNot implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getContextin interface- jakarta.servlet.ServletContext
 
- 
getMajorVersionNot implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getMajorVersionin interface- jakarta.servlet.ServletContext
 
- 
getMimeTypeNot implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getMimeTypein interface- jakarta.servlet.ServletContext
 
- 
getMinorVersionNot implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getMinorVersionin interface- jakarta.servlet.ServletContext
 
- 
getNamedDispatcherNot implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getNamedDispatcherin interface- jakarta.servlet.ServletContext
 
- 
getRequestDispatcherNot implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getRequestDispatcherin interface- jakarta.servlet.ServletContext
 
- 
getResourcePathsNot implemented. A method in ServletContext (2.3) interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getResourcePathsin interface- jakarta.servlet.ServletContext
 
- 
getServerInfoNot implemented. A method in ServletContext (2.3) interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getServerInfoin interface- jakarta.servlet.ServletContext
 
- 
removeAttributeNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- removeAttributein interface- jakarta.servlet.ServletContext
 
- 
setAttributeNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- setAttributein interface- jakarta.servlet.ServletContext
 
- 
getEffectiveMajorVersionNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getEffectiveMajorVersionin interface- jakarta.servlet.ServletContext
 
- 
getEffectiveMinorVersionNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getEffectiveMinorVersionin interface- jakarta.servlet.ServletContext
 
- 
setInitParameterNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- setInitParameterin interface- jakarta.servlet.ServletContext
 
- 
addServletNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addServletin interface- jakarta.servlet.ServletContext
 
- 
addServletpublic jakarta.servlet.ServletRegistration.Dynamic addServlet(String servletName, jakarta.servlet.Servlet servlet) Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addServletin interface- jakarta.servlet.ServletContext
 
- 
addServletpublic jakarta.servlet.ServletRegistration.Dynamic addServlet(String servletName, Class<? extends jakarta.servlet.Servlet> servletClass) Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addServletin interface- jakarta.servlet.ServletContext
 
- 
createServletpublic <T extends jakarta.servlet.Servlet> T createServlet(Class<T> clazz) throws jakarta.servlet.ServletException Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- createServletin interface- jakarta.servlet.ServletContext
- Throws:
- jakarta.servlet.ServletException
 
- 
getServletRegistrationNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getServletRegistrationin interface- jakarta.servlet.ServletContext
 
- 
getServletRegistrationsNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getServletRegistrationsin interface- jakarta.servlet.ServletContext
 
- 
addFilterNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addFilterin interface- jakarta.servlet.ServletContext
 
- 
addFilterpublic jakarta.servlet.FilterRegistration.Dynamic addFilter(String filterName, jakarta.servlet.Filter filter) Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addFilterin interface- jakarta.servlet.ServletContext
 
- 
addFilterpublic jakarta.servlet.FilterRegistration.Dynamic addFilter(String filterName, Class<? extends jakarta.servlet.Filter> filterClass) Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addFilterin interface- jakarta.servlet.ServletContext
 
- 
createFilterpublic <T extends jakarta.servlet.Filter> T createFilter(Class<T> clazz) throws jakarta.servlet.ServletException Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- createFilterin interface- jakarta.servlet.ServletContext
- Throws:
- jakarta.servlet.ServletException
 
- 
getFilterRegistrationNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getFilterRegistrationin interface- jakarta.servlet.ServletContext
 
- 
getFilterRegistrationsNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getFilterRegistrationsin interface- jakarta.servlet.ServletContext
 
- 
getSessionCookieConfigNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getSessionCookieConfigin interface- jakarta.servlet.ServletContext
 
- 
setSessionTrackingModesNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- setSessionTrackingModesin interface- jakarta.servlet.ServletContext
 
- 
getDefaultSessionTrackingModesNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getDefaultSessionTrackingModesin interface- jakarta.servlet.ServletContext
 
- 
getEffectiveSessionTrackingModesNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getEffectiveSessionTrackingModesin interface- jakarta.servlet.ServletContext
 
- 
addListenerNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addListenerin interface- jakarta.servlet.ServletContext
 
- 
addListenerNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addListenerin interface- jakarta.servlet.ServletContext
 
- 
addListenerNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- addListenerin interface- jakarta.servlet.ServletContext
 
- 
createListenerpublic <T extends EventListener> T createListener(Class<T> clazz) throws jakarta.servlet.ServletException Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- createListenerin interface- jakarta.servlet.ServletContext
- Throws:
- jakarta.servlet.ServletException
 
- 
getJspConfigDescriptorNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getJspConfigDescriptorin interface- jakarta.servlet.ServletContext
 
- 
getClassLoaderNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getClassLoaderin interface- jakarta.servlet.ServletContext
 
- 
declareRolesNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- declareRolesin interface- jakarta.servlet.ServletContext
 
- 
getVirtualServerNameNot implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
- getVirtualServerNamein interface- jakarta.servlet.ServletContext
 
- 
addJspFile- Specified by:
- addJspFilein interface- jakarta.servlet.ServletContext
 
- 
getSessionTimeout- Specified by:
- getSessionTimeoutin interface- jakarta.servlet.ServletContext
 
- 
setSessionTimeoutin minutes- Specified by:
- setSessionTimeoutin interface- jakarta.servlet.ServletContext
 
- 
getRequestCharacterEncoding- Specified by:
- getRequestCharacterEncodingin interface- jakarta.servlet.ServletContext
 
- 
setRequestCharacterEncoding- Specified by:
- setRequestCharacterEncodingin interface- jakarta.servlet.ServletContext
 
- 
getResponseCharacterEncoding- Specified by:
- getResponseCharacterEncodingin interface- jakarta.servlet.ServletContext
 
- 
setResponseCharacterEncoding- Specified by:
- setResponseCharacterEncodingin interface- jakarta.servlet.ServletContext
 
 
-