Last active
June 22, 2018 05:42
-
-
Save ricardojob/33606ef255ca9e56d9aa0e5be5048d64 to your computer and use it in GitHub Desktop.
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
private static final String SERVICE_INTEGRANTE = "java:global/core/ServiceDeIntegrante"; | |
public Service lookup() { | |
try { | |
Properties properties = new Properties(); | |
properties.put(InitialContext.INITIAL_CONTEXT_FACTORY, | |
"com.sun.enterprise.naming.SerialInitContextFactory"); | |
properties.setProperty("org.omg.CORBA.ORBInitialHost", "localhost"); | |
properties.setProperty("org.omg.CORBA.ORBInitialPort", "3700"); | |
Context context = new InitialContext(properties); | |
return (Service) context.lookup(SERVICE_INTEGRANTE); | |
} catch (NamingException ex) { | |
Logger.getLogger(ServiceLocator.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment