本文整理汇总了Java中com.heliosapm.utils.jmx.SharedNotificationExecutor.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java SharedNotificationExecutor.getInstance方法的具体用法?Java SharedNotificationExecutor.getInstance怎么用?Java SharedNotificationExecutor.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.heliosapm.utils.jmx.SharedNotificationExecutor
的用法示例。
在下文中一共展示了SharedNotificationExecutor.getInstance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ZooKeepPublisher
import com.heliosapm.utils.jmx.SharedNotificationExecutor; //导入方法依赖的package包/类
/**
* Creates a new ZooKeepPublisher
*/
public ZooKeepPublisher() {
super(SharedNotificationExecutor.getInstance(), NOTIF_INFOS);
connect = ConfigurationHelper.getSystemThenEnvProperty(CONFIG_CONNECT, DEFAULT_CONNECT);
timeout = ConfigurationHelper.getIntSystemThenEnvProperty(CONFIG_TIMEOUT, DEFAULT_TIMEOUT);
adminUrl = "http://" + hostName() + ":" + ConfigurationHelper.getIntSystemThenEnvProperty(CONFIG_PORT, 7560) + "/streamhubadmin";
//+ ConfigurationHelper.getSystemThenEnvProperty("server.context-path", "/" + ROOT_ADMIN_NODE.replace("/", ""));
log.info("Advertised Admin URL: [{}]", adminUrl);
}
示例2: AgentName
import com.heliosapm.utils.jmx.SharedNotificationExecutor; //导入方法依赖的package包/类
private AgentName() {
super(SharedNotificationExecutor.getInstance(), NOTIF_INFOS);
forceLowerCase = ConfigurationHelper.getBooleanSystemThenEnvProperty(PROP_FORCE_LOWER_CASE, DEFAULT_FORCE_LOWER_CASE);
shortHostName = ConfigurationHelper.getBooleanSystemThenEnvProperty(PROP_USE_SHORT_HOSTNAMES, DEFAULT_USE_SHORT_HOSTNAMES);
loadExtraTags();
getAppName();
getHostName();
initBufferized();
JMXHelper.registerMBean(this, OBJECT_NAME);
sendInitialNotif();
}
示例3: ManagedScript
import com.heliosapm.utils.jmx.SharedNotificationExecutor; //导入方法依赖的package包/类
/**
* Creates a new ManagedScript
* @param initialBindings Initial bindings required for instantiation
*/
@SuppressWarnings("unchecked")
public ManagedScript(final Map<String, Object> initialBindings) {
super(new Binding(initialBindings==null ? new HashMap<String, Object>() : initialBindings));
springMode = CollectorServer.isSpringMode();
cache = GlobalCacheService.getInstance();
dependencyManager = new DependencyManager<ManagedScript>(this, (Class<ManagedScript>) this.getClass());
executionService = CollectorExecutionService.getInstance();
broadcaster = new NotificationBroadcasterSupport(SharedNotificationExecutor.getInstance(), NOTIF_INFOS);
for(Field f: getClass().getDeclaredFields()) {
fields.put(f.getName(), f);
// final groovy.transform.Field fieldAnn = f.getAnnotation(groovy.transform.Field.class);
final Dependency fieldAnn = f.getAnnotation(Dependency.class);
if(fieldAnn!=null) {
f.setAccessible(true);
}
}
packageSegs = StringHelper.splitString(getClass().getPackage().getName(), '.');
packageElems = packageSegs.length;
packageKey = getClass().getPackage().getName();
regionKey = packageKey.substring(packageKey.indexOf('.')+1);
classKey = getClass().getName();
hystrixEnabled.set(ConfigurationHelper.getBooleanSystemThenEnvProperty(CONFIG_HYSTRIX_ENABLED, DEFAULT_HYSTRIX_ENABLED));
if(hystrixEnabled.get()) {
commandBuilder = HystrixCommandFactory.getInstance().builder(CONFIG_HYSTRIX, packageSegs[0] + packageSegs[1])
.andCommandKey(classKey)
.andThreadPoolKey(regionKey.replace('.', '-'))
.build();
}
}
示例4: EndpointListener
import com.heliosapm.utils.jmx.SharedNotificationExecutor; //导入方法依赖的package包/类
/**
* Creates a new EndpointPubSub
* @param listeners an optional array of endpoint listeners to add
*/
private EndpointListener(final AdvertisedEndpointListener...listeners) {
super(SharedNotificationExecutor.getInstance(), NOTIF_INFOS);
for(AdvertisedEndpointListener listener : listeners) {
instance.addEndpointListener(listener);
}
CloseableService.getInstance().register(this);
log.info("ZK_CONNECT_CONF: [{}]", System.getProperty(ZK_CONNECT_CONF, "undefined"));
zkConnect = ConfigurationHelper.getSystemThenEnvProperty(ZK_CONNECT_CONF, ZK_CONNECT_DEFAULT);
log.info("EndpointListener ZooKeep Connect: [{}]", zkConnect);
serviceType = ConfigurationHelper.getSystemThenEnvProperty(SERVICE_TYPE_CONF, SERVICE_TYPE_DEFAULT);
connectionTimeout = ConfigurationHelper.getIntSystemThenEnvProperty(DISC_CONN_TO_CONF, DISC_CONN_TO_DEFAULT);
sessionTimeout = ConfigurationHelper.getIntSystemThenEnvProperty(DISC_SESS_TO_CONF, DISC_SESS_TO_DEFAULT);
curator = CuratorFrameworkFactory.newClient(zkConnect, sessionTimeout, connectionTimeout, new ExponentialBackoffRetry( 1000, 3 ));
curator.getConnectionStateListenable().addListener(this);
curator.start();
treeCache = TreeCache.newBuilder(curator, serviceType)
.setCacheData(true)
.setCreateParentNodes(true)
.setExecutor(executor)
.setMaxDepth(5)
.build();
treeCache.getListenable().addListener(this, executor);
try {
JMXHelper.registerMBean(OBJECT_NAME, this);
} catch (Exception ex) {
log.warn("Failed to register management interface. Will continue without.", ex);
}
connectClients();
}
示例5: DropWizardMetrics
import com.heliosapm.utils.jmx.SharedNotificationExecutor; //导入方法依赖的package包/类
/**
* Creates a new DropWizardMetrics
* @param objectName The object name to register this mbean with
* @param description A description for the metric set to be exposed by this mbean
*/
public DropWizardMetrics(final ObjectName objectName, final String description) {
super(DropWizardMetricsMXBean.class, true, new NotificationBroadcasterSupport(SharedNotificationExecutor.getInstance(), notifInfos));
if(objectName==null) throw new IllegalArgumentException("The passed object name was null");
this.objectName = objectName;
this.description = (description==null || description.trim().isEmpty()) ? "DropWizard Metric Set" : description.trim();
}
示例6: AppMetric
import com.heliosapm.utils.jmx.SharedNotificationExecutor; //导入方法依赖的package包/类
/**
* Creates a new AppMetric
* @param metric The metric
*/
public AppMetric(final Metric metric) {
super(SharedNotificationExecutor.getInstance(), NOTIFS);
if(metric==null) throw new IllegalArgumentException("The passed metric was null");
this.metric = metric;
objectName = this.metric.toObjectName();
lastActivity = System.currentTimeMillis();
}
示例7: GlobalCacheService
import com.heliosapm.utils.jmx.SharedNotificationExecutor; //导入方法依赖的package包/类
private GlobalCacheService() {
super(SharedNotificationExecutor.getInstance(), NOTIF_INFOS);
JMXHelper.registerMBean(this, objectName);
}
示例8: Blacklist
import com.heliosapm.utils.jmx.SharedNotificationExecutor; //导入方法依赖的package包/类
private Blacklist() {
super(SharedNotificationExecutor.getInstance(), INFOS);
JMXHelper.registerMBean(this, OBJECT_NAME);
}