Package org.apache.wicket

Examples of org.apache.wicket.Session$Counter


      // if there is a pagemap name specified and multiwindow support is
      // on
      if (getPageMapName() != null)
      {
        // try to find out whether the pagemap already exists
        Session session = Session.get();
        if (session.pageMapForName(getPageMapName(), false) == null)
        {
          deletePageMap = true;
        }
        parameters.setPageMapName(getPageMapName());
      }
View Full Code Here


      // should we cleanup the pagemap?
      if (deletePageMap == true)
      {
        // get the pagemap
        Session session = Session.get();
        IPageMap pageMap = session.pageMapForName(getPageMapName(), false);

        // if there is any remove it
        if (pageMap != null)
        {
          session.removePageMap(pageMap);
          deletePageMap = false;
        }
      }

      if (windowClosedCallback != null)
View Full Code Here

      // if there is a pagemap name specified and multiwindow support is on
      if (getPageMapName() != null)
      {
        // try to find out whether the pagemap already exists
        Session session = Session.get();
        if (session.pageMapForName(getPageMapName(), false) == null)
        {
          deletePageMap = true;
        }
        parameters.setPageMapName(getPageMapName());
      }
View Full Code Here

      // should we cleanup the pagemap?
      if (deletePageMap == true)
      {
        // get the pagemap
        Session session = Session.get();
        IPageMap pageMap = session.pageMapForName(getPageMapName(), false);

        // if there is any remove it
        if (pageMap != null)
        {
          session.removePageMap(pageMap);
          deletePageMap = false;
        }
      }

      if (windowClosedCallback != null)
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 (active.get() > 0)
      {
        rd.setActiveRequest(active.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
          // detach phase of the request cycle anyway. This provides better diagnostics).
          log.error(
            "Exception while determining the size of the session in the request logger: " +
              e.getMessage(), e);
        }
      }
      rd.setSessionSize(sizeInBytes);
      rd.setTimeTaken(timeTaken);

      requests.add(0, rd);
      if (sessionId != null)
      {
        SessionData sd = liveSessions.get(sessionId);
        if (sd == null && session.isSessionInvalidated() == false)
        {
          // passivated session or logger only started after it.
          sessionCreated(sessionId);
          sd = liveSessions.get(sessionId);
        }
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(newBrowserInfoPage(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

      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

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

    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);
          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 = (Page) pageManager.getPage(pageId);
          WebSocketRequestHandler requestHandler = new WebSocketRequestHandler(page, connection);
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.