Package org.jboss.resteasy.core.interception

Examples of org.jboss.resteasy.core.interception.InterceptorRegistry


   }

   @Test
   public void testPrecedence() throws Exception
   {
      InterceptorRegistry registry = new InterceptorRegistry(Object.class, ResteasyProviderFactory.getInstance());
      registry.appendPrecedence("A");
      registry.appendPrecedence("B");
      registry.appendPrecedence("C");
      registry.appendPrecedence("D");
      registry.insertPrecedenceAfter("C", "AfterC");
      registry.insertPrecedenceBefore("B", "BeforeB");
      registry.insertPrecedenceBefore("A", "BeforeA");
      registry.insertPrecedenceAfter("D", "AfterD");

      registry.register(PrecedenceTest.class);
      registry.register(B.class);
      registry.register(DClass.class);
      registry.register(C.class);
      registry.register(A.class);
      registry.register(AfterD.class);
      registry.register(BeforeA.class);
      registry.register(BeforeB.class);
      registry.register(AfterC.class);

      Object[] array = registry.bind(null, null);

      for (Object obj : array) System.out.println(obj.getClass().getName());

      Assert.assertEquals(array[0].getClass(), BeforeA.class);
      Assert.assertEquals(array[1].getClass(), A.class);
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.core.interception.InterceptorRegistry

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.