Package org.jboss.resteasy.spi

Examples of org.jboss.resteasy.spi.ResteasyDeployment


      return start(bindPath, domain, null, null);
   }
  
   public static ResteasyDeployment start(String bindPath, SecurityDomain domain, Hashtable<String,String> initParams, Hashtable<String,String> contextParams) throws Exception
   {
      ResteasyDeployment deployment = new ResteasyDeployment();
      deployment.setSecurityEnabled(true);
      String applicationClass = null;
      if (contextParams != null)
      {
         applicationClass = contextParams.get("javax.ws.rs.Application");
         String mediaTypeMappingsString = contextParams.get("resteasy.media.type.mappings");
         if (mediaTypeMappingsString != null)
         {
            Map<String, String> mediaTypeMappings = new HashMap<String, String>();
            String[] mappings = mediaTypeMappingsString.split(",");
            for (int i = 0; i < mappings.length; i++)
            {
               String[] mapping = mappings[i].split(":");
               mediaTypeMappings.put(mapping[0], mapping[1]);
            }
            deployment.setMediaTypeMappings(mediaTypeMappings);
         }
      }
      if (applicationClass == null && initParams != null)
      {
         applicationClass = initParams.get("javax.ws.rs.Application");
      }
      if (applicationClass != null)
      {
         deployment.setApplicationClass(applicationClass);
      }
      return start(bindPath, domain, deployment, initParams, contextParams);
   }
View Full Code Here


      deployment.getRegistry().addPerRequestResource(TestResource.class);
   }
  
   public void beforeProviderInstance(ClientExceptionMapper<?> mapper) throws Exception
   {
      deployment = new ResteasyDeployment();
      ArrayList<Object> providers = new ArrayList<Object>();
      providers.add(mapper);
      deployment.setProviders(providers);
      deployment.start();
      deployment.getRegistry().addPerRequestResource(TestResource.class);
View Full Code Here

      deployment.getRegistry().addPerRequestResource(TestResource.class);
   }
  
   public void beforeApplicationClasses(final Class<?> mapper) throws Exception
   {
      deployment = new ResteasyDeployment();
      Application application = new Application()
      {
         public Set<Class<?>> getClasses()
         {
            HashSet<Class<?>> classes = new HashSet<Class<?>>();
View Full Code Here

      deployment.getRegistry().addPerRequestResource(TestResource.class);
   }
  
   public void beforeApplicationSingleton(final ClientExceptionMapper<?> mapper) throws Exception
   {
      deployment = new ResteasyDeployment();
      Application application = new Application()
      {
         public Set<Object> getSingletons()
         {
            HashSet<Object> singletons = new HashSet<Object>();
View Full Code Here

      deployment.getRegistry().addPerRequestResource(TestResource.class);
   }
  
   public void beforeClassNames(final Class<?> mapper) throws Exception
   {
      deployment = new ResteasyDeployment();
      ArrayList<String> providerClasses = new ArrayList<String>();
      providerClasses.add(mapper.getName());
      deployment.setProviderClasses(providerClasses);
      deployment.start();
      deployment.getRegistry().addPerRequestResource(TestResource.class);
View Full Code Here

   }

   @BeforeClass
   public static void before() throws Exception
   {
      ResteasyDeployment deployment = new ResteasyDeployment();
      deployment.setApplication(new MyApplicationConfig());
      EmbeddedContainer.start(deployment);
   }
View Full Code Here


   @BeforeClass
   public static void before() throws Exception
   {
      ResteasyDeployment deployment = new ResteasyDeployment();
      deployment.setApplicationClass("org.jboss.resteasy.test.finegrain.application.MyApplicationConfig");
      EmbeddedContainer.start(deployment);
   }
View Full Code Here

   }

   @Test
   public void testAppInjection()
   {
      ResteasyDeployment deployment = new ResteasyDeployment();
      deployment.setApplicationClass(MyApplication.class.getName());
      deployment.start();
      MyApplication app = (MyApplication)deployment.getApplication();
      Assert.assertNotNull(app.app);
   }
View Full Code Here

   }

   @Override
   public ResteasyDeployment createDeployment()
   {
      ResteasyDeployment deployment = super.createDeployment();
      deployment.getDefaultContextObjects().put(FilterConfig.class, config);
      deployment.getDefaultContextObjects().put(ServletContext.class, config.getServletContext());
      return deployment;
   }
View Full Code Here

   }

   @Override
   public ResteasyDeployment createDeployment()
   {
      ResteasyDeployment deployment = super.createDeployment();
      deployment.getDefaultContextObjects().put(ServletConfig.class, config);
      deployment.getDefaultContextObjects().put(ServletContext.class, config.getServletContext());
      return deployment;
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.spi.ResteasyDeployment

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.