public DispatchAgentHeartbeatHelper (DispatchConfiguration configInstance, DispatcherContext context, CollectionSettingsRegistry registry) { this(configInstance.getInsightAgentConfig(), context, registry); }
TraceIdGenerator resolveGenerator () { /* * Note: delay the actual access until needed - give more time for configuration to kick in */ if (generator == null) { DispatchConfiguration dispatchConfig=DispatchConfiguration.getInstance(); ServerName agentName=dispatchConfig.getServerName(); generator = new AgentTraceIdGenerator(agentName); } return generator; } }
public URI getEncoderURI () throws URISyntaxException { if (encoderURI == null) { String uriValue=getProperty(DISPATCH_ENCODER_PROP, DEFAULT_ENCODER_VALUE); encoderURI = new URI(uriValue); } return encoderURI; }
public void afterPropertiesSet () throws Exception { if (mbeanConfig == null) { DispatchConfiguration config=DispatchConfiguration.getInstance(); URI uri=config.getTransportURI(); String scheme=uri.getScheme(); DispatchConfiguration config=DispatchConfiguration.getInstance(); URI uri=config.getEncoderURI(); encoderFactory = DispatcherContext.getEncoderFactory(uri); setEncoderFactory(encoderFactory); DispatchConfiguration config=DispatchConfiguration.getInstance(); URI defaultTransportURI=config.getTransportURI(); String uriValue=defaultTransportURI.toString(); amDefaultTransport = uriValue.startsWith(JmxTransportConfig.DEFAULT_SCHEME);
public static final InsightAgentRuntimeState createInitialRuntimeState () { DispatchConfiguration configInstance=DispatchConfiguration.getInstance(); return createInitialRuntimeState(configInstance.getInsightAgentConfig(), DispatcherContext.getInstance(), CollectionSettingsRegistry.getInstance()); }
public List<KeyValPair<File,PluginDescriptor>> getPluginSet () { synchronized(configLock) { if (pluginSet == null) { InsightAgentPluginsHelper helper=DispatchConfiguration.resolveInsightAgentPluginsHelper(); pluginSet = Collections.unmodifiableList( InsightPluginDescriptorParser.extractPluginSet(helper.getPluginFiles())); } return pluginSet; } }
private DispatcherContext() { this(DispatchConfiguration.getInstance()); }
public ServerName getServerName () { return dispatchConfig.getServerName(); }
public EncoderFactory getEncoderFactory () { synchronized(encoderLock) { if (encoderFactory == null) { try { encoderFactory = getEncoderFactory(dispatchConfig.getEncoderURI()); } catch(Exception e) { throw ExceptionUtils.toRuntimeException(e, true); } } return encoderFactory; } }
public CollectionDataTransportFactory getCollectionDataTransportFactory () { synchronized(transportLock) { if (transportFactory == null) { try { transportFactory=getCollectionDataTransportFactory(dispatchConfig.getTransportURI()); transportFactory.setEncoderFactory(getEncoderFactory()); } catch(Exception e) { throw ExceptionUtils.toRuntimeException(e, true); } } return transportFactory; } }
public void start() throws Exception { DispatchConfiguration configInstance=DispatchConfiguration.getInstance(); InsightAgentConfig config=configInstance.getInsightAgentConfig(); heartbeatPeriod = config.getHeartbeat();
private DispatchConfiguration() { super(DispatchAgentPropertiesOverride.getInstance(), resolveInsightAgentPluginsHelper().getInsight(), SystemPropertiesSystemInformation.getInstance(), EnvironmentSystemInformation.getInstance()); }
public boolean checkInitialization () { Map<CollectionSettingName,? extends KeyValPair<?,?>> result=null; synchronized(initialized) { if (!initialized.getAndSet(true)) { result = doConfigure(DispatchConfiguration.getInstance()); } } if (MapUtil.size(result) > 0) { Logger logger=Logger.getLogger(getClass().getName()); for (Map.Entry<CollectionSettingName,? extends KeyValPair<?,?>> re : result.entrySet()) { CollectionSettingName setting=re.getKey(); KeyValPair<?,?> values=re.getValue(); Object oldValue=values.getKey(), newValue=values.getValue(); if (oldValue == null) { logger.info("checkInitialization(" + setting.getKey() + "): " + newValue); } else { logger.info("checkInitialization(" + setting.getKey() + ")[" + oldValue + "]: " + newValue); } } } return (result != null); } }
Trace prepareTraceForTransport (Trace trace) { ServerName traceServer=trace.getServer(); // override only if not set or default if ((traceServer == null) || InterceptConfiguration.PLACEHOLDER_SERVER.equals(traceServer)) { DispatchConfiguration dispatchConfig=DispatchConfiguration.getInstance(); ServerName agentName=dispatchConfig.getServerName(); trace.setServer(agentName); } return trace; }
public ServerName getServerName () { InsightAgentConfig config=getInsightAgentConfig(); return config.getServerName(); }
public URI getTransportURI() throws URISyntaxException { if (transportURI == null) { String uriValue=getProperty(DISPATCH_TRANSPORT_PROP, DEFAULT_TRANSPORT_VALUE); transportURI = new URI(uriValue); } return transportURI; }
@Override public ServerName getServer() { ServerName serverName=super.getServer(); // TODO find a solution if the dashboard runs on same JVM - see DashboardInterceptAttacher#registerListenerIfNobodyElseListening if ((serverName == null) || PLACEHOLDER_SERVER.equals(serverName)) { DispatchConfiguration dispatch=DispatchConfiguration.getInstance(); serverName = dispatch.getServerName(); setServer(serverName); } return serverName; }
public BasicNetworkSystemInformation getBasicNetworkSystemInformation () { synchronized(configLock) { if (netInfo == null) { CollectionDataTransportFactory factory=getCollectionDataTransportFactory(); if (factory.isNetworkAware()) { netInfo = new BasicNetworkSystemInformation(factory.getTransportURI()); } else { netInfo = InsightAgentConfigFactory.resolveNetworkSystemInformation(dispatchConfig.getInsightAgentConfig()); } } return netInfo; } }