@Override public void onUnbound(final String sessionId) { notify(new INotifier<ISessionListener>() { @Override public void notify(ISessionListener listener) { listener.onUnbound(sessionId); } }); }
/** * @see org.apache.wicket.session.ISessionStore.UnboundListener#sessionUnbound(java.lang.String) */ @Override public void sessionUnbound(final String sessionId) { getSessionListeners().onUnbound(sessionId); }
protected void registerSessionListeners() { getSessionListeners().add(session -> ((PluginUserSession) session).login()); }
/** * * @param requestCycle * @return Session */ public Session fetchCreateAndSetSession(final RequestCycle requestCycle) { Args.notNull(requestCycle, "requestCycle"); Session session = getSessionStore().lookup(requestCycle.getRequest()); if (session == null) { session = newSession(requestCycle.getRequest(), requestCycle.getResponse()); ThreadContext.setSession(session); internalGetPageManager().newSessionCreated(); sessionListeners.onCreated(session); } else { ThreadContext.setSession(session); } return session; }
@Override public void onInitialize(OrienteerWebApplication app, ODatabaseDocument db) { super.onInitialize(app, db); app.getSessionListeners().add(new ISessionListener() { @Override public void onCreated(Session session) { } @Override public void onUnbound(final String sessionId) { new DBClosure<Void>() { @Override protected Void execute(ODatabaseDocument db) { db.command(new OCommandSQL("UPDATE " + OCLASS_USER + " set " + ONLINE_FIELD + "=false where " + LAST_SESSION_FIELD + "= ?")).execute(sessionId); return null; } }.execute(); } }); }
/** * * @param requestCycle * @return Session */ public Session fetchCreateAndSetSession(final RequestCycle requestCycle) { Args.notNull(requestCycle, "requestCycle"); Session session = getSessionStore().lookup(requestCycle.getRequest()); if (session == null) { session = newSession(requestCycle.getRequest(), requestCycle.getResponse()); ThreadContext.setSession(session); internalGetPageManager().newSessionCreated(); sessionListeners.onCreated(session); } else { ThreadContext.setSession(session); } return session; }
application.getSessionListeners().add(sessionInjector);
@Override public void onCreated(final Session session) { notify(new INotifier<ISessionListener>() { @Override public void notify(ISessionListener listener) { listener.onCreated(session); } }); }
/** * @see org.apache.wicket.session.ISessionStore.UnboundListener#sessionUnbound(java.lang.String) */ @Override public void sessionUnbound(final String sessionId) { getSessionListeners().onUnbound(sessionId); }
application.getSessionListeners().add(new SessionInjector()); application.getComponentInstantiationListeners().add(new ComponentInjector()); application.getBehaviorInstantiationListeners().add(new BehaviorInjector());
@Override public void onCreated(final Session session) { notify(new INotifier<ISessionListener>() { @Override public void notify(ISessionListener listener) { listener.onCreated(session); } }); }
application.getSessionListeners().add(new SessionInjector()); application.getComponentInstantiationListeners().add(new ComponentInjector()); application.getBehaviorInstantiationListeners().add(new BehaviorInjector());
@Override public void onUnbound(final String sessionId) { notify(new INotifier<ISessionListener>() { @Override public void notify(ISessionListener listener) { listener.onUnbound(sessionId); } }); }
application.getSessionListeners().add(new SessionInjector(container));