当前位置: 首页>>代码示例>>Java>>正文


Java AbstractSessionEvent类代码示例

本文整理汇总了Java中org.springframework.session.events.AbstractSessionEvent的典型用法代码示例。如果您正苦于以下问题:Java AbstractSessionEvent类的具体用法?Java AbstractSessionEvent怎么用?Java AbstractSessionEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AbstractSessionEvent类属于org.springframework.session.events包,在下文中一共展示了AbstractSessionEvent类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onApplicationEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的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);
		}
	}
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:17,代码来源:SessionEventHttpSessionListenerAdapter.java

示例2: onApplicationEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的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);
		}
	}
}
 
开发者ID:spring-projects,项目名称:spring-session,代码行数:18,代码来源:SessionEventHttpSessionListenerAdapter.java

示例3: onApplicationEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
@Override
public void onApplicationEvent(AbstractSessionEvent event) {
    if (event instanceof SessionCreatedEvent) {
        sessionCreatedEvents++;
    }
    if (event instanceof SessionDeletedEvent) {
        sessionDeletedEvents++;
    }
    if (event instanceof SessionExpiredEvent) {
        sessionExpiredEvents++;
    }
}
 
开发者ID:qq1588518,项目名称:JRediClients,代码行数:13,代码来源:SessionEventsListener.java

示例4: createHttpSessionEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
private HttpSessionEvent createHttpSessionEvent(AbstractSessionEvent event) {
	ExpiringSession session = event.getSession();
	HttpSession httpSession = new ExpiringSessionHttpSession<ExpiringSession>(session,
			this.context);
	HttpSessionEvent httpSessionEvent = new HttpSessionEvent(httpSession);
	return httpSessionEvent;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:8,代码来源:SessionEventHttpSessionListenerAdapter.java

示例5: onApplicationEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
public void onApplicationEvent(AbstractSessionEvent event) {

		String sessionId = event.getSessionId();
		this.events.put(sessionId, event);
		Object lock = getLock(sessionId);
		synchronized (lock) {
			lock.notifyAll();
		}
	}
 
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:10,代码来源:SessionEventRegistry.java

示例6: waitForEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private <E extends AbstractSessionEvent> E waitForEvent(String sessionId)
		throws InterruptedException {

	Object lock = getLock(sessionId);
	synchronized (lock) {
		if (!this.events.containsKey(sessionId)) {
			lock.wait(10000);
		}
	}
	return (E) this.events.get(sessionId);
}
 
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:13,代码来源:SessionEventRegistry.java

示例7: onApplicationEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
public void onApplicationEvent(AbstractSessionEvent event) {
	String sessionId = event.getSessionId();
	this.events.put(sessionId, event);
	Object lock = getLock(sessionId);
	synchronized (lock) {
		lock.notifyAll();
	}
}
 
开发者ID:kazuhira-r,项目名称:spring-session-infinispan,代码行数:9,代码来源:SessionEventRegistry.java

示例8: waitForEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private <E extends AbstractSessionEvent> E waitForEvent(String sessionId)
		throws InterruptedException {
	Object lock = getLock(sessionId);
	synchronized (lock) {
		if (!this.events.containsKey(sessionId)) {
			lock.wait(10000);
		}
	}
	return (E) this.events.get(sessionId);
}
 
开发者ID:kazuhira-r,项目名称:spring-session-infinispan,代码行数:12,代码来源:SessionEventRegistry.java

示例9: onApplicationEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
@Override
public void onApplicationEvent(AbstractSessionEvent event) {
	String sessionId = event.getSessionId();
	this.events.put(sessionId, event);
	Object lock = getLock(sessionId);
	synchronized (lock) {
		lock.notifyAll();
	}
}
 
开发者ID:spring-projects,项目名称:spring-session,代码行数:10,代码来源:SessionEventRegistry.java

示例10: getEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <E extends AbstractSessionEvent> E getEvent(String sessionId)
		throws InterruptedException {
	return (E) waitForEvent(sessionId);
}
 
开发者ID:spring-projects,项目名称:spring-session-data-mongodb,代码行数:6,代码来源:SessionEventRegistry.java

示例11: createHttpSessionEvent

import org.springframework.session.events.AbstractSessionEvent; //导入依赖的package包/类
private HttpSessionEvent createHttpSessionEvent(AbstractSessionEvent event) {
	Session session = event.getSession();
	HttpSession httpSession = new HttpSessionAdapter<>(session,
			this.context);
	return new HttpSessionEvent(httpSession);
}
 
开发者ID:spring-projects,项目名称:spring-session,代码行数:7,代码来源:SessionEventHttpSessionListenerAdapter.java


注:本文中的org.springframework.session.events.AbstractSessionEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。