Package org.apache.wicket.session

Examples of org.apache.wicket.session.ISessionStore


    GAEUtils.init(this);
  }
 
  @Override
  protected ISessionStore newSessionStore() {
    ISessionStore result = GAEUtils.newSessionStore(this);
    if (result == null) {
      result = super.newSessionStore();
    }
    return result;
  }
View Full Code Here


    GAEUtils.init(this);
  }
 
  @Override
  protected ISessionStore newSessionStore() {
    ISessionStore result = GAEUtils.newSessionStore(this);
    if (result == null) {
      result = super.newSessionStore();
    }
    return result;
  }
View Full Code Here

   * @return The Session that is found in the current request or created if not.
   */
  public static Session findOrCreate(Request request, Response response)
  {
    Application application = Application.get();
    ISessionStore sessionStore = application.getSessionStore();
    Session session = sessionStore.lookup(request);

    if (session == null)
    {
      // Create session using session factory
      session = application.newSession(request, response);
View Full Code Here

    if (RequestCycle.get() == null)
    {
      return;
    }

    ISessionStore store = getSessionStore();
    Request request = RequestCycle.get().getRequest();
    if (store.lookup(request) == null)
    {
      // explicitly create a session
      id = store.getSessionId(request, true);
      // bind it
      store.bind(request, this);

      if (temporarySessionAttributes != null)
      {
        for (Entry<String, Object> entry : temporarySessionAttributes.entrySet())
        {
          store.setAttribute(request, String.valueOf(entry.getKey()), entry.getValue());
        }
        temporarySessionAttributes = null;
      }
    }
  }
View Full Code Here

      {
        throw new IllegalStateException(
          "Cannot set the attribute: no RequestCycle available.  If you get this error when using WicketTester.startPage(Page), make sure to call WicketTester.createRequestCycle() beforehand.");
      }

      ISessionStore store = getSessionStore();
      Request request = cycle.getRequest();

      // extra check on session binding event
      if (value == this)
      {
        Object current = store.getAttribute(request, name);
        if (current == null)
        {
          String id = store.getSessionId(request, false);
          if (id != null)
          {
            // this is a new instance. wherever it came from, bind
            // the session now
            store.bind(request, (Session)value);
          }
        }
      }

      // Set the actual attribute
      store.setAttribute(request, name, value);
    }
    else
    {
      // we don't have to synchronize, as it is impossible a temporary
      // session instance gets shared across threads
View Full Code Here

    if (RequestCycle.get() == null)
    {
      return;
    }

    ISessionStore store = getSessionStore();
    Request request = RequestCycle.get().getRequest();
    if (store.lookup(request) == null)
    {
      // explicitly create a session
      id = store.getSessionId(request, true);
      // bind it
      store.bind(request, this);

      if (temporarySessionAttributes != null)
      {
        for (Map.Entry<String, Serializable> entry : temporarySessionAttributes.entrySet())
        {
          store.setAttribute(request, entry.getKey(), entry.getValue());
        }
        temporarySessionAttributes = null;
      }
    }
  }
View Full Code Here

      {
        throw new IllegalStateException(
          "Cannot set the attribute: no RequestCycle available.  If you get this error when using WicketTester.startPage(Page), make sure to call WicketTester.createRequestCycle() beforehand.");
      }

      ISessionStore store = getSessionStore();
      Request request = cycle.getRequest();

      // extra check on session binding event
      if (value == this)
      {
        Object current = store.getAttribute(request, name);
        if (current == null)
        {
          String id = store.getSessionId(request, false);
          if (id != null)
          {
            // this is a new instance. wherever it came from, bind
            // the session now
            store.bind(request, (Session)value);
          }
        }
      }

      // Set the actual attribute
      store.setAttribute(request, name, value);
    }
    else
    {
      // we don't have to synchronize, as it is impossible a temporary
      // session instance gets shared across threads
View Full Code Here

             * The default second level cache session store does not play well
             * with our custom reloading filter so we use a custom session store.
             */
            return new DebugHttpSessionStore(this);
        } else {
            ISessionStore sessionStore = super.newSessionStore();
            logger.info("wicket production mode, using: " + sessionStore);
            return sessionStore;
        }
    }
View Full Code Here

    if (RequestCycle.get() == null)
    {
      return;
    }

    ISessionStore store = getSessionStore();
    Request request = RequestCycle.get().getRequest();
    if (store.lookup(request) == null)
    {
      // explicitly create a session
      id = store.getSessionId(request, true);
      // bind it
      store.bind(request, this);

      if (temporarySessionAttributes != null)
      {
        for (Map.Entry<String, Serializable> entry : temporarySessionAttributes.entrySet())
        {
          store.setAttribute(request, String.valueOf(entry.getKey()), entry.getValue());
        }
        temporarySessionAttributes = null;
      }
    }
  }
View Full Code Here

      {
        throw new IllegalStateException(
          "Cannot set the attribute: no RequestCycle available.  If you get this error when using WicketTester.startPage(Page), make sure to call WicketTester.createRequestCycle() beforehand.");
      }

      ISessionStore store = getSessionStore();
      Request request = cycle.getRequest();

      // extra check on session binding event
      if (value == this)
      {
        Object current = store.getAttribute(request, name);
        if (current == null)
        {
          String id = store.getSessionId(request, false);
          if (id != null)
          {
            // this is a new instance. wherever it came from, bind
            // the session now
            store.bind(request, (Session)value);
          }
        }
      }

      // Set the actual attribute
      store.setAttribute(request, name, value);
    }
    else
    {
      // we don't have to synchronize, as it is impossible a temporary
      // session instance gets shared across threads
View Full Code Here

TOP

Related Classes of org.apache.wicket.session.ISessionStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.