public void setJmsConfiguration(JMSConfiguration jmsConfiguration) {
this.jmsConfiguration = jmsConfiguration;
}
private void configureJndi(JMSConfiguration jmsConfiguration) {
final Configuration cfg = configuration == null
? CallContext.resolveConfiguration(serviceName) : configuration;
JNDIConfiguration jndiCfg = jmsConfiguration.getJndiConfig();
final String jndiConnectionFactoryName = getJndiProperty("jndiConnectionFactoryName");
if (jndiConnectionFactoryName != null) {
if (jndiCfg == null) {
jndiCfg = new JNDIConfiguration();
jmsConfiguration.setJndiConfig(jndiCfg);
}
jndiCfg.setJndiConnectionFactoryName(jndiConnectionFactoryName);
}
final String connectionUserName = getJndiProperty("connectionUserName");
if (connectionUserName != null) {
if (jndiCfg == null) {
jndiCfg = new JNDIConfiguration();
jmsConfiguration.setJndiConfig(jndiCfg);
}
jndiCfg.setConnectionUserName(connectionUserName);
}
final String connectionPassword = getJndiProperty("connectionPassword");
if (connectionPassword != null) {
if (jndiCfg == null) {
jndiCfg = new JNDIConfiguration();
jmsConfiguration.setJndiConfig(jndiCfg);
}
jndiCfg.setConnectionPassword(connectionPassword);
}
Properties env = jndiCfg == null ? null : jndiCfg.getEnvironment();
final boolean hasNoEnv = env == null;
if (hasNoEnv) {
env = new Properties();
}
cfg.fillProperties("jndiConfig.environment", env);
if (workPrefix != null) {
cfg.fillProperties(workPrefix + "jndiConfig.environment", env);
}
if (hasNoEnv && !env.isEmpty()) {
if (jndiCfg == null) {
jndiCfg = new JNDIConfiguration();
jmsConfiguration.setJndiConfig(jndiCfg);