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 String
Servlet initialization parameter name for the path to TurbineConfiguration.xml file used by TurbineTurbine servlet initialization parameters.static final String
Default value of TurbineResources.properties file path (/WEB-INF/conf/TurbineResources.properties
).static final String
Servlet initialization parameter name for the path to Turbine.properties file used by Turbineprotected File
Filenames are looked up in this directory.protected int
Fields 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.Dynamic
Not implemented.jakarta.servlet.FilterRegistration.Dynamic
Not implemented.jakarta.servlet.FilterRegistration.Dynamic
Not implemented.jakarta.servlet.ServletRegistration.Dynamic
addJspFile
(String servletName, String jspFile) void
addListener
(Class<? extends EventListener> listenerClass) Not implemented.void
addListener
(String className) Not implemented.<T extends EventListener>
voidaddListener
(T t) Not implemented.jakarta.servlet.ServletRegistration.Dynamic
addServlet
(String servletName, jakarta.servlet.Servlet servlet) Not implemented.jakarta.servlet.ServletRegistration.Dynamic
addServlet
(String servletName, Class<? extends jakarta.servlet.Servlet> servletClass) Not implemented.jakarta.servlet.ServletRegistration.Dynamic
addServlet
(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.void
declareRoles
(String... roleNames) Not implemented.void
dispose()
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.ServletContext
getContext
(String s) Not implemented.Returns the context path.Set
<jakarta.servlet.SessionTrackingMode> Not implemented.int
Not implemented.int
Not implemented.Set
<jakarta.servlet.SessionTrackingMode> Not implemented.jakarta.servlet.FilterRegistration
getFilterRegistration
(String filterName) Not implemented.Not implemented.getInitParameter
(String name) Retrieves an initialization parameter.Retrieves an Enumeration of initialization parameter names.jakarta.servlet.descriptor.JspConfigDescriptor
Not implemented.int
Not implemented.Not implemented.int
Not implemented.jakarta.servlet.RequestDispatcher
Not implemented.getRealPath
(String path) Translates a path relative to the web application root into an absolute path.jakarta.servlet.RequestDispatcher
Not implemented.Returns a URL to the resource that is mapped to a specified path.Returns the resource located at the named path as anInputStream
object.Not implemented.Not implemented.jakarta.servlet.ServletContext
Returns a reference to the object cast onto ServletContext type.Returns the context name.Returns the servlet name.jakarta.servlet.ServletRegistration
getServletRegistration
(String servletName) Not implemented.Not implemented.jakarta.servlet.SessionCookieConfig
Not implemented.int
Returns a reference to the Turbine servlet that was initialized.Not implemented.void
Initialization requiring a HTTPGET
request.void
Causes this class to initialize itself which in turn initializes all of the Turbine Services that need to be initialized.void
Logs a message.void
Logs an error message.void
Not implemented.void
setAttribute
(String s, Object o) Not implemented.boolean
setInitParameter
(String name, String value) Not implemented.void
setRequestCharacterEncoding
(String encoding) void
setResponseCharacterEncoding
(String encoding) void
setSessionTimeout
(int sessionTimeout) in minutesvoid
setSessionTrackingModes
(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes) Not implemented.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
Turbine
class.- 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
Turbine
class.- 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 alsoTurbineXmlConfig
to 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:
initialize
in interfaceorg.apache.avalon.framework.activity.Initializable
-
init
Initialization requiring a HTTPGET
request.- Parameters:
data
- the Turbine request
-
dispose
Shutdown the Turbine System, lifecycle style- Specified by:
dispose
in 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:
getServletContext
in interfacejakarta.servlet.ServletConfig
- Returns:
- a ServletContext reference
-
getRealPath
Translates a path relative to the web application root into an absolute path.- Specified by:
getRealPath
in interfacejakarta.servlet.ServletContext
- Parameters:
path
- A path relative to the web application root.- Returns:
- An absolute version of the supplied path, or
null
if the translated path doesn't map to a file or directory.
-
getInitParameter
Retrieves an initialization parameter.- Specified by:
getInitParameter
in interfacejakarta.servlet.ServletConfig
- Specified by:
getInitParameter
in 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:
getInitParameterNames
in interfacejakarta.servlet.ServletConfig
- Specified by:
getInitParameterNames
in interfacejakarta.servlet.ServletContext
- Returns:
- an Enumeration of initialization parameter names.
-
getServletName
Returns the servlet name. Fixed value "Turbine" is returned.- Specified by:
getServletName
in interfacejakarta.servlet.ServletConfig
- Returns:
- the servlet name.
-
getServletContextName
Returns the context name. Fixed value "Turbine" is returned- Specified by:
getServletContextName
in interfacejakarta.servlet.ServletContext
- Returns:
- the context name
-
getContextPath
Returns the context path. Fixed value "/turbine" is returned- Specified by:
getContextPath
in 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:
getResource
in 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 anInputStream
object.- Specified by:
getResourceAsStream
in 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:
log
in interfacejakarta.servlet.ServletContext
- Parameters:
m
- a message.
-
log
Logs an error message.- Specified by:
log
in 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:
getAttribute
in interfacejakarta.servlet.ServletContext
-
getAttributeNames
Returns an Enumeration containing the attribute names available within this servlet context.- Specified by:
getAttributeNames
in interfacejakarta.servlet.ServletContext
-
getContext
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getContext
in interfacejakarta.servlet.ServletContext
-
getMajorVersion
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getMajorVersion
in interfacejakarta.servlet.ServletContext
-
getMimeType
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getMimeType
in interfacejakarta.servlet.ServletContext
-
getMinorVersion
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getMinorVersion
in interfacejakarta.servlet.ServletContext
-
getNamedDispatcher
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getNamedDispatcher
in interfacejakarta.servlet.ServletContext
-
getRequestDispatcher
Not implemented. A method in ServletConfig or ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getRequestDispatcher
in interfacejakarta.servlet.ServletContext
-
getResourcePaths
Not implemented. A method in ServletContext (2.3) interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getResourcePaths
in interfacejakarta.servlet.ServletContext
-
getServerInfo
Not implemented. A method in ServletContext (2.3) interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getServerInfo
in interfacejakarta.servlet.ServletContext
-
removeAttribute
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
removeAttribute
in interfacejakarta.servlet.ServletContext
-
setAttribute
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
setAttribute
in interfacejakarta.servlet.ServletContext
-
getEffectiveMajorVersion
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getEffectiveMajorVersion
in interfacejakarta.servlet.ServletContext
-
getEffectiveMinorVersion
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getEffectiveMinorVersion
in interfacejakarta.servlet.ServletContext
-
setInitParameter
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
setInitParameter
in interfacejakarta.servlet.ServletContext
-
addServlet
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
addServlet
in 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 throwUnsuportedOperationException
upon invocation- Specified by:
addServlet
in 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 throwUnsuportedOperationException
upon invocation- Specified by:
addServlet
in 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 throwUnsuportedOperationException
upon invocation- Specified by:
createServlet
in interfacejakarta.servlet.ServletContext
- Throws:
jakarta.servlet.ServletException
-
getServletRegistration
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getServletRegistration
in interfacejakarta.servlet.ServletContext
-
getServletRegistrations
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getServletRegistrations
in interfacejakarta.servlet.ServletContext
-
addFilter
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
addFilter
in 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 throwUnsuportedOperationException
upon invocation- Specified by:
addFilter
in 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 throwUnsuportedOperationException
upon invocation- Specified by:
addFilter
in 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 throwUnsuportedOperationException
upon invocation- Specified by:
createFilter
in interfacejakarta.servlet.ServletContext
- Throws:
jakarta.servlet.ServletException
-
getFilterRegistration
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getFilterRegistration
in interfacejakarta.servlet.ServletContext
-
getFilterRegistrations
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getFilterRegistrations
in interfacejakarta.servlet.ServletContext
-
getSessionCookieConfig
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getSessionCookieConfig
in interfacejakarta.servlet.ServletContext
-
setSessionTrackingModes
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
setSessionTrackingModes
in interfacejakarta.servlet.ServletContext
-
getDefaultSessionTrackingModes
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getDefaultSessionTrackingModes
in interfacejakarta.servlet.ServletContext
-
getEffectiveSessionTrackingModes
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getEffectiveSessionTrackingModes
in interfacejakarta.servlet.ServletContext
-
addListener
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
addListener
in interfacejakarta.servlet.ServletContext
-
addListener
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
addListener
in interfacejakarta.servlet.ServletContext
-
addListener
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
addListener
in 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 throwUnsuportedOperationException
upon invocation- Specified by:
createListener
in interfacejakarta.servlet.ServletContext
- Throws:
jakarta.servlet.ServletException
-
getJspConfigDescriptor
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getJspConfigDescriptor
in interfacejakarta.servlet.ServletContext
-
getClassLoader
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getClassLoader
in interfacejakarta.servlet.ServletContext
-
declareRoles
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
declareRoles
in interfacejakarta.servlet.ServletContext
-
getVirtualServerName
Not implemented. A method in ServletContext interface that is not implemented and will throwUnsuportedOperationException
upon invocation- Specified by:
getVirtualServerName
in interfacejakarta.servlet.ServletContext
-
addJspFile
- Specified by:
addJspFile
in interfacejakarta.servlet.ServletContext
-
getSessionTimeout
- Specified by:
getSessionTimeout
in interfacejakarta.servlet.ServletContext
-
setSessionTimeout
in minutes- Specified by:
setSessionTimeout
in interfacejakarta.servlet.ServletContext
-
getRequestCharacterEncoding
- Specified by:
getRequestCharacterEncoding
in interfacejakarta.servlet.ServletContext
-
setRequestCharacterEncoding
- Specified by:
setRequestCharacterEncoding
in interfacejakarta.servlet.ServletContext
-
getResponseCharacterEncoding
- Specified by:
getResponseCharacterEncoding
in interfacejakarta.servlet.ServletContext
-
setResponseCharacterEncoding
- Specified by:
setResponseCharacterEncoding
in interfacejakarta.servlet.ServletContext
-