Package org.exoplatform.services.rest.impl.resource

Examples of org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl


      AbstractResourceDescriptor descriptor = null;
      if (path != null)
      {
         try
         {
            descriptor = new AbstractResourceDescriptorImpl(resourceClass);
         }
         catch (Exception e)
         {
            String msg = "Unexpected error occurs when process resource class " + resourceClass.getName();
            LOG.error(msg, e);
View Full Code Here


      AbstractResourceDescriptor descriptor = null;
      if (path != null)
      {
         try
         {
            descriptor = new AbstractResourceDescriptorImpl(resource);
         }
         catch (Exception e)
         {
            String msg = "Unexpected error occurs when process resource class " + resource.getClass().getName();
            LOG.error(msg, e);
View Full Code Here

         throw new ResourcePublicationException("Resource class " + resourceClass.getName()
            + " it is not root resource. " + "Path annotation javax.ws.rs.Path is not specified for this class.");
      }
      try
      {
         AbstractResourceDescriptor descriptor = new AbstractResourceDescriptorImpl(resourceClass, invokerFactory);
         // validate AbstractResourceDescriptor
         descriptor.accept(rdv);
         if (properties != null)
            descriptor.getProperties().putAll(properties);
         addResource(new PerRequestObjectFactory<AbstractResourceDescriptor>(descriptor));
      }
      catch (Exception e)
      {
         throw new ResourcePublicationException(e.getMessage());
View Full Code Here

         throw new ResourcePublicationException("Resource class " + resource.getClass().getName()
            + " it is not root resource. " + "Path annotation javax.ws.rs.Path is not specified for this class.");
      }
      try
      {
         AbstractResourceDescriptor descriptor = new AbstractResourceDescriptorImpl(resource, invokerFactory);
         // validate AbstractResourceDescriptor
         descriptor.accept(rdv);
         if (properties != null)
            descriptor.getProperties().putAll(properties);
         addResource(new SingletonObjectFactory<AbstractResourceDescriptor>(descriptor, resource));
      }
      catch (Exception e)
      {
         throw new ResourcePublicationException(e.getMessage());
View Full Code Here

      // NOTE Locators can't accept entity
      MethodInvoker invoker = srld.getMethodInvoker();
      resource = invoker.invokeMethod(resource, srld, context);

      AbstractResourceDescriptor descriptor = new AbstractResourceDescriptorImpl(resource);
      SingletonObjectFactory<AbstractResourceDescriptor> locResource =
         new SingletonObjectFactory<AbstractResourceDescriptor>(descriptor, resource);

      // dispatch again newly created resource
      dispatch(request, response, context, locResource, resource, newRequestPath);
View Full Code Here

      // NOTE Locators can't accept entity
      MethodInvoker invoker = srld.getMethodInvoker();
      resource = invoker.invokeMethod(resource, srld, context);

      AbstractResourceDescriptor descriptor = new AbstractResourceDescriptorImpl(resource, invokerFactory);
      SingletonObjectFactory<AbstractResourceDescriptor> locResource =
         new SingletonObjectFactory<AbstractResourceDescriptor>(descriptor, resource);

      // dispatch again newly created resource
      dispatch(request, response, context, locResource, resource, newRequestPath);
View Full Code Here

      {
         // Specify SINGLETON life-cycle to avoid processing constructors and fields.
         // We are not interested about it since creation instance of resource is
         // responsibility of sub-resource locator.
         AbstractResourceDescriptor subResourceDescriptor =
            new AbstractResourceDescriptorImpl(srld.getMethod().getReturnType(), ComponentLifecycleScope.SINGLETON);
         org.exoplatform.services.rest.wadl.research.Resource wadlSubResource = processResource(subResourceDescriptor);
         wadlSubResource.setPath(srld.getPathValue().getPath());
         wadlResource.getMethodOrResource().add(wadlSubResource);
      }
   }
View Full Code Here

   }

   public void testBaseWadlGenerator() throws Exception
   {

      AbstractResourceDescriptor ard = new AbstractResourceDescriptorImpl(Resource1.class);
      WadlProcessor wadlProcessor = new WadlProcessor();
      Application app = wadlProcessor.process(ard, new URI("http://localhost:8080/ws/rs"));

      JAXBContext jctx = JAXBContext.newInstance(Application.class);
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
View Full Code Here

TOP

Related Classes of org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl

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.