|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.util.TurbineConfig
A class used for initalization of Turbine without a servlet container.
If you need to use Turbine outside of a servlet container, you can
use this class for initalization 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.
Constructor Summary | |
TurbineConfig(java.lang.String path,
java.util.Map initParams)
|
|
TurbineConfig(java.lang.String path,
java.util.Map attributes,
java.util.Map initParams)
Constructs a new TurbineConfig. |
|
TurbineConfig(java.lang.String path,
java.lang.String properties)
Constructs a TurbineConfig. |
Method Summary | |
java.lang.Object |
getAttribute(java.lang.String s)
Returns the servlet container attribute with the given name, or null if there is no attribute by that name. |
java.util.Enumeration |
getAttributeNames()
Returns an Enumeration containing the attribute names available within this servlet context. |
javax.servlet.ServletContext |
getContext(java.lang.String s)
Not implemented. |
java.lang.String |
getInitParameter(java.lang.String name)
Retrieves an initialization parameter. |
java.util.Enumeration |
getInitParameterNames()
Retrieves an Enumeration of initialization parameter names. |
int |
getMajorVersion()
Not implemented. |
java.lang.String |
getMimeType(java.lang.String s)
Not implemented. |
int |
getMinorVersion()
Not implemented. |
javax.servlet.RequestDispatcher |
getNamedDispatcher(java.lang.String s)
Not implemented. |
java.lang.String |
getRealPath(java.lang.String path)
Translates a path relative to the web application root into an absolute path. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String s)
Not implemented. |
java.net.URL |
getResource(java.lang.String s)
Returns a URL to the resource that is mapped to a specified path. |
java.io.InputStream |
getResourceAsStream(java.lang.String s)
Returns the resource located at the named path as an InputStream object. |
java.util.Set |
getResourcePaths()
Deprecated. |
java.util.Set |
getResourcePaths(java.lang.String s)
Deprecated. |
java.lang.String |
getServerInfo()
Not implemented. |
javax.servlet.Servlet |
getServlet(java.lang.String s)
Deprecated. |
javax.servlet.ServletContext |
getServletContext()
Returns a reference to the object cast onto ServletContext type. |
java.lang.String |
getServletContextName()
Returns the context name. |
java.lang.String |
getServletName()
Returns the servlet name. |
java.util.Enumeration |
getServletNames()
Deprecated. |
java.util.Enumeration |
getServlets()
Deprecated. |
void |
init()
Causes this class to initialize itself which in turn initializes all of the Turbine Services that need to be initialized. |
void |
init(RunData data)
Initialization requiring a HTTP GET request. |
void |
log(java.lang.Exception e,
java.lang.String m)
Deprecated. |
void |
log(java.lang.String m)
Logs a message. |
void |
log(java.lang.String m,
java.lang.Throwable t)
Logs an error message. |
void |
removeAttribute(java.lang.String s)
Not implemented. |
void |
setAttribute(java.lang.String s,
java.lang.Object o)
Not implemented. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TurbineConfig(java.lang.String path, java.util.Map attributes, java.util.Map initParams)
For the list of recognized init parameters, see
Turbine
class.
path
- The web application root (i.e. the path for file lookup).attributes
- Servlet container (or emulator) attributes.initParams
- initialization parameters.public TurbineConfig(java.lang.String path, java.util.Map initParams)
TurbineConfig(String path, Map attributes, Map initParams)
public TurbineConfig(java.lang.String path, java.lang.String properties)
path
- The web application root (i.e. the path for file lookup).properties
- the relative path to TurbineResources.properties fileMethod Detail |
public void init()
public void init(RunData data)
GET
request.public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.ServletConfig
public java.lang.String getRealPath(java.lang.String path)
getRealPath
in interface javax.servlet.ServletContext
path
- A path relative to the web application root.null
if the translated path doesn't map to a file or directory.public java.lang.String getInitParameter(java.lang.String name)
getInitParameter
in interface javax.servlet.ServletConfig
name
- the name of the parameter.public java.util.Enumeration getInitParameterNames()
getInitParameterNames
in interface javax.servlet.ServletConfig
public java.lang.String getServletName()
getServletName
in interface javax.servlet.ServletConfig
public java.lang.String getServletContextName()
public java.net.URL getResource(java.lang.String s) throws java.net.MalformedURLException
getResource
in interface javax.servlet.ServletContext
s
- the path to the resourcejava.net.MalformedURLException
- public java.io.InputStream getResourceAsStream(java.lang.String s)
InputStream
object.getResourceAsStream
in interface javax.servlet.ServletContext
s
- the path to the resourcepublic void log(java.lang.Exception e, java.lang.String m)
log
in interface javax.servlet.ServletContext
e
- an Exception.m
- a message.public void log(java.lang.String m)
log
in interface javax.servlet.ServletContext
m
- a message.public void log(java.lang.String m, java.lang.Throwable t)
log
in interface javax.servlet.ServletContext
t
- a Throwable object.m
- a message.public java.lang.Object getAttribute(java.lang.String s)
getAttribute
in interface javax.servlet.ServletContext
public java.util.Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletContext
public javax.servlet.ServletContext getContext(java.lang.String s)
UnsuportedOperationException
upon invocationgetContext
in interface javax.servlet.ServletContext
public int getMajorVersion()
UnsuportedOperationException
upon invocationgetMajorVersion
in interface javax.servlet.ServletContext
public java.lang.String getMimeType(java.lang.String s)
UnsuportedOperationException
upon invocationgetMimeType
in interface javax.servlet.ServletContext
public int getMinorVersion()
UnsuportedOperationException
upon invocationgetMinorVersion
in interface javax.servlet.ServletContext
public javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String s)
UnsuportedOperationException
upon invocationgetNamedDispatcher
in interface javax.servlet.ServletContext
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String s)
UnsuportedOperationException
upon invocationgetRequestDispatcher
in interface javax.servlet.ServletContext
public java.util.Set getResourcePaths()
UnsuportedOperationException
upon invocationpublic java.util.Set getResourcePaths(java.lang.String s)
UnsuportedOperationException
upon invocationpublic java.lang.String getServerInfo()
UnsuportedOperationException
upon invocationgetServerInfo
in interface javax.servlet.ServletContext
public javax.servlet.Servlet getServlet(java.lang.String s)
UnsuportedOperationException
upon invocationgetServlet
in interface javax.servlet.ServletContext
public java.util.Enumeration getServletNames()
UnsuportedOperationException
upon invocationgetServletNames
in interface javax.servlet.ServletContext
public java.util.Enumeration getServlets()
UnsuportedOperationException
upon invocationgetServlets
in interface javax.servlet.ServletContext
public void removeAttribute(java.lang.String s)
UnsuportedOperationException
upon invocationremoveAttribute
in interface javax.servlet.ServletContext
public void setAttribute(java.lang.String s, java.lang.Object o)
UnsuportedOperationException
upon invocationsetAttribute
in interface javax.servlet.ServletContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |