use of org.apache.knox.gateway.topology.ClusterConfigurationMonitorService in project knox by apache.
the class AmbariServiceDiscovery method getConfigurationChangeMonitor.
/**
* Get the Ambari configuration change monitor from the associated gateway service.
*/
private AmbariConfigurationMonitor getConfigurationChangeMonitor() {
AmbariConfigurationMonitor ambariMonitor = null;
try {
Class<?> clazz = Class.forName(GATEWAY_SERVICES_ACCESSOR_CLASS);
if (clazz != null) {
Method m = clazz.getDeclaredMethod(GATEWAY_SERVICES_ACCESSOR_METHOD);
if (m != null) {
Object obj = m.invoke(null);
if (GatewayServices.class.isAssignableFrom(obj.getClass())) {
ClusterConfigurationMonitorService clusterMonitorService = ((GatewayServices) obj).getService(GatewayServices.CLUSTER_CONFIGURATION_MONITOR_SERVICE);
ClusterConfigurationMonitor monitor = clusterMonitorService.getMonitor(AmbariConfigurationMonitor.getType());
if (monitor != null) {
if (AmbariConfigurationMonitor.class.isAssignableFrom(monitor.getClass())) {
ambariMonitor = (AmbariConfigurationMonitor) monitor;
}
}
}
}
}
} catch (Exception e) {
log.errorAccessingConfigurationChangeMonitor(e);
}
return ambariMonitor;
}
use of org.apache.knox.gateway.topology.ClusterConfigurationMonitorService in project knox by apache.
the class DefaultTopologyService method start.
@Override
public void start() {
// Register a cluster configuration monitor listener for change notifications
ClusterConfigurationMonitorService ccms = GatewayServer.getGatewayServices().getService(GatewayServices.CLUSTER_CONFIGURATION_MONITOR_SERVICE);
ccms.addListener(new TopologyDiscoveryTrigger(this, ccms));
}
Aggregations