Package org.apache.wicket

Examples of org.apache.wicket.Session$Counter


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


    {
      if (activeRequests.get() > 0)
      {
        requestdata.setActiveRequest(activeRequests.decrementAndGet());
      }
      Session session = Session.get();
      String sessionId = session.getId();
      requestdata.setSessionId(sessionId);

      Object sessionInfo = getSessionInfo(session);
      requestdata.setSessionInfo(sessionInfo);

      long sizeInBytes = -1;
      if (Application.exists() &&
        Application.get().getRequestLoggerSettings().getRecordSessionSize())
      {
        try
        {
          sizeInBytes = session.getSizeInBytes();
        }
        catch (Exception e)
        {
          // log the error and let the request logging continue (this is what happens in
          // the detach phase of the request cycle anyway. This provides better
View Full Code Here

      ThreadContext.setApplication(app);

      app.setName(getClass().getName());
      app.initApplication();

      Session session = new WebSession(new MockWebRequest(Url.parse("/")));
      app.getSessionStore().bind(null, session);
      ThreadContext.setSession(session);

      GuiceComponentInjector injector = new GuiceComponentInjector(app, new Module()
      {
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

    {
      if (activeRequests.get() > 0)
      {
        requestdata.setActiveRequest(activeRequests.decrementAndGet());
      }
      Session session = Session.get();
      String sessionId = session.getId();
      requestdata.setSessionId(sessionId);

      Object sessionInfo = getSessionInfo(session);
      requestdata.setSessionInfo(sessionInfo);

      long sizeInBytes = -1;
      if (Application.exists() &&
        Application.get().getRequestLoggerSettings().getRecordSessionSize())
      {
        try
        {
          sizeInBytes = session.getSizeInBytes();
        }
        catch (Exception e)
        {
          // log the error and let the request logging continue (this is what happens in
          // the detach phase of the request cycle anyway. This provides better
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.getPageManager().sessionExpired(session.getId());

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

    Page lastRenderedPage = tester.getLastRenderedPage();
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

    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

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

    {
      if (activeRequests.get() > 0)
      {
        rd.setActiveRequest(activeRequests.decrementAndGet());
      }
      Session session = Session.get();
      String sessionId = session.getId();
      rd.setSessionId(sessionId);

      Object sessionInfo = getSessionInfo(session);
      rd.setSessionInfo(sessionInfo);

      long sizeInBytes = -1;
      if (Application.get().getRequestLoggerSettings().getRecordSessionSize())
      {
        try
        {
          sizeInBytes = session.getSizeInBytes();
        }
        catch (Exception e)
        {
          // log the error and let the request logging continue (this is what happens in
          // the
View Full Code Here

TOP

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

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.