此内容没有您所选择的语言版本。
7.2. Configuring a Remote JNDI Client
Remote JNDI clients can look up and connect to objects by name using JNDI. The client must have
jboss-client.jar
on its class path.
The following example shows how to look up the
myTestQueue
JMS queue from a remote JNDI client:
Example 7.2. Example Remote JNDI Lookup
Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); properties.put(Context.PROVIDER_URL, "remote://<hostname>:4447"); context = new InitialContext(properties); Queue myTestQueue = (Queue) context.lookup("jms/queue/myTestQueue");