public abstract class ValveBase extends Object implements Contained, Lifecycle, Valve, GlassFishValve
invoke()
method to provide the required functionality, and MAY
implement the Lifecycle
interface to provide configuration
management and lifecycle support.Modifier and Type | Field and Description |
---|---|
protected Container |
container
The Container whose pipeline this Valve is a component of.
|
protected ObjectName |
controller |
protected int |
debug
The debugging detail level for this component.
|
protected String |
domain |
protected static String |
info
Descriptive information about this Valve implementation.
|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
protected static Logger |
log |
protected Valve |
next
The next Valve in the pipeline this Valve is a component of.
|
protected ObjectName |
oname |
protected static ResourceBundle |
rb |
protected boolean |
started
Has this component been started yet?
|
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
END_PIPELINE, INVOKE_NEXT
Constructor and Description |
---|
ValveBase() |
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
void |
backgroundProcess()
Execute a periodic task, such as reloading, etc.
|
ObjectName |
createObjectName(String domain,
ObjectName parent) |
void |
event(Request request,
Response response,
CometEvent event)
Process a Comet event.
|
List<LifecycleListener> |
findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners associated
with this Valve.
|
Container |
getContainer()
Return the Container with which this Valve is associated, if any.
|
ObjectName |
getController() |
int |
getDebug()
Return the debugging detail level for this component.
|
String |
getDomain() |
String |
getInfo()
Return descriptive information about this Valve implementation.
|
Valve |
getNext()
Return the next Valve in this pipeline, or
null if this
is the last Valve in the pipeline. |
ObjectName |
getObjectName() |
ObjectName |
getParentName(ObjectName valveName)
From the name, extract the parent object name
|
abstract int |
invoke(Request request,
Response response)
The implementation-specific logic represented by this Valve.
|
void |
invoke(Request request,
Response response)
Tomcat-style invocation.
|
boolean |
isStarted() |
void |
postInvoke(Request request,
Response response)
A post-request processing implementation that does nothing.
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
|
void |
setContainer(Container container)
Set the Container with which this Valve is associated, if any.
|
void |
setController(ObjectName controller) |
void |
setDebug(int debug)
Set the debugging detail level for this component.
|
void |
setNext(Valve valve)
Set the Valve that follows this one in the pipeline it is part of.
|
void |
setObjectName(ObjectName oname) |
void |
start()
Prepare for the beginning of active use of the public methods of this
component.
|
void |
stop()
Gracefully terminate the active use of the public methods of this
component.
|
protected static final Logger log
protected static final ResourceBundle rb
protected Container container
protected int debug
protected boolean started
protected LifecycleSupport lifecycle
protected static final String info
protected Valve next
protected String domain
protected ObjectName oname
protected ObjectName controller
public Container getContainer()
getContainer
in interface Contained
public void setContainer(Container container)
setContainer
in interface Contained
container
- The new associated containerpublic int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic String getInfo()
getInfo
in interface Valve
getInfo
in interface GlassFishValve
public Valve getNext()
null
if this
is the last Valve in the pipeline.public void setNext(Valve valve)
public void backgroundProcess()
backgroundProcess
in interface Valve
public abstract int invoke(Request request, Response response) throws IOException, javax.servlet.ServletException
This method MUST be provided by a subclass.
invoke
in interface GlassFishValve
request
- The servlet request to be processedresponse
- The servlet response to be createdINVOKE_NEXT
or END_PIPELINE
IOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet error occurspublic void postInvoke(Request request, Response response) throws IOException, javax.servlet.ServletException
postInvoke
in interface GlassFishValve
request
- The servlet request to be processedresponse
- The servlet response to be createdIOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet error occurspublic void invoke(Request request, Response response) throws IOException, javax.servlet.ServletException
invoke
in interface Valve
request
- The servlet request to be processedresponse
- The servlet response to be createdIOException
- if an input/output error occurs, or is thrown by a subsequently invoked Valve, Filter, or
Servletjavax.servlet.ServletException
- if a servlet error occurs, or is thrown by a subsequently invoked Valve, Filter, or
Servletpublic void event(Request request, Response response, CometEvent event) throws IOException, javax.servlet.ServletException
event
in interface Valve
request
- The servlet request to be processedresponse
- The servlet response to be createdIOException
- if an input/output error occurs, or is thrown
by a subsequently invoked Valve, Filter, or Servletjavax.servlet.ServletException
- if a servlet error occurs, or is thrown
by a subsequently invoked Valve, Filter, or Servletpublic boolean isStarted()
public void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic List<LifecycleListener> findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic void start() throws LifecycleException
configure()
,
and before any of the public methods of the component are utilized.start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedpublic ObjectName getObjectName()
public void setObjectName(ObjectName oname)
public String getDomain()
public ObjectName getController()
public void setController(ObjectName controller)
public ObjectName getParentName(ObjectName valveName)
valveName
- public ObjectName createObjectName(String domain, ObjectName parent) throws MalformedObjectNameException
MalformedObjectNameException
Copyright © 2019. All rights reserved.