Package org.apache.geronimo.kernel.proxy

Examples of org.apache.geronimo.kernel.proxy.ProxyManager.createProxy()


            Set<AbstractName> set = kernel.listGBeans(query); // all Jetty connectors
            for (AbstractName name : set) {
                GBeanData data = kernel.getGBeanData(name);
                ReferencePatterns refs = data.getReferencePatterns(JettyConnector.CONNECTOR_CONTAINER_REFERENCE);
                if (containerName.equals(refs.getAbstractName())) {
                    results.add((JettyWebConnector) mgr.createProxy(name, JettyWebConnector.class.getClassLoader()));
                }
            }
            return results.toArray(new JettyWebConnector[results.size()]);
        } catch (Exception e) {
            throw (IllegalArgumentException) new IllegalArgumentException("Unable to look up connectors for Jetty container '" + containerName + "'").initCause(e);
View Full Code Here


        Set names = kernel.listGBeans(query);
        TomcatWebContainer[] results = new TomcatWebContainer[names.size()];
        int i=0;
        for (Iterator it = names.iterator(); it.hasNext(); i++) {
            AbstractName name = (AbstractName) it.next();
            results[i] = (TomcatWebContainer) proxyManager.createProxy(name, TomcatWebContainer.class.getClassLoader());
        }
        return results;
    }

    /**
 
View Full Code Here

        AbstractNameQuery query = new AbstractNameQuery(TomcatWebConnector.class.getName());
        Set<AbstractName> names = kernel.listGBeans(query);
        for (AbstractName name : names) {
            try {
                if (kernel.getAttribute(name, "protocol").equals(protocol)) {
                    result.add((TomcatWebConnector)proxyManager.createProxy(name, TomcatWebConnector.class.getClassLoader()));
                }
            } catch (Exception e) {
                log.error("Unable to check the protocol for a connector", e);
            }
        }
View Full Code Here

        Set names = kernel.listGBeans(query);
        TomcatWebConnector[] results = new TomcatWebConnector[names.size()];
        int i=0;
        for (Iterator it = names.iterator(); it.hasNext(); i++) {
            AbstractName name = (AbstractName) it.next();
            results[i] = (TomcatWebConnector) proxyManager.createProxy(name, TomcatWebConnector.class.getClassLoader());
        }
        return results;
    }

    /**
 
View Full Code Here

                ReferencePatterns refs = data.getReferencePatterns(ConnectorGBean.CONNECTOR_CONTAINER_REFERENCE);
                if(containerName.equals(refs.getAbstractName())) {
                    try {
                        String testProtocol = (String) kernel.getAttribute(name, "protocol");
                        if(testProtocol != null && testProtocol.equals(protocol)) {
                            results.add(mgr.createProxy(name, TomcatWebConnector.class.getClassLoader()));
                        }
                    } catch (Exception e) {
                        log.error("Unable to look up protocol for connector '"+name+"'",e);
                    }
                    break;
View Full Code Here

            for (Iterator it = set.iterator(); it.hasNext();) {
                AbstractName name = (AbstractName) it.next(); // a single Tomcat connector
                GBeanData data = kernel.getGBeanData(name);
                ReferencePatterns refs = data.getReferencePatterns(ConnectorGBean.CONNECTOR_CONTAINER_REFERENCE);
                if (containerName.equals(refs.getAbstractName())) {
                    results.add(mgr.createProxy(name, TomcatWebConnector.class.getClassLoader()));
                }
            }
            return (TomcatWebConnector[]) results.toArray(new TomcatWebConnector[results.size()]);
        } catch (Exception e) {
            throw (IllegalArgumentException) new IllegalArgumentException("Unable to look up connectors for Tomcat container '"+containerName).initCause(e);
View Full Code Here

    public Object getContent() throws IllegalStateException {
        Kernel kernel = getKernel();
        // todo HACK: this is a very bad idea
        ProxyManager proxyManager = kernel.getProxyManager();
        return proxyManager.createProxy(target, type);
    }
}
View Full Code Here

        gbean.setAttribute("finalInt", new Integer(123));
        kernel.loadGBean(gbean, myCl);
        kernel.startGBean(name);
        ProxyManager mgr = kernel.getProxyManager();

        Object test = mgr.createProxy(name, myCl);
        assertTrue(test instanceof MockEndpoint);
        assertTrue(test instanceof MockParentInterface1);
        assertTrue(test instanceof MockParentInterface2);
        assertTrue(test instanceof MockChildInterface1);
        assertTrue(test instanceof MockChildInterface2);
View Full Code Here

        assertEquals("Foo", ((MockParentInterface2)test).getValue());
        ((MockChildInterface1)test).getFinalInt();
        ((MockChildInterface2)test).doNothing();
        assertEquals("Foo", ((MockChildInterface2)test).doSomething("Foo"));

        test = mgr.createProxy(name, MockEndpoint.class);
        assertTrue(test instanceof MockEndpoint);
        assertFalse(test instanceof MockParentInterface1);
        assertFalse(test instanceof MockParentInterface2);
        assertFalse(test instanceof MockChildInterface1);
        assertFalse(test instanceof MockChildInterface2);
View Full Code Here

        assertFalse(test instanceof MockParentInterface2);
        assertFalse(test instanceof MockChildInterface1);
        assertFalse(test instanceof MockChildInterface2);
        assertFalse(test instanceof Comparable);

        test = mgr.createProxy(name, MockEndpoint.class, new Class[]{MockParentInterface2.class, MockChildInterface2.class});
        assertTrue(test instanceof MockEndpoint);
        assertTrue(test instanceof MockParentInterface1);
        assertTrue(test instanceof MockParentInterface2);
        assertTrue(test instanceof MockChildInterface1);
        assertTrue(test instanceof MockChildInterface2);
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.