Examples of ApplicationContextImpl


Examples of org.eclipse.rap.rwt.internal.application.ApplicationContextImpl

  }

  @Test
  public void testRegistersTabrisLoader() {
    ApplicationImpl application = mockConfiguration();
    ApplicationContextImpl applicationContext = application.getApplicationContext();

    TabrisClientInstaller.install( application );

    verify( applicationContext.getResourceRegistry() ).add( eq( "index.json" ), any( TabrisResourceLoader.class ) );
  }
View Full Code Here

Examples of org.eclipse.rap.rwt.internal.application.ApplicationContextImpl

  }

  @Test
  public void testRegistersTabrisLoaderWithId() {
    ApplicationImpl application = mockConfiguration();
    ApplicationContextImpl applicationContext = application.getApplicationContext();

    TabrisClientInstaller.install( application, "foo" );

    verify( applicationContext.getResourceRegistry() ).add( eq( "index.json" ), any( TabrisResourceLoader.class ) );
  }
View Full Code Here

Examples of org.eclipse.rap.rwt.internal.application.ApplicationContextImpl

    TabrisClientInstaller.install( application, "" );
  }

  private ApplicationImpl mockConfiguration() {
    ApplicationImpl application = mock( ApplicationImpl.class );
    ApplicationContextImpl context = mock( ApplicationContextImpl.class );
    ThemeManager themeManager = mock( ThemeManager.class );
    when( context.getThemeManager() ).thenReturn( themeManager );
    when( context.getServletContext() ).thenReturn( mock( ServletContext.class ) );
    when( application.getApplicationContext() ).thenReturn( context );
    ResourceRegistry resourceRegistry = mock( ResourceRegistry.class );
    when( context.getResourceRegistry() ).thenReturn( resourceRegistry );
    return application;
  }
View Full Code Here

Examples of org.eclipse.rap.rwt.internal.application.ApplicationContextImpl

        return new ByteArrayInputStream( "".getBytes() );
      }
    };
    StyleSheet styleSheet = CssFileReader.readStyleSheet( "", resourceLoader );
    Theme theme = new Theme( themeId, "unknown", styleSheet );
    ApplicationContextImpl applicationContext = ContextProvider.getContext().getApplicationContext();
    environment.resetThemes();
    ThemeManager themeManager = applicationContext.getThemeManager();
    themeManager.registerTheme( theme );
  }
View Full Code Here

Examples of org.eclipse.rap.rwt.internal.application.ApplicationContextImpl

        return new ByteArrayInputStream( "".getBytes() );
      }
    };
    StyleSheet styleSheet = CssFileReader.readStyleSheet( "", resourceLoader );
    Theme theme = new Theme( themeId, "unknown", styleSheet );
    ApplicationContextImpl applicationContext = ContextProvider.getContext().getApplicationContext();
    environment.resetThemes();
    ThemeManager themeManager = applicationContext.getThemeManager();
    themeManager.registerTheme( theme );
  }
View Full Code Here

Examples of org.eclipse.rap.rwt.internal.application.ApplicationContextImpl

   * @param path The path to register the lookup. Needs to start with a "/".
   *
   * @since 0.9
   */
  public void registerEntryPointLookup( Bundle bundle, String path ) {
    ApplicationContextImpl appContext = application.getApplicationContext();
    BundleContext bundleContext = bundle.getBundleContext();
    httpServiceTracker = new HttpServiceTracker( bundleContext, appContext, path );
    httpServiceTracker.open();
  }
View Full Code Here

Examples of org.exoplatform.services.rest.impl.ApplicationContextImpl

    }

    @SuppressWarnings("unchecked")
    private MultivaluedMap<String, String> getParameters(UriInfo info) {
        MultivaluedMap<String, String> parameters = info.getQueryParameters();
        ApplicationContextImpl context = (ApplicationContextImpl) info;

        Type formType = (ParameterizedType) MultivaluedMapImpl.class.getGenericInterfaces()[0];
        MediaType contentType = context.getHttpHeaders().getMediaType();
        if (contentType == null) {
            contentType = MediaType.APPLICATION_FORM_URLENCODED_TYPE;
        }

        MultivaluedMap<String, String> form = new MultivaluedMapImpl();
        try {
            MessageBodyReader reader = context.getProviders().getMessageBodyReader(MultivaluedMap.class, formType, null,
                    contentType);
            if (reader != null) {
                form = (MultivaluedMap<String, String>) reader.readFrom(MultivaluedMap.class, formType, null, contentType,
                        context.getHttpHeaders().getRequestHeaders(), context.getContainerRequest().getEntityStream());
            }
        } catch (Exception e) {
        }

        parameters.putAll(form);
View Full Code Here

Examples of org.exoplatform.services.rest.impl.ApplicationContextImpl

      resourceBinder = (ResourceBinder)container.getComponentInstanceOfType(ResourceBinder.class);
      assertNotNull(resourceBinder);
      requestHandler = (RequestHandlerImpl)container.getComponentInstanceOfType(RequestHandlerImpl.class);
      assertNotNull(requestHandler);
      providers = ProviderBinder.getInstance();
      ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));

      root = session.getRootNode().addNode("webdav-test", "nt:folder");

      // session.save();
View Full Code Here

Examples of org.exoplatform.services.rest.impl.ApplicationContextImpl

  
   @SuppressWarnings("unchecked")
   private MultivaluedMap<String, String> getParameters(UriInfo info)
   {
      MultivaluedMap<String, String> parameters = info.getQueryParameters();
      ApplicationContextImpl context = (ApplicationContextImpl)info;     
     
      Type formType = MultivaluedMapImpl.class.getGenericInterfaces()[0];
      MediaType contentType = context.getHttpHeaders().getMediaType();
      if (contentType == null) {
         contentType = MediaType.APPLICATION_FORM_URLENCODED_TYPE;
      }     

      MultivaluedMap<String, String> form = new MultivaluedMapImpl();     
      try {
         MessageBodyReader reader =
            context.getProviders().getMessageBodyReader(MultivaluedMap.class, formType, null, contentType);
         if (reader != null) {
            form = (MultivaluedMap<String, String>)reader.readFrom(MultivaluedMap.class, formType, null, contentType, context
               .getHttpHeaders().getRequestHeaders(), context.getContainerRequest().getEntityStream());
         }
      } catch (Exception e) {        
      }
     
      parameters.putAll(form);
View Full Code Here

Examples of org.exoplatform.services.rest.impl.ApplicationContextImpl

    }

    @SuppressWarnings("unchecked")
    private MultivaluedMap<String, String> getParameters(UriInfo info) {
        MultivaluedMap<String, String> parameters = info.getQueryParameters();
        ApplicationContextImpl context = (ApplicationContextImpl) info;

        Type formType = MultivaluedMapImpl.class.getGenericInterfaces()[0];
        MediaType contentType = context.getHttpHeaders().getMediaType();
        if (contentType == null) {
            contentType = MediaType.APPLICATION_FORM_URLENCODED_TYPE;
        }

        MultivaluedMap<String, String> form = new MultivaluedMapImpl();
        try {
            MessageBodyReader reader = context.getProviders().getMessageBodyReader(MultivaluedMap.class, formType, null,
                    contentType);
            if (reader != null) {
                form = (MultivaluedMap<String, String>) reader.readFrom(MultivaluedMap.class, formType, null, contentType,
                        context.getHttpHeaders().getRequestHeaders(), context.getContainerRequest().getEntityStream());
            }
        } catch (IllegalStateException e) {
            if (log.isTraceEnabled()) {
                log.trace(e.getMessage(), e);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.