Package org.apache.wicket

Examples of org.apache.wicket.Session$Counter


        }
    }
   
    @Override
    public Session newSession(Request request, Response response) {
        Session s = new GeoServerSession(request);
        if(s.getLocale() == null)
            s.setLocale(Locale.ENGLISH);
        return s;
    }
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

    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

    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

    {
      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.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

  /**
   * Test for WICKET-3123
   */
  public void testSessionBinding()
  {
    Session session = tester.getSession();
    assertTrue(session.isTemporary());
    session.bind();
    assertFalse(session.isTemporary());
  }
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

   */
  protected IRequestTarget resolveBookmarkablePage(final RequestCycle requestCycle,
    final RequestParameters requestParameters)
  {
    String bookmarkablePageClass = requestParameters.getBookmarkablePageClass();
    Session session = requestCycle.getSession();
    Class pageClass;
    try
    {
      pageClass = session.getClassResolver().resolveClass(bookmarkablePageClass);
    }
    catch (ClassNotFoundException e)
    {
      return new WebErrorCodeResponseTarget(HttpServletResponse.SC_NOT_FOUND,
        "Unable to load Bookmarkable Page");
    }

    try
    {
      PageParameters params = new PageParameters(requestParameters.getParameters());
      if (requestParameters.getComponentPath() != null &&
        requestParameters.getInterfaceName() != null)
      {
        final String componentPath = requestParameters.getComponentPath();
        final Page page = session.getPage(requestParameters.getPageMapName(),
          componentPath, requestParameters.getVersionNumber());

        if (page != null && page.getClass() == pageClass)
        {
          return resolveListenerInterfaceTarget(requestCycle, page, componentPath,
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.