use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class JmsHostWrapper method deepCopy.
public ConfigBeanProxy deepCopy(ConfigBeanProxy proxy) {
JmsHostWrapper clone = new JmsHostWrapper();
if (!(proxy instanceof JmsHost))
return null;
JmsHost host = (JmsHost) proxy;
try {
clone.setHost(host.getHost());
clone.setPort(host.getPort());
clone.setName(host.getName());
clone.setAdminPassword(host.getAdminPassword());
clone.setAdminUserName(host.getAdminUserName());
} catch (PropertyVetoException e) {
// todo : handle this exception
}
return null;
}
use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class JmsProviderLifecycle method eagerStartupRequired.
private boolean eagerStartupRequired() {
JmsService jmsService = getJmsService();
if (jmsService == null)
return false;
List<JmsHost> jmsHostList = jmsService.getJmsHost();
if (jmsHostList == null)
return false;
String defaultJmsHostName = jmsService.getDefaultJmsHost();
JmsHost defaultJmsHost = null;
for (JmsHost host : jmsHostList) {
if (defaultJmsHostName != null && defaultJmsHostName.equals(host.getName())) {
defaultJmsHost = host;
break;
}
}
if (defaultJmsHost == null && jmsHostList.size() > 0) {
defaultJmsHost = jmsHostList.get(0);
}
boolean lazyInit = false;
if (defaultJmsHost != null)
lazyInit = Boolean.parseBoolean(defaultJmsHost.getLazyInit());
// we don't manage lifecycle of remote brokers
if (brokerType == BROKER_TYPE.REMOTE)
return false;
// Initialize on demand is currently enabled based on a system property
String jmsInitializeOnDemand = System.getProperty(JMS_INITIALIZE_ON_DEMAND);
// if the system property is true, don't do eager startup
if ("true".equals(jmsInitializeOnDemand))
return false;
if (brokerType == BROKER_TYPE.EMBEDDED && (!lazyInit))
return true;
// local broker has eager startup by default
if (brokerType == BROKER_TYPE.LOCAL)
return true;
return false;
}
use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class MQAddressList method getMasterBroker.
public String getMasterBroker(String clustername) {
String masterbrk = null;
// if (rep != null) {
try {
JmsHost mb = getMasterJmsHostInCluster(clustername);
JmsService js = getJmsServiceForMasterBroker(clustername);
MQUrl url = createUrl(mb, js);
masterbrk = url.toString();
if (logger.isLoggable(Level.FINE))
logger.log(Level.FINE, "Master broker obtained is " + masterbrk);
} catch (Exception e) {
LogHelper.log(logger, Level.SEVERE, JMSLoggerInfo.GET_MASTER_FAILED, e);
}
// }
return masterbrk;
}
use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class MQAddressList method getResolvedLocalJmsHostsInMyCluster.
public Map<String, JmsHost> getResolvedLocalJmsHostsInMyCluster(final boolean includeMe) {
final Map<String, JmsHost> map = new HashMap<String, JmsHost>();
Cluster cluster = getClusterForServer(myName);
if (cluster != null) {
final Server[] buddies = getServersInCluster(cluster);
for (final Server as : buddies) {
if (!includeMe && myName.equals(as.getName()))
continue;
JmsHost copy = null;
try {
copy = getResolvedJmsHost(as);
} catch (Exception e) {
// e.printStackTrace();
}
map.put(as.getName(), copy);
}
}
return (map);
}
use of com.sun.enterprise.connectors.jms.config.JmsHost in project Payara by payara.
the class MQAddressList method setupForStandaloneServerInstance.
/**
* Gets the admin config context associated with this server instance
* Usage Notice: Use this only for operations that are performed in DAS
* and requires the admin config context
*/
/* private ConfigContext getAdminConfigContext() {
return com.sun.enterprise.admin.server.core.AdminService.
getAdminService().getAdminContext().getAdminConfigContext();
} */
/**
* Setup addresslist for Standalone server instance in EE
*/
private void setupForStandaloneServerInstance() throws Exception {
if (jmsService.getType().equals(ActiveJmsResourceAdapter.REMOTE)) {
logFine("REMOTE Standalone server instance and hence use default setup");
defaultSetup();
} else {
// For LOCAL or EMBEDDED standalone server instances, we need to resolve
// the JMSHost
logFine("LOCAL/EMBEDDED Standalone server instance");
JmsHost host = getResolvedJmsHostForStandaloneServerInstance(this.targetName);
MQUrl url = createUrl(host);
urlList.add(url);
}
}
Aggregations