本文整理匯總了Java中javax.servlet.http.HttpSessionListener.sessionDestroyed方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpSessionListener.sessionDestroyed方法的具體用法?Java HttpSessionListener.sessionDestroyed怎麽用?Java HttpSessionListener.sessionDestroyed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.servlet.http.HttpSessionListener
的用法示例。
在下文中一共展示了HttpSessionListener.sessionDestroyed方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onApplicationEvent
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
public void onApplicationEvent(AbstractSessionEvent event) {
if (this.listeners.isEmpty()) {
return;
}
HttpSessionEvent httpSessionEvent = createHttpSessionEvent(event);
for (HttpSessionListener listener : this.listeners) {
if (event instanceof SessionDestroyedEvent) {
listener.sessionDestroyed(httpSessionEvent);
}
else if (event instanceof SessionCreatedEvent) {
listener.sessionCreated(httpSessionEvent);
}
}
}
示例2: onApplicationEvent
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
@Override
public void onApplicationEvent(AbstractSessionEvent event) {
if (this.listeners.isEmpty()) {
return;
}
HttpSessionEvent httpSessionEvent = createHttpSessionEvent(event);
for (HttpSessionListener listener : this.listeners) {
if (event instanceof SessionDestroyedEvent) {
listener.sessionDestroyed(httpSessionEvent);
}
else if (event instanceof SessionCreatedEvent) {
listener.sessionCreated(httpSessionEvent);
}
}
}
示例3: sessionDestroyed
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
public void sessionDestroyed(HttpSessionEvent se) {
if (ctx == null) {
logger.warn("cannot find applicationContext");
return;
}
Collection<HttpSessionListener> httpSessionListeners = ctx
.getBeansOfType(HttpSessionListener.class).values();
for (HttpSessionListener httpSessionListener : httpSessionListeners) {
httpSessionListener.sessionDestroyed(se);
}
}
示例4: sessionDestroyed
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
@Override
public void sessionDestroyed(HttpSessionEvent event)
{
for( HttpSessionListener listener : getListeners() )
{
listener.sessionDestroyed(event);
}
}
示例5: sessionDestroyed
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
* {@inheritDoc}
* @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent)
*/
public void sessionDestroyed(final HttpSessionEvent event) {
LOG.debug("Begin BootstrapListener session destroyed...");
init();
for (HttpSessionListener listener : listeners.values()) {
listener.sessionDestroyed(event);
}
LOG.debug("...end BootstrapListener session destroyed.");
}
示例6: sessionDestroyed
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
@Override
public void sessionDestroyed(HttpSessionEvent event) {
HttpSession session = event.getSession();
synchronized (session) {
for (HttpSessionListener sessionListener : HANDLER.sessionListeners) {
sessionListener.sessionDestroyed(event);
}
HANDLER.finalizeBeans(session);
}
}
示例7: sessionDestroyed
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
public void sessionDestroyed( HttpSessionEvent se )
{
for ( HttpSessionListener listener : HttpSessionListenerService.getListeners( ) )
{
listener.sessionDestroyed( se );
}
}
示例8: expire
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
* Perform the internal processing required to invalidate this session,
* without triggering an exception if the session has already expired.
*
* @param notify Should we notify listeners about the demise of
* this session?
*/
public void expire(boolean notify) {
// Mark this session as "being expired" if needed
if (expiring)
return;
expiring = true;
setValid(false);
// Remove this session from our manager's active sessions
if (manager != null)
manager.remove(this);
// Unbind any objects associated with this session
String keys[] = keys();
for (int i = 0; i < keys.length; i++)
removeAttribute(keys[i], notify);
// Notify interested session event listeners
if (notify) {
fireSessionEvent(Session.SESSION_DESTROYED_EVENT, null);
}
// Notify interested application event listeners
// FIXME - Assumes we call listeners in reverse order
Context context = (Context) manager.getContainer();
Object listeners[] = context.getApplicationListeners();
if (notify && (listeners != null)) {
HttpSessionEvent event =
new HttpSessionEvent(getSession());
for (int i = 0; i < listeners.length; i++) {
int j = (listeners.length - 1) - i;
if (!(listeners[j] instanceof HttpSessionListener))
continue;
HttpSessionListener listener =
(HttpSessionListener) listeners[j];
try {
fireContainerEvent(context,
"beforeSessionDestroyed",
listener);
listener.sessionDestroyed(event);
fireContainerEvent(context,
"afterSessionDestroyed",
listener);
} catch (Throwable t) {
try {
fireContainerEvent(context,
"afterSessionDestroyed",
listener);
} catch (Exception e) {
;
}
// FIXME - should we do anything besides log these?
log(sm.getString("standardSession.sessionEvent"), t);
}
}
}
// We have completed expire of this session
expiring = false;
if ((manager != null) && (manager instanceof ManagerBase)) {
recycle();
}
}
示例9: sessionDestroyed
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
public void sessionDestroyed(HttpSessionEvent se) {
for (HttpSessionListener listener : listeners) {
listener.sessionDestroyed(se);
}
}
示例10: invalidate
import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
@Override
public void invalidate() {
for (HttpSessionListener listener : listeners) {
listener.sessionDestroyed(new HttpSessionEvent(this));
}
}