Examples of RedefiningClassLoader


Examples of org.jboss.ejb3.test.proxy.impl.ejbthree1889.RedefiningClassLoader

      setUpBeforeClass();
     
      bootstrap.deploy(SessionTestCaseBase.class);
     
      URLClassLoader master = (URLClassLoader) Thread.currentThread().getContextClassLoader();
      ClassLoader cl = new RedefiningClassLoader(master, MyServiceBean.class, MyService.class, MyServiceRemoteBusiness.class);
      Thread.currentThread().setContextClassLoader(cl);
      try
      {
         Class<?> beanClass = cl.loadClass(MyServiceBean.class.getName());
        
         ServiceContainer container = Utils.createService(beanClass);
        
         Ejb3RegistrarLocator.locateRegistrar().bind(container.getName(), container);
      }
View Full Code Here

Examples of org.jboss.ejb3.test.proxy.impl.ejbthree1889.RedefiningClassLoader

  
   @Test
   public void testDifferentClassLoader() throws Exception
   {
      URLClassLoader master = (URLClassLoader) Thread.currentThread().getContextClassLoader();
      ClassLoader cl = new RedefiningClassLoader(master, MyServiceRemoteBusiness.class, MyService.class, RemoteServiceTestCase.class);
      Thread.currentThread().setContextClassLoader(cl);
      try
      {
         System.err.println("X  latestUserDefinedLoader = " + Bridge.get().getLatestUserDefinedLoader());
         // setup a proper call stack class loader
         Class<?> testClass = cl.loadClass(RemoteServiceTestCase.class.getName());
         assertEquals(cl, testClass.getClassLoader());
         Method testMethod = testClass.getMethod("test1");
         Object obj = testClass.newInstance();
         testMethod.invoke(obj);
        
         Class<?> intf = cl.loadClass(MyServiceRemoteBusiness.class.getName());
         InitialContext ctx = new InitialContext();
         Method method = intf.getMethod("getUuid");
         System.err.println(method.getDeclaringClass().getClassLoader());
         Object bean = ctx.lookup("MyServiceBean/remote");
         System.err.println(bean.getClass().getInterfaces()[0].getClassLoader());
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.