List of usage examples for org.springframework.remoting.rmi RmiProxyFactoryBean setLookupStubOnStartup
public void setLookupStubOnStartup(boolean lookupStubOnStartup)
From source file:com.mysoft.b2b.event.scheduler.protocol.rmi.RMIClientHelper.java
public static ProtocolService getRMIProtocolService(String protocolUrl) { String serviceUrl = ""; if (protocolUrl != null && protocolUrl.endsWith("/")) { serviceUrl = protocolUrl;/*from w w w . jav a 2 s . c o m*/ } else { serviceUrl = protocolUrl + "/"; } serviceUrl = serviceUrl + ProtocolService.class.getSimpleName(); RmiProxyFactoryBean rpfb = new RmiProxyFactoryBean(); rpfb.setServiceUrl(serviceUrl); rpfb.setServiceInterface(ProtocolService.class); try { rpfb.setLookupStubOnStartup(false); rpfb.setRefreshStubOnConnectFailure(true); rpfb.afterPropertiesSet(); } catch (Exception e) { logger.info("Can't get the remote RMI server: " + serviceUrl + ", because " + e.getMessage()); return null; } logger.info("Success to init RMI local proxy service for " + serviceUrl); return (ProtocolService) rpfb.getObject(); }