Package org.apache.wicket

Examples of org.apache.wicket.Session$LruComparator


   * Test for WICKET-3123
   */
  @Test
  public void sessionBinding()
  {
    Session session = tester.getSession();
    assertTrue(session.isTemporary());
    session.bind();
    assertFalse(session.isTemporary());
  }
View Full Code Here


  /**
   * Test for WICKET-3123
   */
  public void testSessionBinding()
  {
    Session session = tester.getSession();
    assertTrue(session.isTemporary());
    session.bind();
    assertFalse(session.isTemporary());
  }
View Full Code Here

   * Test for WICKET-3123
   */
  @Test
  public void sessionBinding()
  {
    Session session = tester.getSession();
    assertTrue(session.isTemporary());
    session.bind();
    assertFalse(session.isTemporary());
  }
View Full Code Here

    IWebSocketConnection connection = connectionRegistry.getConnection(application, sessionId, key);

    if (connection != null && connection.isOpen())
    {
      Application oldApplication = ThreadContext.getApplication();
      Session oldSession = ThreadContext.getSession();
      RequestCycle oldRequestCycle = ThreadContext.getRequestCycle();

      WebSocketResponse webResponse = new WebSocketResponse(connection);
      try
      {
        RequestCycle requestCycle;
        if (oldRequestCycle == null || message instanceof IWebSocketPushMessage)
        {
          RequestCycleContext context = new RequestCycleContext(webRequest, webResponse,
              application.getRootRequestMapper(), application.getExceptionMapperProvider().get());

          requestCycle = application.getRequestCycleProvider().get(context);
          requestCycle.getUrlRenderer().setBaseUrl(baseUrl);
          ThreadContext.setRequestCycle(requestCycle);
        }
        else
        {
          requestCycle = oldRequestCycle;
        }

        ThreadContext.setApplication(application);

        Session session;
        if (oldSession == null || message instanceof IWebSocketPushMessage)
        {
          ISessionStore sessionStore = application.getSessionStore();
          session = sessionStore.lookup(webRequest);
          ThreadContext.setSession(session);
        }
        else
        {
          session = oldSession;
        }

        IPageManager pageManager = session.getPageManager();
        try
        {
          Page page = getPage(pageManager);

          WebSocketRequestHandler requestHandler = new WebSocketRequestHandler(page, connection);
View Full Code Here

    AjaxLinkExpirePage page = tester.startPage(AjaxLinkExpirePage.class);

    int initialPageId = page.getPageId();

    Url urlToAjaxLink = tester.urlFor(page.link);
    Session session = tester.getSession();
    session.clear();

    // fire a request to the ajax link on the expired page
    executeAjaxUrlWithLastBaseUrl(urlToAjaxLink);

    Page lastRenderedPage = tester.getLastRenderedPage();
View Full Code Here

  @Override
  protected ClientInfo newClientInfo()
  {
    if (getApplication().getRequestCycleSettings().getGatherExtendedBrowserInfo())
    {
      Session session = getSession();
      if (session.getMetaData(BROWSER_WAS_POLLED_KEY) == null)
      {
        // we haven't done the redirect yet; record that we will be
        // doing that now and redirect
        session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE);
        String url = "/" + getRequest().getURL();
        throw new RestartResponseException(new BrowserInfoPage(url));
      }
      // if we get here, the redirect already has been done; clear
      // the meta data entry; we don't need it any longer is the client
      // info object will be cached too
      session.setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null);
    }
    return new WebClientInfo(this);
  }
View Full Code Here

          if (requestParameters.isOnlyProcessIfPathActive())
          {
            // this request has indeed been flagged as
            // process-only-if-path-is-active

            Session session = Session.get();
            IPageMap pageMap = session.pageMapForName(
              requestParameters.getPageMapName(), false);
            if (pageMap == null)
            {
              // requested pagemap no longer exists - ignore this
              // request
View Full Code Here

   */
  @Override
  protected String load()
  {
    // Initialize information that we need to work successfully
    final Session session = Session.get();
    if (session != null)
    {
      locale = session.getLocale();
    }
    else
    {
      throw new WicketRuntimeException(
        "Cannot attach a string resource model without a Session context because that is required to get a Localizer");
View Full Code Here

    // Get locator to search for the resource
    final IResourceStreamLocator locator = Application.get()
      .getResourceSettings()
      .getResourceStreamLocator();

    final Session session = Session.get();
    final String style = session.getStyle();
    final Locale locale = session.getLocale();

    MarkupResourceStream markupResourceStream = null;
    Class<?> containerClass = getClass();

    while (!(containerClass.equals(MarkupComponentBorder.class)))
View Full Code Here

          Session.SESSION_ATTRIBUTE_NAME;

        log.debug("will use {} as the session key to get the Wicket session", sessionKey);
      }

      Session session = (Session)httpSession.getAttribute(sessionKey);
      if (session != null)
      {
        // set the session's threadlocal
        Session.set(session);
View Full Code Here

TOP

Related Classes of org.apache.wicket.Session$LruComparator

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.