Package org.apache.wicket

Examples of org.apache.wicket.Application


    {
      String sessionId = evt.getSession().getId();

      log.debug("Session unbound: {}", sessionId);

      Application application = Application.get(applicationKey);
      if (application == null)
      {
        log.debug("Wicket application with name '{}' not found.", applicationKey);
        return;
      }

      ISessionStore sessionStore = application.getSessionStore();
      if (sessionStore != null)
      {
        for (UnboundListener listener : sessionStore.getUnboundListener())
        {
          listener.sessionUnbound(sessionId);
View Full Code Here


    }

    @Override
    public void run()
    {
      Application application = Application.get(applicationName);
      WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
      IWebSocketConnectionRegistry webSocketConnectionRegistry = webSocketSettings.getConnectionRegistry();
      IWebSocketConnection connection = webSocketConnectionRegistry.getConnection(application, sessionId, key);

      int dataIndex = 0;
View Full Code Here

  public void broadcast(ConnectedMessage connection, IWebSocketPushMessage message)
  {
    Args.notNull(connection, "connection");
    Args.notNull(message, "message");

    Application application = connection.getApplication();
    String sessionId = connection.getSessionId();
    IKey key = connection.getKey();
    IWebSocketConnection wsConnection = registry.getConnection(application, sessionId, key);
    if (wsConnection == null)
    {
View Full Code Here

   *            type componentClass
   */
  public static <T extends Component> void authorize(final Class<T> componentClass,
    final String roles)
  {
    final Application application = Application.get();
    InstantiationPermissions permissions = application.getMetaData(INSTANTIATION_PERMISSIONS);
    if (permissions == null)
    {
      permissions = new InstantiationPermissions();
      application.setMetaData(INSTANTIATION_PERMISSIONS, permissions);
    }
    permissions.authorize(componentClass, new Roles(roles));
  }
View Full Code Here

   * @param componentClass
   *            The component class
   */
  public static <T extends Component> void authorizeAll(final Class<T> componentClass)
  {
    Application application = Application.get();
    InstantiationPermissions authorizedRoles = application.getMetaData(INSTANTIATION_PERMISSIONS);
    if (authorizedRoles != null)
    {
      authorizedRoles.authorizeAll(componentClass);
    }
  }
View Full Code Here

    IKey key = getRegistryKey();
    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
View Full Code Here

    }


    if (isWicketRequest(relativePath))
    {
      Application previous = null;
      if (Application.exists())
      {
        previous = Application.get();
      }
      try
View Full Code Here

    // Begin encoding URL
    final AppendingStringBuffer url = new AppendingStringBuffer(64);

    // Get page Class
    final Class<? extends Page> pageClass = requestTarget.getPageClass();
    final Application application = Application.get();

    // Find pagemap name
    String pageMapName = requestTarget.getPageMapName();
    if (pageMapName == null)
    {
      IRequestTarget currentTarget = requestCycle.getRequestTarget();
      if (currentTarget instanceof IPageRequestTarget)
      {
        Page currentPage = ((IPageRequestTarget)currentTarget).getPage();
        final IPageMap pageMap = currentPage.getPageMap();
        if (pageMap.isDefault())
        {
          pageMapName = "";
        }
        else
        {
          pageMapName = pageMap.getName();
        }
      }
      else
      {
        pageMapName = "";
      }
    }

    WebRequestEncoder encoder = new WebRequestEncoder(url);
    if (!application.getHomePage().equals(pageClass) ||
      !"".equals(pageMapName) ||
      (application.getHomePage().equals(pageClass) && requestTarget instanceof BookmarkableListenerInterfaceRequestTarget))
    {
      /*
       * Add <page-map-name>:<bookmarkable-page-class>
       *
       * Encode the url so it is correct even for class names containing non ASCII characters,
View Full Code Here

   */
  private void testContentType()
  {
    if (contentType == null || contentType.indexOf("unknown") != -1)
    {
      Application application = Application.get();
      if (application instanceof WebApplication)
      {
        // TODO Post 1.2: General: For non webapplication another method
        // should be implemented (getMimeType on application?)
        contentType = ((WebApplication)application).getServletContext().getMimeType(
View Full Code Here

    for (ITargetRespondListener listener : respondListeners)
    {
      listener.onTargetRespond(this);
    }

    final Application app = Application.get();

    // Determine encoding
    final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding();

    // Set content type based on markup type for page
    response.setCharacterEncoding(encoding);
    response.setContentType("text/xml; charset=" + encoding);
View Full Code Here

TOP

Related Classes of org.apache.wicket.Application

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.