本文整理汇总了Java中org.apache.catalina.SessionEvent类的典型用法代码示例。如果您正苦于以下问题:Java SessionEvent类的具体用法?Java SessionEvent怎么用?Java SessionEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SessionEvent类属于org.apache.catalina包,在下文中一共展示了SessionEvent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
@Override
public void sessionEvent(SessionEvent event) {
if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())) {
return;
}
Session session = event.getSession();
Manager manager = session.getManager();
if (manager == null) {
return;
}
Context context = (Context) manager.getContainer();
Authenticator authenticator = context.getAuthenticator();
if (!(authenticator instanceof AuthenticatorBase)) {
return;
}
SingleSignOn sso = ((AuthenticatorBase) authenticator).sso;
if (sso == null) {
return;
}
sso.sessionDestroyed(ssoId, session);
}
示例2: sessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
* Acknowledge the occurrence of the specified event.
*
* @param event SessionEvent that has occurred
*/
public void sessionEvent(SessionEvent event) {
// We only care about session destroyed events
if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType()))
return;
// Look up the single session id associated with this session (if any)
Session session = event.getSession();
if (debug >= 1)
log("Process session destroyed on " + session);
String ssoId = null;
synchronized (reverse) {
ssoId = (String) reverse.get(session);
}
if (ssoId == null)
return;
// Deregister this single session id, invalidating associated sessions
deregister(ssoId);
}
示例3: sessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
@Override
public void sessionEvent(SessionEvent event) {
if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())) {
return;
}
Session session = event.getSession();
Manager manager = session.getManager();
if (manager == null) {
return;
}
Context context = (Context) manager.getContainer();
Authenticator authenticator = context.getAuthenticator();
if (!(authenticator instanceof AuthenticatorBase)) {
return;
}
SingleSignOn sso = ((AuthenticatorBase) authenticator).sso;
if (sso == null) {
return;
}
sso.sessionDestroyed(ssoId, session);
}
示例4: fireSessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
* Notify all session event listeners that a particular event has
* occurred for this Session. The default implementation performs
* this notification synchronously using the calling thread.
*
* @param type Event type
* @param data Event data
*/
public void fireSessionEvent(String type, Object data) {
if (listeners.size() < 1)
return;
SessionEvent event = new SessionEvent(this, type, data);
SessionListener list[] = new SessionListener[0];
synchronized (listeners) {
list = listeners.toArray(list);
}
for (int i = 0; i < list.length; i++){
(list[i]).sessionEvent(event);
}
}
示例5: fireSessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
* Notify all session event listeners that a particular event has
* occurred for this Session. The default implementation performs
* this notification synchronously using the calling thread.
*
* @param type Event type
* @param data Event data
*/
public void fireSessionEvent(String type, Object data) {
if (listeners.size() < 1)
return;
SessionEvent event = new SessionEvent(this, type, data);
SessionListener list[] = new SessionListener[0];
synchronized (listeners) {
list = (SessionListener[]) listeners.toArray(list);
}
for (int i = 0; i < list.length; i++){
((SessionListener) list[i]).sessionEvent(event);
}
}
示例6: sessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
* Acknowledge the occurrence of the specified event.
*
* @param event SessionEvent that has occurred
*/
public void sessionEvent(SessionEvent event) {
// We only care about session destroyed events
if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())
&& (!Session.SESSION_PASSIVATED_EVENT.equals(event.getType())))
return;
// Look up the single session id associated with this session (if any)
Session session = event.getSession();
String ssoId = null;
synchronized (reverse) {
ssoId = (String) reverse.get(session);
}
if (ssoId == null)
return;
// Was the session destroyed as the result of a timeout?
// If so, we'll just remove the expired session from the
// SSO. If the session was logged out, we'll log out
// of all session associated with the SSO.
if (((session.getMaxInactiveInterval() > 0)
&& (System.currentTimeMillis() - session.getLastAccessedTimeInternal() >=
session.getMaxInactiveInterval() * 1000))
|| (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))) {
removeSession(ssoId, session);
} else {
// The session was logged out.
// Deregister this single session id, invalidating
// associated sessions
deregister(ssoId);
}
}
示例7: fireSessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
* Notify all session event listeners that a particular event has
* occurred for this Session. The default implementation performs
* this notification synchronously using the calling thread.
*
* @param type Event type
* @param data Event data
*/
public void fireSessionEvent(String type, Object data) {
if (listeners.size() < 1)
return;
SessionEvent event = new SessionEvent(this, type, data);
SessionListener list[] = new SessionListener[0];
synchronized (listeners) {
list = (SessionListener[]) listeners.toArray(list);
}
for (int i = 0; i < list.length; i++)
((SessionListener) list[i]).sessionEvent(event);
}
示例8: fireSessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
* Notify all session event listeners that a particular event has occurred
* for this Session. The default implementation performs this notification
* synchronously using the calling thread.
*
* @param type
* Event type
* @param data
* Event data
*/
public void fireSessionEvent(String type, Object data) {
if (listeners.size() < 1)
return;
SessionEvent event = new SessionEvent(this, type, data);
SessionListener list[] = new SessionListener[0];
synchronized (listeners) {
list = listeners.toArray(list);
}
for (int i = 0; i < list.length; i++) {
(list[i]).sessionEvent(event);
}
}
示例9: sessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
* Acknowledge the occurrence of the specified event.
*
* @param event SessionEvent that has occurred
*/
@Override
public void sessionEvent(SessionEvent event) {
// We only care about session destroyed events
if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())
&& (!Session.SESSION_PASSIVATED_EVENT.equals(event.getType())))
return;
// Look up the single session id associated with this session (if any)
Session session = event.getSession();
if (containerLog.isDebugEnabled())
containerLog.debug("Process session destroyed on " + session);
String ssoId = null;
synchronized (reverse) {
ssoId = reverse.get(session);
}
if (ssoId == null)
return;
// Was the session destroyed as the result of a timeout?
// If so, we'll just remove the expired session from the
// SSO. If the session was logged out, we'll log out
// of all session associated with the SSO.
if (((session.getMaxInactiveInterval() > 0)
&& (System.currentTimeMillis() - session.getThisAccessedTimeInternal() >=
session.getMaxInactiveInterval() * 1000))
|| (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))) {
removeSession(ssoId, session);
} else {
// The session was logged out.
// Deregister this single session id, invalidating
// associated sessions
deregister(ssoId);
}
}
示例10: sessionEvent
import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
* Acknowledge the occurrence of the specified event.
*
* @param event SessionEvent that has occurred
*/
@Override
public void sessionEvent(SessionEvent event) {
if (!getState().isAvailable()) {
return;
}
// We only care about session destroyed events
if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())
&& (!Session.SESSION_PASSIVATED_EVENT.equals(event.getType())))
return;
// Look up the single session id associated with this session (if any)
Session session = event.getSession();
if (containerLog.isDebugEnabled())
containerLog.debug("Process session destroyed on " + session);
String ssoId = null;
synchronized (reverse) {
ssoId = reverse.get(session);
}
if (ssoId == null)
return;
// Was the session destroyed as the result of a timeout?
// If so, we'll just remove the expired session from the
// SSO. If the session was logged out, we'll log out
// of all session associated with the SSO.
if (((session.getMaxInactiveInterval() > 0)
&& (System.currentTimeMillis() - session.getThisAccessedTimeInternal() >=
session.getMaxInactiveInterval() * 1000))
|| (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))
|| (!session.getManager().getContainer().getState().isAvailable())) {
removeSession(ssoId, session);
} else {
// The session was logged out.
// Deregister this single session id, invalidating
// associated sessions
deregister(ssoId);
}
}