Skip to content

Instantly share code, notes, and snippets.

@AlexMocioi
Created April 25, 2015 08:28
Show Gist options
  • Save AlexMocioi/f9cfcdd461fcb0852bd0 to your computer and use it in GitHub Desktop.
Save AlexMocioi/f9cfcdd461fcb0852bd0 to your computer and use it in GitHub Desktop.
In cazul de fata am folosit o proprietate de pe adnotare ca sa ma asigur ca numele cu care este expus serviciul este acelasi cu cel dupa care il caut. mai departe mai ai nevoie de url-ul unde sa il caute (aici se calculeaza in RemoteParams.getRmiServerUrls(serviceName)) si de interfata bean-ului de spring. Pentru cazul in care ai bean-urile si l…
@Bean
public ClinicalDocumentService clinicalDocumentService() {
String serviceName = ((RemotableInterface) ClinicalDocumentService.class.getAnnotation(RemotableInterface.class)).serviceName();
RmiLbServiceConfig<ClinicalDocumentService> serviceConfig = new RmiLbServiceConfig<ClinicalDocumentService>(
RemoteParams.getRmiServerUrls(serviceName), ClinicalDocumentService.class);
serviceConfig.setMonitorPeriod(60L);
serviceConfig.setLookupStubOnStartup(true);
RmiProxyFactory factory = RmiProxyFactory.getInstance();
return factory.create(serviceConfig);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment