/** Create a proxy instance whose methods invoke RPCs. */ @SuppressWarnings("unchecked") public static <T> T getClient(Class<T> iface, SpecificRequestor requestor) throws IOException { return (T)Proxy.newProxyInstance(requestor.data.getClassLoader(), new Class[] { iface }, requestor); }
/** Create a proxy instance whose methods invoke RPCs. */ @SuppressWarnings("unchecked") public static <T> T getClient(Class<T> iface, Transceiver transceiver, SpecificData data) throws IOException { Protocol protocol = data.getProtocol(iface); return (T)Proxy.newProxyInstance (data.getClassLoader(), new Class[] { iface }, new SpecificRequestor(protocol, transceiver, data)); }
if (c == null) { try { c = ClassUtils.forName(getClassLoader(), getClassName(schema)); } catch (ClassNotFoundException e) { try { // nested class? c = ClassUtils.forName(getClassLoader(), getNestedClassName(schema)); } catch (ClassNotFoundException ex) { c = NO_CLASS;
if (c == null) { try { c = ClassUtils.forName(getClassLoader(), getClassName(schema)); } catch (ClassNotFoundException e) { c = NO_CLASS;
@Test public void testClassLoader() throws Exception { ClassLoader loader = new ClassLoader() {}; SpecificResponder responder = new SpecificResponder(Simple.class, new TestImpl(), new SpecificData(loader)); assertEquals(responder.getSpecificData().getClassLoader(), loader); SpecificRequestor requestor = new SpecificRequestor(Simple.class, client, new SpecificData(loader)); assertEquals(requestor.getSpecificData().getClassLoader(), loader); }
/** Create a proxy instance whose methods invoke RPCs. */ @SuppressWarnings("unchecked") public static <T> T getClient(Class<T> iface, SpecificRequestor requestor) throws IOException { return (T)Proxy.newProxyInstance(requestor.data.getClassLoader(), new Class[] { iface }, requestor); }
/** Create a proxy instance whose methods invoke RPCs. */ @SuppressWarnings("unchecked") public static <T> T getClient(Class<T> iface, Transceiver transciever, SpecificData data) throws IOException { Protocol protocol = data.getProtocol(iface); return (T)Proxy.newProxyInstance (data.getClassLoader(), new Class[] { iface }, new SpecificRequestor(protocol, transciever, data)); }
if (c == null) { try { c = getClassLoader().loadClass(getClassName(schema)); } catch (ClassNotFoundException e) { c = NO_CLASS;
if (c == null) { try { c = ClassUtils.forName(getClassLoader(), getClassName(schema)); } catch (ClassNotFoundException e) { c = NO_CLASS;