@Test public void test_toString() { ProxyProviderImpl proxyProvider = new ProxyProviderImpl(); DummyRemoteService service = proxyProvider.getProxy(DummyRemoteService.class); String s = service.toString(); System.out.println(s); assertNotNull(s); }
public <T> T getProxy(Class<T> distributedServiceClass) { notNull("distributedServiceClass", distributedServiceClass); Object proxy = proxies.get(distributedServiceClass); if (proxy == null) { DistributedServiceInvocationHandler invocationHandler = buildDistributedServiceInvocationHandler(distributedServiceClass); proxy = Proxy.newProxyInstance( distributedServiceClass.getClassLoader(), new Class[]{distributedServiceClass}, invocationHandler); Object oldProxy = proxies.putIfAbsent(distributedServiceClass, proxy); proxy = oldProxy == null ? proxy : oldProxy; } return (T) proxy; }
ProxyProviderImpl implements ProxyProvider { public <T> T getProxy(Class<T> distributedServiceClass) { notNull("distributedServiceClass", distributedServiceClass); Object proxy = proxies.get(distributedServiceClass); if (proxy == null) { DistributedServiceInvocationHandler invocationHandler = buildDistributedServiceInvocationHandler(distributedServiceClass); proxy = Proxy.newProxyInstance( distributedServiceClass.getClassLoader(), new Class[]{distributedServiceClass}, invocationHandler); Object oldProxy = proxies.putIfAbsent(distributedServiceClass, proxy); proxy = oldProxy == null ? proxy : oldProxy; } return (T) proxy; } }
ProxyProviderImpl implements ProxyProvider { public <T> T getProxy(Class<T> distributedServiceClass) { notNull("distributedServiceClass", distributedServiceClass); Object proxy = proxies.get(distributedServiceClass); if (proxy == null) { DistributedServiceInvocationHandler invocationHandler = buildDistributedServiceInvocationHandler(distributedServiceClass); proxy = Proxy.newProxyInstance( distributedServiceClass.getClassLoader(), new Class[]{distributedServiceClass}, invocationHandler); Object oldProxy = proxies.putIfAbsent(distributedServiceClass, proxy); proxy = oldProxy == null ? proxy : oldProxy; } return (T) proxy; } ProxyProviderImpl();  ProxyProviderImpl(HazelcastInstance hazelcastInstance);  ProxyProviderImpl(String sliceName, HazelcastInstance hazelcastInstance);  ProxyProviderImpl(String sliceName, HazelcastInstance hazelcastInstance, IExecutorService executorService); }
ProxyProviderImpl implements ProxyProvider { public <T> T getProxy(Class<T> distributedServiceClass) { notNull("distributedServiceClass", distributedServiceClass); Object proxy = proxies.get(distributedServiceClass); if (proxy == null) { DistributedServiceInvocationHandler invocationHandler = buildDistributedServiceInvocationHandler(distributedServiceClass); proxy = Proxy.newProxyInstance( distributedServiceClass.getClassLoader(), new Class[]{distributedServiceClass}, invocationHandler); Object oldProxy = proxies.putIfAbsent(distributedServiceClass, proxy); proxy = oldProxy == null ? proxy : oldProxy; } return (T) proxy; } ProxyProviderImpl();  ProxyProviderImpl(HazelcastInstance hazelcastInstance);  ProxyProviderImpl(String sliceName, HazelcastInstance hazelcastInstance);  ProxyProviderImpl(String sliceName, HazelcastInstance hazelcastInstance, IExecutorService executorService); MethodInvocationHandlerFactory registerMethodInvocationHandlerFactory(MethodInvocationHandlerFactory factory); boolean isLocalCallOptimizationEnabled(); void setLocalCallOptimizationEnabled(boolean localCallOptimizationEnabled); MethodInvocationHandlerFactory unregisterMethodInvocationHandlerFactory(Class<Annotation> annotationClass); MethodInvocationHandlerFactory getMethodInvocationHandlerFactory(Class<Annotation> annotationClass); Set<Class<? extends Annotation>> getRegisteredAnnotations(); @Override String getSliceName(); @Override HazelcastInstance getHazelcastInstance(); DistributedMethodInvocationFactory getDistributedMethodInvocationFactory(); void setDistributedMethodInvocationFactory(DistributedMethodInvocationFactory distributedMethodInvocationFactory); T getProxy(Class<T> distributedServiceClass); }
ProxyProviderImpl implements ProxyProvider { public <T> T getProxy(Class<T> distributedServiceClass) { notNull("distributedServiceClass", distributedServiceClass); Object proxy = proxies.get(distributedServiceClass); if (proxy == null) { DistributedServiceInvocationHandler invocationHandler = buildDistributedServiceInvocationHandler(distributedServiceClass); proxy = Proxy.newProxyInstance( distributedServiceClass.getClassLoader(), new Class[]{distributedServiceClass}, invocationHandler); Object oldProxy = proxies.putIfAbsent(distributedServiceClass, proxy); proxy = oldProxy == null ? proxy : oldProxy; } return (T) proxy; } ProxyProviderImpl();  ProxyProviderImpl(HazelcastInstance hazelcastInstance);  ProxyProviderImpl(String sliceName, HazelcastInstance hazelcastInstance);  ProxyProviderImpl(String sliceName, HazelcastInstance hazelcastInstance, IExecutorService executorService); MethodInvocationHandlerFactory registerMethodInvocationHandlerFactory(MethodInvocationHandlerFactory factory); boolean isLocalCallOptimizationEnabled(); void setLocalCallOptimizationEnabled(boolean localCallOptimizationEnabled); MethodInvocationHandlerFactory unregisterMethodInvocationHandlerFactory(Class<Annotation> annotationClass); MethodInvocationHandlerFactory getMethodInvocationHandlerFactory(Class<Annotation> annotationClass); Set<Class<? extends Annotation>> getRegisteredAnnotations(); @Override String getSliceName(); @Override HazelcastInstance getHazelcastInstance(); DistributedMethodInvocationFactory getDistributedMethodInvocationFactory(); void setDistributedMethodInvocationFactory(DistributedMethodInvocationFactory distributedMethodInvocationFactory); T getProxy(Class<T> distributedServiceClass);  }