Created
December 2, 2011 14:15
-
-
Save james-carr/1423368 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
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, | |
"org.apache.commons.naming.java.javaURLContextFactory"); | |
System.setProperty(Context.URL_PKG_PREFIXES, | |
"org.apache.naming"); | |
InitialContext ic = new InitialContext(); | |
ic.createSubcontext("java:"); | |
ic.createSubcontext("java:/comp"); | |
ic.createSubcontext("java:/comp/env"); | |
ic.bind("java:/comp/env/amqpBroker", 'localhost'); | |
ic.bind("java:/comp/env/sfdcServerUrl", 'lolcopterhost'); | |
// v.s. | |
SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder() | |
builder.bind('java:/comp/env/amqpBroker', 'localhost') | |
builder.bind('java:/comp/env/sfdcServerUrl', 'lolcopterhost') | |
builder.activate() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment