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. Server server = getServerBean(); List<ResourceRef> resourceRefs = new ArrayList<ResourceRef>(server.getResourceRef()); // MAC 10/2012 -- If not in cluster, add config refs Config config = server.getConfig(); if (config != null) { resourceRefs.addAll(config.getResourceRef()); } return resourceRefs; }
if ("domain".equals(target) || target.equals(domainName)) { for (Server s : domain.getServers().getServer()) { Config config = s.getConfig(); Cluster cluster = s.getCluster(); if (!s.containsProperty(propName) && !config.containsProperty(propName)) {
void initRest() { InputStream is = null; try { NetworkListener nl = domain.getServerNamed("server").getConfig().getNetworkConfig() .getNetworkListener("admin-listener"); SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class); URL url = new URL( (SecureAdmin.Util.isEnabled(secureAdmin) ? "https" : "http"), nl.getAddress(), Integer.parseInt(nl.getPort()), "/management/domain"); URLConnection conn = url.openConnection(); is = conn.getInputStream(); isRestStarted = true; } catch (Exception ex) { logger.log(Level.FINE, null, ex); } finally { if (is != null) { try { is.close(); } catch (IOException ex1) { logger.log(Level.FINE, null, ex1); } } } }
protected void decorate() { Server server = habitat.getService(Server.class, env.getInstanceName()); if (server == null) { LogRecord lr = new LogRecord(Level.SEVERE, badEnv); lr.setLoggerName(getClass().getName()); EarlyLogHandler.earlyMessages.add(lr); return; } ServiceLocatorUtilities.addOneConstant(habitat, server, ServerEnvironment.DEFAULT_INSTANCE_NAME, Server.class); server.getConfig().addIndex(habitat, ServerEnvironment.DEFAULT_INSTANCE_NAME); Cluster c = server.getCluster(); if (c != null) { ServiceLocatorUtilities.addOneConstant(habitat, c, ServerEnvironment.DEFAULT_INSTANCE_NAME, Cluster.class); } }
/** * Returns if the SystemJMXConnector is secure or not * * @param instance * @return */ public boolean isSecureJMX(String instance) { String isSecure = "false"; if (domain.getServerNamed(instance) != null) { if (domain.getServerNamed(instance).getConfig().getAdminService().getSystemJmxConnector() != null) { isSecure = domain.getServerNamed(instance).getConfig().getAdminService().getSystemJmxConnector().getSecurityEnabled(); } } return Boolean.parseBoolean(isSecure); } }
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; } }
private List<Config> createConfigList() { // 1. no target specified if (!StringUtils.ok(target)) return allConfigs.getConfig(); Config c = domain.getConfigNamed(target); if (c != null) { List<Config> cl = new LinkedList<Config>(); cl.add(c); return cl; } ReferenceContainer rc = domain.getReferenceContainerNamed(target); if (rc == null) return null; if (rc.isServer()) { Server s =((Server) rc); List<Config> cl = new LinkedList<Config>(); cl.add(s.getConfig()); return cl; } else if (rc.isCluster()) { Cluster cluster = (Cluster) rc; List<Config> cl = new LinkedList<Config>(); cl.add(domain.getConfigNamed(cluster.getConfigRef())); return cl; } else return null; }
private List<Config> createConfigList() { // 1. no target specified if (!StringUtils.ok(target)) return allConfigs.getConfig(); Config c = domain.getConfigNamed(target); if (c != null) { List<Config> cl = new LinkedList<Config>(); cl.add(c); return cl; } ReferenceContainer rc = domain.getReferenceContainerNamed(target); if (rc == null) return null; if (rc.isServer()) { Server s =((Server) rc); List<Config> cl = new LinkedList<Config>(); cl.add(s.getConfig()); return cl; } else if (rc.isCluster()) { Cluster cluster = (Cluster) rc; List<Config> cl = new LinkedList<Config>(); cl.add(domain.getConfigNamed(cluster.getConfigRef())); return cl; } else return null; }
String configOsgiSP = null; String configDebugSP = null; for (SystemProperty sp : s.getConfig().getSystemProperty()) { if (sp.getName().equals(ADMIN)) { configAdminSP = sp.getValue();
public void postConstruct() { String instanceName = serverEnvironment.getInstanceName(); Server server = domain.getServerNamed(instanceName); Config config = server.getConfig(); if (config != null) { MonitoringService monitoringService = config.getMonitoringService(); if (monitoringService != null) { ModuleMonitoringLevels monitoringLevel = monitoringService.getModuleMonitoringLevels(); if (monitoringLevel != null) { this.monitoringLevel = monitoringLevel; ObservableBean bean = (ObservableBean) ConfigSupport.getImpl((ConfigBeanProxy) monitoringLevel); bean.addListener(this); jdbcPoolMonitoringEnabled = !monitoringLevel.getJdbcConnectionPool().equalsIgnoreCase("OFF"); connectorPoolMonitoringEnabled = !monitoringLevel.getConnectorConnectionPool().equalsIgnoreCase("OFF"); } } } }
String configOsgiSP = null; String configDebugSP = null; for (SystemProperty sp : s.getConfig().getSystemProperty()) { if (sp.getName().equals(ADMIN)) { configAdminSP = sp.getValue();
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); } }
Set<String> clusterNoReplication = new HashSet<String>(); for (Server s : allInstances) { String dynRecfg = s.getConfig().getDynamicReconfigurationEnabled(); if (Boolean.TRUE.equals(Boolean.valueOf(dynRecfg))) { instancesForReplication.add(s);
Set<String> clusterNoReplication = new HashSet<String>(); for (Server s : allInstances) { String dynRecfg = s.getConfig().getDynamicReconfigurationEnabled(); if (Boolean.TRUE.equals(Boolean.valueOf(dynRecfg))) { instancesForReplication.add(s);
if (cluster != null && cluster.containsProperty(propName)) defs++; if (server.getConfig().containsProperty(propName)) defs++;
Config scfg = svr.getConfig(); if (!Boolean.valueOf(scfg.getDynamicReconfigurationEnabled())) {