本文整理汇总了Java中javax.servlet.ServletRequestListener.requestDestroyed方法的典型用法代码示例。如果您正苦于以下问题:Java ServletRequestListener.requestDestroyed方法的具体用法?Java ServletRequestListener.requestDestroyed怎么用?Java ServletRequestListener.requestDestroyed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.servlet.ServletRequestListener
的用法示例。
在下文中一共展示了ServletRequestListener.requestDestroyed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: destroy
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
public void destroy() {
final boolean openejbRequestDestroyed = getAttribute("openejb_requestDestroyed") == null;
if (listeners != null && !listeners.isEmpty()) {
if (begin != null && end != null && openejbRequestDestroyed) {
end.requestDestroyed(new ServletRequestEvent(getServletContext(), this));
}
final ServletRequestEvent event = new ServletRequestEvent(getServletContext(), this);
for (final ServletRequestListener listener : listeners) {
listener.requestDestroyed(event);
}
}
if (begin != null && openejbRequestDestroyed) {
setAttribute("openejb_requestDestroyed", "ok");
begin.requestDestroyed(new ServletRequestEvent(getServletContext(), this));
}
}
示例2: fireRequestDestroyEvent
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
@Override
public boolean fireRequestDestroyEvent(ServletRequest request) {
Object instances[] = getApplicationEventListeners();
if ((instances != null) && (instances.length > 0)) {
ServletRequestEvent event =
new ServletRequestEvent(getServletContext(), request);
for (int i = 0; i < instances.length; i++) {
int j = (instances.length -1) -i;
if (instances[j] == null)
continue;
if (!(instances[j] instanceof ServletRequestListener))
continue;
ServletRequestListener listener =
(ServletRequestListener) instances[j];
try {
listener.requestDestroyed(event);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
getLogger().error(sm.getString(
"standardContext.requestListener.requestInit",
instances[j].getClass().getName()), t);
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
return false;
}
}
}
return true;
}
示例3: fireRequestDestroyEvent
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
@Override
public boolean fireRequestDestroyEvent(ServletRequest request) {
Object instances[] = getApplicationEventListeners();
if ((instances != null) && (instances.length > 0)) {
ServletRequestEvent event = new ServletRequestEvent(getServletContext(), request);
for (int i = 0; i < instances.length; i++) {
int j = (instances.length - 1) - i;
if (instances[j] == null)
continue;
if (!(instances[j] instanceof ServletRequestListener))
continue;
ServletRequestListener listener = (ServletRequestListener) instances[j];
try {
listener.requestDestroyed(event);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
getLogger().error(sm.getString("standardContext.requestListener.requestInit",
instances[j].getClass().getName()), t);
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
return false;
}
}
}
return true;
}
示例4: requestDestroyed
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
@Override
public void requestDestroyed(ServletRequestEvent event) {
requestContextListener.requestDestroyed(event);
for (ServletRequestListener requestListener : HANDLER.requestListeners) {
requestListener.requestDestroyed(event);
}
}
示例5: destroyFakedRequest
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
public static void destroyFakedRequest(final ServletRequestListener listener) {
final Boolean faked = FAKE_REQUEST.get();
try {
if (faked != null && faked) {
listener.requestDestroyed(null);
}
} finally {
FAKE_REQUEST.remove();
}
}
示例6: requestDestroyed
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
public void requestDestroyed(ServletRequestEvent sre) {
for (ServletRequestListener listener : listeners) {
listener.requestDestroyed(sre);
}
}