Examples of ProxyContainer


Examples of jfun.yan.containers.ProxyContainer

  }
  private static TestSuite suite(){
    return new TestSuite(ProxyContainerTestCase.class);
  }
    protected Container createImplementationHidingPicoContainer() {
        return new ProxyContainer();
    }
View Full Code Here

Examples of jfun.yan.containers.ProxyContainer

    protected Container createImplementationHidingPicoContainer() {
        return new ProxyContainer();
    }

    protected Container createPicoContainer(Container parent) {
        return new ProxyContainer().inherit(parent);
    }
View Full Code Here

Examples of jfun.yan.containers.ProxyContainer

    }*/

    public void testUsageOfADifferentComponentAdapterFactory() {
        // Jira bug 212
        Container parent = new DefaultContainer();
        Container pico = new ProxyContainer().inherit(parent);
        pico.registerConstructor(List.class, ArrayList.class, null);
        List list1 = (List) pico.getInstanceOfType(List.class);
        List list2 = (List) pico.getInstanceOfType(List.class);
        pico.verify();
        assertNotNull(list1);
View Full Code Here

Examples of jfun.yan.containers.ProxyContainer

        assertSame(s1, pc.getInstance(String.class));
        assertSame(s2, pc.getInstance("mark"));
    }

    protected Container createImplementationHidingPicoContainer(){
      return new ProxyContainer();
    }
View Full Code Here

Examples of jfun.yan.containers.ProxyContainer

        public void actionPerformed(ActionEvent e) {
            throw new RuntimeException("woohoo");
        }
    }
    protected Container getContainerImpl(){
      return new ProxyContainer();
    }
View Full Code Here

Examples of org.apache.geronimo.proxy.ProxyContainer

        ClassLoader cl = JaasLoginServiceMBean.class.getClassLoader();

        // Setup the client side container..
        RequestChannelInterceptor remoteInterceptor = new RequestChannelInterceptor(target, cl);
        ProxyContainer clientContainer = new ProxyContainer(remoteInterceptor);
        return (JaasLoginServiceMBean) clientContainer.createProxy(cl , new Class[]{JaasLoginServiceMBean.class});

    }
View Full Code Here

Examples of org.apache.geronimo.proxy.ProxyContainer

       
        ClassLoader cl = JaasLoginServiceMBean.class.getClassLoader();
       
        // Setup the client side container..
        RequestChannelInterceptor remoteInterceptor = new RequestChannelInterceptor(target, cl);
        ProxyContainer clientContainer = new ProxyContainer(remoteInterceptor);
        return (JaasLoginServiceMBean) clientContainer.createProxy(cl , new Class[]{JaasLoginServiceMBean.class});
       
    }
View Full Code Here

Examples of org.apache.geronimo.proxy.ProxyContainer

        ClassLoader cl = JaasLoginServiceMBean.class.getClassLoader();

        // Setup the client side container..
        RequestChannelInterceptor remoteInterceptor = new RequestChannelInterceptor(target, cl);
        ProxyContainer clientContainer = new ProxyContainer(remoteInterceptor);
        return (JaasLoginServiceMBean) clientContainer.createProxy(cl , new Class[]{JaasLoginServiceMBean.class});

    }
View Full Code Here

Examples of org.apache.geronimo.proxy.ProxyContainer

    private Object createProxy(Object target, boolean mockFromRemoteMV ) throws Exception {

        // Setup the server side contianer..
        ReflexiveInterceptor ri = new ReflexiveInterceptor(target);
        DeMarshalingInterceptor demarshaller = new DeMarshalingInterceptor(ri, target.getClass().getClassLoader());
        ProxyContainer serverContainer = new ProxyContainer(demarshaller);
        Long dmiid = InterceptorRegistry.instance.register(demarshaller);

        // Setup the client side container..
        RemoteTransportInterceptor transport = new RemoteTransportInterceptor(URISupport.setFragment(connectURI, ""+dmiid));
        IntraVMRoutingInterceptor localRouter = new IntraVMRoutingInterceptor(ri, dmiid, false);
        InterVMRoutingInterceptor remoteRouter = new InterVMRoutingInterceptor(transport, localRouter);
        if(mockFromRemoteMV) {
            remoteRouter.setTargetVMID("THIS CRAP WILL NOT MATCH THE LOCAL VM ID");
        }
        ProxyContainer clientContainer = new ProxyContainer(remoteRouter);

        return clientContainer.createProxy(target.getClass().getClassLoader(), target.getClass().getInterfaces());
    }
View Full Code Here

Examples of org.apache.geronimo.proxy.ProxyContainer

    private Object createProxy(Object target) throws Exception {
       
        // Setup the server side contianer..
        ReflexiveInterceptor ri = new ReflexiveInterceptor(target);
        DeMarshalingInterceptor demarshaller = new DeMarshalingInterceptor(ri, target.getClass().getClassLoader());
        ProxyContainer serverContainer = new ProxyContainer(demarshaller);

        // Configure the server side interceptors.
        Long dmiid = InterceptorRegistry.instance.register(demarshaller);
       
        // Setup the client side container..       
        IntraVMRoutingInterceptor localRouter = new IntraVMRoutingInterceptor(ri, dmiid, false);
        ProxyContainer clientContainer = new ProxyContainer(localRouter);
        return clientContainer.createProxy(target.getClass().getClassLoader(), target.getClass().getInterfaces());
    }
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.