Skip to content

Instantly share code, notes, and snippets.

@james-carr
Created December 2, 2011 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save james-carr/1423368 to your computer and use it in GitHub Desktop.
Save james-carr/1423368 to your computer and use it in GitHub Desktop.
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