Methods Summary |
---|
private JmsHost | getDefaultJmsHost(JmsService jmsService)
final JmsHost[] jmsHosts = jmsService.getJmsHost();
final String defaultHostName = jmsService.getDefaultJmsHost();
JmsHost defaultJmsHost = null;
for (final JmsHost h : jmsHosts) {
final String name = h.getName();
if (name.equals(defaultHostName)) {
defaultJmsHost = h;
break;
}
}
return ( defaultJmsHost );
|
public JmsService | getJmsServiceForMasterBroker(java.lang.String clusterName)
final String myCluster = ClusterHelper.getClusterByName(domainCC, clusterName).getName();
final Server[] buddies = ServerHelper.getServersInCluster(domainCC, myCluster);
final Config cfg = ServerHelper.getConfigForServer(domainCC, buddies[0].getName());
return cfg.getJmsService();
|
public JmsHost | getMasterJmsHostInCluster(java.lang.String clusterName)
final String myCluster = ClusterHelper.getClusterByName(domainCC, clusterName).getName();
final Server[] buddies = ServerHelper.getServersInCluster(domainCC, myCluster);
for (final Server as : buddies) {
try {
final JmsHost copy = getResolvedJmsHost(as);
// return the first valid host
// there may be hosts attached to an NA that is down
return copy;
} catch (Exception e) {
// we dont add the host if we cannot get it
;
}
}
throw new RuntimeException("No JMS hosts available to select as Master");
// final JmsHost copy = getResolvedJmsHost(buddies[0]);
|
public java.lang.String | getNodeAgentHostName(Server as)
final NodeAgent na = NodeAgentHelper.getNodeAgentForServer(domainCC, as.getName());
final boolean dasShookHandsWithNodeAgent = NodeAgentHelper.hasNodeAgentRendezvousd(domainCC, na);
if (! dasShookHandsWithNodeAgent)
throw new RuntimeException("Error: NA: " + na.getName() + " has not rendezvous'ed with DAS");
final String naHost = NodeAgentHelper.getNodeAgentSystemConnector(domainCC, na.getName()).getElementPropertyByName(IAdminConstants.HOST_PROPERTY_NAME).getValue();
return ( naHost );
|
public JmsHost | getResolvedJmsHost(Server as)
final JmsHost jmsHost = getResolvedLocalJmsHostInServer(as);
final JmsHost copy = new JmsHost();
final String hostName = getNodeAgentHostName(as);
if (jmsHost != null) {
copy.setHost(hostName);
copy.setName(jmsHost.getName());
final String resolved = this.resolve(as.getName(), SystemPropertyConstants.unSystemProperty(jmsHost.getPort()));
copy.setPort(resolved);
copy.setAdminPassword(jmsHost.getAdminPassword());
copy.setAdminUserName(jmsHost.getAdminUserName());
}
return copy;
|
private JmsHost | getResolvedLocalJmsHostInServer(Server server)
final Config cfg = ServerHelper.getConfigForServer(domainCC, server.getName());
final JmsService jmsService = cfg.getJmsService();
JmsHost jmsHost = null;
if (JMSServiceType.LOCAL.toString().equals(jmsService.getType()) || JMSServiceType.EMBEDDED.toString().equals(jmsService.getType())) {
jmsHost = getDefaultJmsHost(jmsService);
}
return ( jmsHost );
|
public java.util.Map | getResolvedLocalJmsHostsInCluster(java.lang.String clusterName)
final Map<String, JmsHost> map = new HashMap<String, JmsHost> ();
final String myCluster = ClusterHelper.getClusterByName(domainCC, clusterName).getName();
final Server[] buddies = ServerHelper.getServersInCluster(domainCC, myCluster);
for (final Server as : buddies) {
try {
final JmsHost copy = getResolvedJmsHost(as);
map.put(as.getName(), copy);
} catch (Exception e) {
// we dont add the host if we cannot get it
;
}
}
return map;
|
public java.util.Map | getResolvedLocalJmsHostsInMyCluster(boolean includeMe)
final Map<String, JmsHost> map = new HashMap<String, JmsHost> ();
if (ServerHelper.isServerClustered(domainCC, myName)) {
final String myCluster = ClusterHelper.getClusterForInstance(domainCC, myName).getName();
final Server[] buddies = ServerHelper.getServersInCluster(domainCC, myCluster);
for (final Server as : buddies) {
if (!includeMe && myName.equals(as.getName()))
continue;
try {
final JmsHost copy = getResolvedJmsHost(as);
map.put(as.getName(), copy);
} catch (Exception e) {
;
}
}
}
return ( map );
|
public java.util.Map | getResolvedLocalJmsHostsInMyCluster()
return ( this.getResolvedLocalJmsHostsInMyCluster(false) );
|
public com.sun.enterprise.config.ConfigContext | getUnResolvedConfigContext()
return domainCC;
|
private java.lang.String | resolve(java.lang.String server, java.lang.String value)
final PropertyResolver pr = new PropertyResolver(domainCC, server);
String resolved = pr.getPropertyValue(value, true);
if (resolved == null) // the property could not be resolved, returned what was passed
resolved = value;
return ( resolved );
|