Created
April 25, 2015 08:28
-
-
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…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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