use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class MQAddressList method getResolvedJmsHost.
private JmsHost getResolvedJmsHost(Server as) throws Exception {
if (as == null) {
return null;
}
if (logger.isLoggable(Level.FINE))
logFine("getResolvedJmsHost " + as);
// final JmsService jmsService = Globals.get(JmsService.class);
// JmsHost jmsHost = null;
// if (JMSServiceType.LOCAL.toString().equals(jmsService.getType()) || JMSServiceType.EMBEDDED.toString().equals(jmsService.getType())) {
// jmsHost = getDefaultJmsHost(jmsService);
// }
// return ( jmsHost );
JmsHost jmsHost = getResolvedLocalJmsHostInServer(as);
JmsHost copy = createJmsHostCopy(jmsHost, as);
String hostName = getNodeHostName(as);
// "JMS_PROVIDER_PORT", "7676");
String port = JmsRaUtil.getJMSPropertyValue(as);
copy.setHost(hostName);
copy.setPort(port);
return copy;
}
use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class MQAddressList method setupForCluster.
/**
* Setup the address list after calculating the JMS hosts
* belonging to the local appserver cluster members.
* For LOCAL/EMBEDDED clusters the MQ broker corresponding
* to "this" server instance needs to be placed ahead
* of the other brokers of the other siblings in the AS
* cluter to enable sticky connection balancing by MQ.
*/
private void setupForCluster() throws Exception {
java.util.Map<String, JmsHost> hostMap = getResolvedLocalJmsHostsInMyCluster(true);
// First add my jms host.
JmsHost jmsHost = hostMap.get(myName);
MQUrl myUrl = createUrl(jmsHost, nodeHost);
urlList.add(myUrl);
hostMap.remove(myName);
// Add all buddies to URL.
for (JmsHost host : hostMap.values()) {
MQUrl url = createUrl(host);
urlList.add(url);
}
}
use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class MQAddressList method createJmsHostCopy.
private JmsHost createJmsHostCopy(final JmsHost jmsHost, final Server server) {
JmsHost jmsHostCopy = new JmsHostWrapper();
try {
jmsHostCopy.setAdminPassword(jmsHost.getAdminPassword());
jmsHostCopy.setAdminUserName(jmsHost.getAdminUserName());
jmsHostCopy.setName(jmsHost.getName());
jmsHostCopy.setHost(jmsHost.getHost());
jmsHostCopy.setPort(jmsHost.getPort());
} catch (Exception tfe) {
// todo: handle this exception
tfe.printStackTrace();
}
return jmsHostCopy;
}
use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class JMSConfigListener method getDefaultJmsHost.
private JmsHost getDefaultJmsHost(JmsService jmsService) {
JmsHost jmsHost = null;
String defaultJmsHostName = jmsService.getDefaultJmsHost();
List<JmsHost> jmsHostsList = jmsService.getJmsHost();
for (int i = 0; i < jmsHostsList.size(); i++) {
JmsHost tmpJmsHost = (JmsHost) jmsHostsList.get(i);
if (tmpJmsHost != null && tmpJmsHost.getName().equals(defaultJmsHostName))
jmsHost = tmpJmsHost;
}
if (jmsHost == null && jmsHostsList.size() > 0)
jmsHost = jmsHostsList.get(0);
return jmsHost;
}
Aggregations