private void handleCreated(Map<Object, Object> loaded, String channel) { String id = channel.substring(channel.lastIndexOf(":") + 1); Session session = loadSession(id, loaded); publishEvent(new SessionCreatedEvent(this, session)); }
@Override public void entryAdded(EntryEvent<String, MapSession> event) { MapSession session = event.getValue(); if (session.getId().equals(session.getOriginalId())) { if (logger.isDebugEnabled()) { logger.debug("Session created with id: " + session.getId()); } this.eventPublisher.publishEvent(new SessionCreatedEvent(this, session)); } }
RedissonSession session = getSession(body); if (session != null) { publishEvent(new SessionCreatedEvent(this, session));
RedissonSession session = getSession(body); if (session != null) { publishEvent(new SessionCreatedEvent(this, session));
@Before public void setup() { this.listener = new SessionEventHttpSessionListenerAdapter( Arrays.asList(this.listener1, this.listener2)); this.listener.setServletContext(new MockServletContext()); Session session = new MapSession(); this.destroyed = new SessionDestroyedEvent(this, session); this.created = new SessionCreatedEvent(this, session); }
protected void emitSessionCreatedEvent(String sessionId) { logger.debugf("Emitting session created %s", sessionId); springEventsPublisher.ifPresent(p -> p.publishEvent(new SessionCreatedEvent(eventSource, sessionId))); }
/** * Constructs a new {@link SessionCreatedEvent} initialized with the given {@link Session}, * using the {@link #getSessionRepository() SessionRepository} as the event source. * * @param session {@link Session} that is the subject of the {@link AbstractSessionEvent event}. * @return a new {@link SessionCreatedEvent}. * @see org.springframework.session.events.SessionCreatedEvent * @see org.springframework.session.Session * @see #getSessionRepository() */ protected SessionCreatedEvent newSessionCreatedEvent(Session session) { return new SessionCreatedEvent(getSessionRepository(), session); }
@Override public void entryAdded(EntryEvent<String, MapSession> event) { MapSession session = event.getValue(); if (session.getId().equals(session.getOriginalId())) { if (logger.isDebugEnabled()) { logger.debug("Session created with id: " + session.getId()); } this.eventPublisher.publishEvent(new SessionCreatedEvent(this, session)); } }
@Override public MongoSession createSession() { MongoSession session = new MongoSession(); if (this.maxInactiveIntervalInSeconds != null) { session.setMaxInactiveInterval(Duration.ofSeconds(this.maxInactiveIntervalInSeconds)); } publishEvent(new SessionCreatedEvent(this, session)); return session; }
/** * Creates a new {@link MongoSession} that is capable of being persisted by this * {@link ReactiveSessionRepository}. * <p> * This allows optimizations and customizations in how the {@link MongoSession} is * persisted. For example, the implementation returned might keep track of the changes * ensuring that only the delta needs to be persisted on a save. * </p> * * @return a new {@link MongoSession} that is capable of being persisted by this * {@link ReactiveSessionRepository} */ @Override public Mono<MongoSession> createSession() { return Mono.justOrEmpty(this.maxInactiveIntervalInSeconds) .map(MongoSession::new) .map(mongoSession -> { publishEvent(new SessionCreatedEvent(this, mongoSession)); return mongoSession; }) .switchIfEmpty(Mono.just(new MongoSession())); }
RedissonSession session = findById(body); if (session != null) { publishEvent(new SessionCreatedEvent(this, session));