provider.url 을 -D 옵션으로

This commit is contained in:
zoomk
2025-10-28 17:52:02 +09:00
parent 4c4a2a3ead
commit e887b97a19
2 changed files with 18 additions and 14 deletions
+2
View File
@@ -32,4 +32,6 @@ public interface Keys
public static final String CONNECT_FACTORY = "jms/cft01BapConnectionFactory"; public static final String CONNECT_FACTORY = "jms/cft01BapConnectionFactory";
public static final String PROVIDER_URL = System.getProperty("provider.url");
} }
@@ -193,20 +193,22 @@ public class ServiceLocator {
if (cache.containsKey(qConnFactoryName)) { if (cache.containsKey(qConnFactoryName)) {
factory = (QueueConnectionFactory) cache.get(qConnFactoryName); factory = (QueueConnectionFactory) cache.get(qConnFactoryName);
} else { } else {
factory = (QueueConnectionFactory) initial.lookup(qConnFactoryName); try {
cache.put(qConnFactoryName, factory); factory = (QueueConnectionFactory) initial.lookup(qConnFactoryName);
cache.put(qConnFactoryName, factory);
}catch(Exception e) {
Hashtable<String, Object> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, WEBLOGIC_INITIAL_CONTEXT_FACTORY);
/*Hashtable<String, Object> env = new Hashtable<>(); // Admin Server 포트를 사용하는 것이 안전
env.put(Context.INITIAL_CONTEXT_FACTORY, WEBLOGIC_INITIAL_CONTEXT_FACTORY); env.put(Context.PROVIDER_URL, Keys.PROVIDER_URL);
// Admin Server 포트를 사용하는 것이 안전 InitialContext initial = new InitialContext(env);
env.put(Context.PROVIDER_URL, "t3://192.168.240.176:8001");
InitialContext initial = new InitialContext(env); factory =
(QueueConnectionFactory) initial.lookup(qConnFactoryName);
factory = cache.put(qConnFactoryName, factory);
(QueueConnectionFactory) initial.lookup(qConnFactoryName); }
cache.put(qConnFactoryName, factory);*/
} }
} catch (NamingException ne) { } catch (NamingException ne) {
//throw new ServiceLocatorException(ne); //throw new ServiceLocatorException(ne);