如何为下面给出的 java 代码设置应用程序?
Hashtable<String, String> properties = new Hashtable<String, String>();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.test.factory");
properties.put("com.domain", "DevelopmentDomain");
// properties.put(Context.PROVIDER_URL, "tcp://test:0506");
properties.put(Context.PROVIDER_URL, "tcp://10.00.0.00:0506");
properties.put(Context.SECURITY_PRINCIPAL, "aaa");
properties.put(Context.SECURITY_CREDENTIALS, "aaa");
javax.naming.Context context = new javax.naming.InitialContext(properties);
ConnectionFactory factory = (ConnectionFactory) context.lookup("ImpactPocQueueConnectionFactory");
Connection connection = factory.createConnection();
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination queue = session.createQueue("test.producer");
我在这里和那里看到了很多例子,但没有一个给出完整的画面。