org.codehaus.plexus.servlet
Class PlexusServletUtils
java.lang.Object
org.codehaus.plexus.servlet.PlexusServletUtils
public final class PlexusServletUtils
- extends java.lang.Object
A collection of static helper methods for code running within a Servlet
environment that needs to access an embedded Plexus container. Such code
can either extend PlexusServlet
or invoke these static methods
directly.
- Version:
- $Revision: 6609 $
- Author:
- Mark Wilkinson
Method Summary |
static org.codehaus.plexus.PlexusContainer |
getPlexusContainer(javax.servlet.ServletContext sc)
Get a reference to the Plexus container loaded into the
ServletContext , if one exists. |
static boolean |
hasComponent(javax.servlet.ServletContext sc,
java.lang.String role)
|
static boolean |
hasComponent(javax.servlet.ServletContext sc,
java.lang.String role,
java.lang.String id)
|
static java.lang.Object |
lookup(javax.servlet.ServletContext servletContext,
java.lang.String role)
|
static java.lang.Object |
lookup(javax.servlet.ServletContext servletContext,
java.lang.String role,
java.lang.String id)
|
static void |
release(javax.servlet.ServletContext servletContext,
java.lang.Object service)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PLEXUS_HOME
public static final java.lang.String PLEXUS_HOME
- See Also:
- Constant Field Values
PLEXUS_CONFIG_PARAM
public static final java.lang.String PLEXUS_CONFIG_PARAM
- See Also:
- Constant Field Values
PLEXUS_CONFIG_ADD_TO_CONTEXT
public static final java.lang.String PLEXUS_CONFIG_ADD_TO_CONTEXT
- See Also:
- Constant Field Values
PLEXUS_PROPERTIES_PARAM
public static final java.lang.String PLEXUS_PROPERTIES_PARAM
- See Also:
- Constant Field Values
DEFAULT_PLEXUS_CONFIG
public static final java.lang.String DEFAULT_PLEXUS_CONFIG
- See Also:
- Constant Field Values
DEFAULT_PLEXUS_PROPERTIES
public static final java.lang.String DEFAULT_PLEXUS_PROPERTIES
- See Also:
- Constant Field Values
getPlexusContainer
public static org.codehaus.plexus.PlexusContainer getPlexusContainer(javax.servlet.ServletContext sc)
- Get a reference to the Plexus container loaded into the
ServletContext
, if one exists.
- Parameters:
sc
- The servlet context that Plexus is installed in.
- Returns:
- a
PlexusContainer
object, or null
if none was registered in the servlet context.
hasComponent
public static boolean hasComponent(javax.servlet.ServletContext sc,
java.lang.String role)
hasComponent
public static boolean hasComponent(javax.servlet.ServletContext sc,
java.lang.String role,
java.lang.String id)
lookup
public static java.lang.Object lookup(javax.servlet.ServletContext servletContext,
java.lang.String role)
throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
lookup
public static java.lang.Object lookup(javax.servlet.ServletContext servletContext,
java.lang.String role,
java.lang.String id)
throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
release
public static void release(javax.servlet.ServletContext servletContext,
java.lang.Object service)
throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
Copyright © 2001-2010 Codehaus. All Rights Reserved.