public boolean isValidServer(String name) { Server s = null; try { s = domain.getServerNamed(name); } catch (Throwable t) { return false; } return (s == null) ? false : true; }
public static boolean isServer(Domain d, String name) { final Server server = d.getServerNamed(name); return (server != null ? true : false); } }
public static boolean isServer(Domain d, String name) { final Server server = d.getServerNamed(name); return (server != null ? true : false); }
@Override public boolean isValid(ServiceLocator habitat, String target) { Domain domain = habitat.getService(Domain.class); return (domain.getServerNamed(target) != null); }
@Override public boolean isValid(Habitat habitat, String target) { Domain domain = habitat.getComponent(Domain.class); return (domain.getServerNamed(target) != null); }
private boolean isServerRunning(String serverName) { Server server = domain.getServerNamed(serverName); return (server == null) ? false : server.isRunning(); } }
private boolean isServerRunning(String serverName) { Server server = domain.getServerNamed(serverName); return (server == null) ? false : server.isRunning(); }
private Config getConfigForName(String name) { if (domain.getConfigNamed(name) != null) return domain.getConfigNamed(name); if (domain.getServerNamed(name) != null) return domain.getServerNamed(name).getConfig(); return null; } }
/** * Returns config element that represents a given server * @param targetName the name of the target * @return Config element representing the server instance */ public Config getServerConfig(String targetName) { Server s = domain.getServerNamed(targetName); if(s == null) return null; return domain.getConfigNamed(s.getConfigRef()); }
public String getHost(String instance) throws InstanceNotFoundException { Server s = domain.getServerNamed(instance); if (s == null) throw new InstanceNotFoundException(); return s.getAdminHost(); }
private List<ResourceRef> getResourceRefs() { //Instead of injecting ResourceRef[] config array (which will inject all resource-refs in domain.xml //including the ones in other server instances), get appropriate instance's resource-refs alone. return domain.getServerNamed(environment.getInstanceName()).getResourceRef(); }
/** * Returns config element that represents a given server * @param targetName the name of the target * @return Config element representing the server instance */ public Config getServerConfig(String targetName) { Server s = domain.getServerNamed(targetName); if(s == null) return null; return domain.getConfigNamed(s.getConfigRef()); }
private void addListenerToServer() { Server server = domain.getServerNamed(environment.getInstanceName()); ObservableBean bean = (ObservableBean) ConfigSupport.getImpl((ConfigBeanProxy)server); bean.addListener(this); }
public String getJMXPort(String instance) throws InstanceNotFoundException { Server s = domain.getServerNamed(instance); if (s == null) throw new InstanceNotFoundException(); return new PropertyResolver(domain, instance).getPropertyValue("JMX_SYSTEM_CONNECTOR_PORT"); }
private void removeListenerForServer() { Server server = domain.getServerNamed(environment.getInstanceName()); ObservableBean bean = (ObservableBean) ConfigSupport.getImpl((ConfigBeanProxy)server); bean.removeListener(this); }
public PropertyResolver(Domain domain, String instanceName) { _domain = domain; _server = _domain.getServerNamed(instanceName); if (_server != null) { _config = _domain.getConfigNamed(_server.getConfigRef()); } else { _config = _domain.getConfigNamed(instanceName); } _cluster = _domain.getClusterForInstance(instanceName); }
public PropertyResolver(Domain domain, String instanceName) { _domain = domain; _server = _domain.getServerNamed(instanceName); if (_server != null) { _config = _domain.getConfigNamed(_server.getConfigRef()); } else { _config = _domain.getConfigNamed(instanceName); } _cluster = _domain.getClusterForInstance(instanceName); }
private Server getServer(){ if(server == null){ server = getDomain().getServerNamed(getRuntime().getServerEnvironment().getInstanceName()); } return server; }
private void removeListenerForServer() { Server server = domain.getServerNamed(environment.getInstanceName()); ObservableBean bean = (ObservableBean) ConfigSupport.getImpl(server); bean.removeListener(this); Config config = server.getConfig(); if (config != null) { ((ObservableBean)ConfigSupport.getImpl(config)).removeListener(this); } }
private void addListenerToServer() { Server server = domain.getServerNamed(environment.getInstanceName()); ObservableBean bean = (ObservableBean) ConfigSupport.getImpl(server); bean.addListener(this); Config config = server.getConfig(); if (config != null) { ((ObservableBean)ConfigSupport.getImpl(config)).addListener(this); } }