Package org.exoplatform.services.rest.impl

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


      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

  
   @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

    }

    @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

  
   @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())
View Full Code Here

  
   @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())
View Full Code Here

      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");

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

      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

      ProviderBinder.setInstance(new ProviderBinder());
      providers = ProviderBinder.getInstance();

      binder.clear();

      ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers, dependencySupplier));
     
      launcher = new ResourceLauncher(requestHandler);
   }
View Full Code Here

      binder = (ResourceBinder)container.getComponentInstanceOfType(ResourceBinder.class);
      requestHandler = (RequestHandlerImpl)container.getComponentInstanceOfType(RequestHandlerImpl.class);
      // reset providers to be sure it is clean
      ProviderBinder.setInstance(new ProviderBinder());
      providers = ProviderBinder.getInstance();
      ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
      binder.clear();
      groovyPublisher = (GroovyJaxrsPublisher)container.getComponentInstanceOfType(GroovyJaxrsPublisher.class);
      launcher = new ResourceLauncher(requestHandler);
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.rest.impl.ApplicationContextImpl

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.