📄 instanceevent.java
字号:
/**
* Construct a new InstanceEvent with the specified parameters. This
* constructor is used for filter processing events.
*
* @param wrapper Wrapper managing this servlet instance
* @param filter Filter instance for which this event occurred
* @param type Event type (required)
* @param request Servlet request we are processing
* @param response Servlet response we are processing
* @param exception Exception that occurred
*/
public InstanceEvent(Wrapper wrapper, Filter filter, String type,
ServletRequest request, ServletResponse response,
Throwable exception) {
super(wrapper);
this.wrapper = wrapper;
this.filter = filter;
this.servlet = null;
this.type = type;
this.request = request;
this.response = response;
this.exception = exception;
}
/**
* Construct a new InstanceEvent with the specified parameters. This
* constructor is used for processing servlet lifecycle events.
*
* @param wrapper Wrapper managing this servlet instance
* @param servlet Servlet instance for which this event occurred
* @param type Event type (required)
*/
public InstanceEvent(Wrapper wrapper, Servlet servlet, String type) {
super(wrapper);
this.wrapper = wrapper;
this.filter = null;
this.servlet = servlet;
this.type = type;
}
/**
* Construct a new InstanceEvent with the specified parameters. This
* constructor is used for processing servlet lifecycle events.
*
* @param wrapper Wrapper managing this servlet instance
* @param servlet Servlet instance for which this event occurred
* @param type Event type (required)
* @param exception Exception that occurred
*/
public InstanceEvent(Wrapper wrapper, Servlet servlet, String type,
Throwable exception) {
super(wrapper);
this.wrapper = wrapper;
this.filter = null;
this.servlet = servlet;
this.type = type;
this.exception = exception;
}
/**
* Construct a new InstanceEvent with the specified parameters. This
* constructor is used for processing servlet processing events.
*
* @param wrapper Wrapper managing this servlet instance
* @param servlet Servlet instance for which this event occurred
* @param type Event type (required)
* @param request Servlet request we are processing
* @param response Servlet response we are processing
*/
public InstanceEvent(Wrapper wrapper, Servlet servlet, String type,
ServletRequest request, ServletResponse response) {
super(wrapper);
this.wrapper = wrapper;
this.filter = null;
this.servlet = servlet;
this.type = type;
this.request = request;
this.response = response;
}
/**
* Construct a new InstanceEvent with the specified parameters. This
* constructor is used for processing servlet processing events.
*
* @param wrapper Wrapper managing this servlet instance
* @param servlet Servlet instance for which this event occurred
* @param type Event type (required)
* @param request Servlet request we are processing
* @param response Servlet response we are processing
* @param exception Exception that occurred
*/
public InstanceEvent(Wrapper wrapper, Servlet servlet, String type,
ServletRequest request, ServletResponse response,
Throwable exception) {
super(wrapper);
this.wrapper = wrapper;
this.filter = null;
this.servlet = servlet;
this.type = type;
this.request = request;
this.response = response;
this.exception = exception;
}
// ----------------------------------------------------- Instance Variables
/**
* The exception that was thrown during the processing being reported
* by this event (AFTER_INIT_EVENT, AFTER_SERVICE_EVENT,
* AFTER_DESTROY_EVENT, AFTER_DISPATCH_EVENT, and AFTER_FILTER_EVENT only).
*/
private Throwable exception = null;
/**
* The Filter instance for which this event occurred (BEFORE_FILTER_EVENT
* and AFTER_FILTER_EVENT only).
*/
private Filter filter = null;
/**
* The servlet request being processed (BEFORE_FILTER_EVENT,
* AFTER_FILTER_EVENT, BEFORE_SERVICE_EVENT, and AFTER_SERVICE_EVENT).
*/
private ServletRequest request = null;
/**
* The servlet response being processed (BEFORE_FILTER_EVENT,
* AFTER_FILTER_EVENT, BEFORE_SERVICE_EVENT, and AFTER_SERVICE_EVENT).
*/
private ServletResponse response = null;
/**
* The Servlet instance for which this event occurred (not present on
* BEFORE_FILTER_EVENT or AFTER_FILTER_EVENT events).
*/
private Servlet servlet = null;
/**
* The event type this instance represents.
*/
private String type = null;
/**
* The Wrapper managing the servlet instance for which this event occurred.
*/
private Wrapper wrapper = null;
// ------------------------------------------------------------- Properties
/**
* Return the exception that occurred during the processing
* that was reported by this event.
*/
public Throwable getException() {
return (this.exception);
}
/**
* Return the filter instance for which this event occurred.
*/
public Filter getFilter() {
return (this.filter);
}
/**
* Return the servlet request for which this event occurred.
*/
public ServletRequest getRequest() {
return (this.request);
}
/**
* Return the servlet response for which this event occurred.
*/
public ServletResponse getResponse() {
return (this.response);
}
/**
* Return the servlet instance for which this event occurred.
*/
public Servlet getServlet() {
return (this.servlet);
}
/**
* Return the event type of this event.
*/
public String getType() {
return (this.type);
}
/**
* Return the Wrapper managing the servlet instance for which this
* event occurred.
*/
public Wrapper getWrapper() {
return (this.wrapper);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -