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 Summary
FieldsModifier 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.ServletContext
ORDERED_LIBS, TEMPDIR -
Constructor Summary
ConstructorsConstructorDescriptionTurbineConfig(String path, String properties) Constructs a TurbineConfig.Constructs a new TurbineConfig.TurbineConfig(String path, Map<String, String> initParams) Constructs a new TurbineConfig. -
Method Summary
Modifier 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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.ServletContext
setRequestCharacterEncoding, setResponseCharacterEncoding
-
Field Details
-
timeout
-
CONFIGURATION_PATH_KEY
Servlet initialization parameter name for the path to TurbineConfiguration.xml file used by Turbine- See Also:
-
PROPERTIES_PATH_KEY
Servlet initialization parameter name for the path to Turbine.properties file used by Turbine- See Also:
-
PROPERTIES_PATH_DEFAULT
Default value of TurbineResources.properties file path (/WEB-INF/conf/TurbineResources.properties).- See Also:
-
root
Filenames are looked up in this directory. -
attributes
Servlet container (or emulator) attributes. -
initParams
Turbine servlet initialization parameters.
-
-
Constructor Details
-
TurbineConfig
Constructs 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.
-
TurbineConfig
Constructs 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.
-
TurbineConfig
Constructs 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
-
initialize
Causes this class to initialize itself which in turn initializes all of the Turbine Services that need to be initialized.- Specified by:
initializein interfaceorg.apache.avalon.framework.activity.Initializable
-
init
Initialization requiring a HTTPGETrequest.- Parameters:
data- the Turbine request
-
dispose
Shutdown the Turbine System, lifecycle style- Specified by:
disposein interfaceorg.apache.avalon.framework.activity.Disposable
-
getTurbine
Returns a reference to the Turbine servlet that was initialized.- Returns:
- a ServletContext reference
-
getServletContext
Returns a reference to the object cast onto ServletContext type.- Specified by:
getServletContextin interfacejakarta.servlet.ServletConfig- Returns:
- a ServletContext reference
-
getRealPath
Translates a path relative to the web application root into an absolute path.- Specified by:
getRealPathin interfacejakarta.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.
-
getInitParameter
Retrieves an initialization parameter.- Specified by:
getInitParameterin interfacejakarta.servlet.ServletConfig- Specified by:
getInitParameterin interfacejakarta.servlet.ServletContext- Parameters:
name- the name of the parameter.- Returns:
- the value of the parameter.
-
getInitParameterNames
Retrieves an Enumeration of initialization parameter names.- Specified by:
getInitParameterNamesin interfacejakarta.servlet.ServletConfig- Specified by:
getInitParameterNamesin interfacejakarta.servlet.ServletContext- Returns:
- an Enumeration of initialization parameter names.
-
getServletName
Returns the servlet name. Fixed value "Turbine" is returned.- Specified by:
getServletNamein interfacejakarta.servlet.ServletConfig- Returns:
- the servlet name.
-
getServletContextName
Returns the context name. Fixed value "Turbine" is returned- Specified by:
getServletContextNamein interfacejakarta.servlet.ServletContext- Returns:
- the context name
-
getContextPath
Returns the context path. Fixed value "/turbine" is returned- Specified by:
getContextPathin interfacejakarta.servlet.ServletContext- Returns:
- the context path
-
getResource
Returns 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 interfacejakarta.servlet.ServletContext- Parameters:
s- the path to the resource- Returns:
- a URL pointing to the resource
- Throws:
MalformedURLException- if unable to parse path
-
getResourceAsStream
Returns the resource located at the named path as anInputStreamobject.- Specified by:
getResourceAsStreamin interfacejakarta.servlet.ServletContext- Parameters:
s- the path to the resource- Returns:
- an InputStream object from which the resource can be read
-
log
Logs a message.- Specified by:
login interfacejakarta.servlet.ServletContext- Parameters:
m- a message.
-
log
Logs an error message.- Specified by:
login interfacejakarta.servlet.ServletContext- Parameters:
m- a message.t- a Throwable object.
-
getAttribute
Returns the servlet container attribute with the given name, or null if there is no attribute by that name.- Specified by:
getAttributein interfacejakarta.servlet.ServletContext
-
getAttributeNames
Returns an Enumeration containing the attribute names available within this servlet context.- Specified by:
getAttributeNamesin interfacejakarta.servlet.ServletContext
-
getContext
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getContextin interfacejakarta.servlet.ServletContext
-
getMajorVersion
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getMajorVersionin interfacejakarta.servlet.ServletContext
-
getMimeType
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getMimeTypein interfacejakarta.servlet.ServletContext
-
getMinorVersion
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getMinorVersionin interfacejakarta.servlet.ServletContext
-
getNamedDispatcher
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getNamedDispatcherin interfacejakarta.servlet.ServletContext
-
getRequestDispatcher
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getRequestDispatcherin interfacejakarta.servlet.ServletContext
-
getResourcePaths
Not implemented. A method in ServletContext (2.3) interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getResourcePathsin interfacejakarta.servlet.ServletContext
-
getServerInfo
Not implemented. A method in ServletContext (2.3) interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getServerInfoin interfacejakarta.servlet.ServletContext
-
removeAttribute
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
removeAttributein interfacejakarta.servlet.ServletContext
-
setAttribute
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
setAttributein interfacejakarta.servlet.ServletContext
-
getEffectiveMajorVersion
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getEffectiveMajorVersionin interfacejakarta.servlet.ServletContext
-
getEffectiveMinorVersion
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getEffectiveMinorVersionin interfacejakarta.servlet.ServletContext
-
setInitParameter
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
setInitParameterin interfacejakarta.servlet.ServletContext
-
addServlet
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
addServletin interfacejakarta.servlet.ServletContext
-
addServlet
public 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 interfacejakarta.servlet.ServletContext
-
addServlet
public 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 interfacejakarta.servlet.ServletContext
-
createServlet
public <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 interfacejakarta.servlet.ServletContext- Throws:
jakarta.servlet.ServletException
-
getServletRegistration
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getServletRegistrationin interfacejakarta.servlet.ServletContext
-
getServletRegistrations
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getServletRegistrationsin interfacejakarta.servlet.ServletContext
-
addFilter
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
addFilterin interfacejakarta.servlet.ServletContext
-
addFilter
public 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 interfacejakarta.servlet.ServletContext
-
addFilter
public 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 interfacejakarta.servlet.ServletContext
-
createFilter
public <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 interfacejakarta.servlet.ServletContext- Throws:
jakarta.servlet.ServletException
-
getFilterRegistration
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getFilterRegistrationin interfacejakarta.servlet.ServletContext
-
getFilterRegistrations
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getFilterRegistrationsin interfacejakarta.servlet.ServletContext
-
getSessionCookieConfig
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getSessionCookieConfigin interfacejakarta.servlet.ServletContext
-
setSessionTrackingModes
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
setSessionTrackingModesin interfacejakarta.servlet.ServletContext
-
getDefaultSessionTrackingModes
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getDefaultSessionTrackingModesin interfacejakarta.servlet.ServletContext
-
getEffectiveSessionTrackingModes
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getEffectiveSessionTrackingModesin interfacejakarta.servlet.ServletContext
-
addListener
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
addListenerin interfacejakarta.servlet.ServletContext
-
addListener
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
addListenerin interfacejakarta.servlet.ServletContext
-
addListener
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
addListenerin interfacejakarta.servlet.ServletContext
-
createListener
public <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 interfacejakarta.servlet.ServletContext- Throws:
jakarta.servlet.ServletException
-
getJspConfigDescriptor
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getJspConfigDescriptorin interfacejakarta.servlet.ServletContext
-
getClassLoader
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getClassLoaderin interfacejakarta.servlet.ServletContext
-
declareRoles
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
declareRolesin interfacejakarta.servlet.ServletContext
-
getVirtualServerName
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationExceptionupon invocation- Specified by:
getVirtualServerNamein interfacejakarta.servlet.ServletContext
-
addJspFile
- Specified by:
addJspFilein interfacejakarta.servlet.ServletContext
-
getSessionTimeout
- Specified by:
getSessionTimeoutin interfacejakarta.servlet.ServletContext
-
setSessionTimeout
in minutes- Specified by:
setSessionTimeoutin interfacejakarta.servlet.ServletContext
-
getRequestCharacterEncoding
- Specified by:
getRequestCharacterEncodingin interfacejakarta.servlet.ServletContext
-
setRequestCharacterEncoding
- Specified by:
setRequestCharacterEncodingin interfacejakarta.servlet.ServletContext
-
getResponseCharacterEncoding
- Specified by:
getResponseCharacterEncodingin interfacejakarta.servlet.ServletContext
-
setResponseCharacterEncoding
- Specified by:
setResponseCharacterEncodingin interfacejakarta.servlet.ServletContext
-