private List<ProcessInfo> getProcessInfos() { SystemInfo systemInfo = SystemInfoFactory.createSystemInfo(); log.debug("Retrieving process table..."); long startTime = System.currentTimeMillis(); List<ProcessInfo> processInfos = null; try { processInfos = systemInfo.getAllProcesses(); } catch (UnsupportedOperationException uoe) { log.debug("Cannot perform process scan - not supported on this platform. (" + systemInfo.getClass() + ")"); } long elapsedTime = System.currentTimeMillis() - startTime; if (log.isDebugEnabled()) { log.debug("Retrieval of process table took " + elapsedTime + " ms."); } return processInfos; }
private PluginContext createPluginContext(String pluginName) { SystemInfo sysInfo = SystemInfoFactory.createSystemInfo(); File dataDir = new File(pluginContainerConfiguration.getDataDirectory(), pluginName); File tmpDir = pluginContainerConfiguration.getTemporaryDirectory(); String pcName = pluginContainerConfiguration.getContainerName(); PluginContext context = new PluginContext(pluginName, sysInfo, tmpDir, dataDir, pcName); return context; }
private ProcessExecutionResults startNode(File basedir) { if (log.isDebugEnabled()) { log.debug("Starting node at " + basedir); } File binDir = new File(basedir, "bin"); File startScript; SystemInfo systemInfo = SystemInfoFactory.createSystemInfo(); ProcessExecution startScriptExe; if (systemInfo.getOperatingSystemType() == OperatingSystemType.WINDOWS) { startScript = new File(binDir, "cassandra.bat"); startScriptExe = createProcessExecution(null, startScript); } else { startScript = new File(binDir, "cassandra"); startScriptExe = createProcessExecution(null, startScript); startScriptExe.addArguments(Arrays.asList("-p", "cassandra.pid")); } startScriptExe.setWaitForCompletion(0); ProcessExecutionResults results = systemInfo.executeProcess(startScriptExe); if (log.isDebugEnabled()) { log.debug(startScript + " returned with exit code [" + results.getExitCode() + "]"); } return results; }
SystemInfo systemInfo = SystemInfoFactory.createSystemInfo();
public static TemplateEngine fetchTemplateEngine() { SystemInfo systemInfo = createSystemInfo();
public static TemplateEngine fetchTemplateEngine() { SystemInfo systemInfo = createSystemInfo();
SystemInfo systemInfo = SystemInfoFactory.createSystemInfo();
SystemInfo systemInfo = SystemInfoFactory.createSystemInfo(); PluginMetadataManager metadataManager = pluginManager.getMetadataManager(); Set<ResourceType> platformTypes = metadataManager.getTypesForCategory(ResourceCategory.PLATFORM);
try { ResourceDiscoveryContext context = new ResourceDiscoveryContext(resourceType, parentComponent, parentResourceContext, SystemInfoFactory.createSystemInfo(), processScanResults, Collections.EMPTY_LIST, this.configuration.getContainerName(), this.configuration.getPluginContainerDeployment());
public <T extends ResourceComponent<?>> ResourceUpgradeContext<T> createResourceUpgradeContext(Resource resource, ResourceContext<?> parentResourceContext, T parentComponent, ResourceDiscoveryComponent<T> discoveryComponent) { return new ResourceUpgradeContext<T>(resource, // the resource itself parentResourceContext, //the context of its parent resource parentComponent, // its parent component discoveryComponent, // the discovery component (this is actually the proxy to it) SystemInfoFactory.createSystemInfo(), // for native access this.configuration.getTemporaryDirectory(), // location for plugin to write temp files this.configuration.getDataDirectory(), // base location for plugin to write data files this.configuration.getContainerName(), // the name of the agent/PC getEventContext(resource), // for event access getOperationContext(resource), // for operation manager access getContentContext(resource), // for content manager access getAvailabilityContext(resource), // for components that want avail manager access getInventoryContext(resource), this.configuration.getPluginContainerDeployment()); // helps components make determinations of what to do }
SystemInfoFactory.createSystemInfo(), new ArrayList<ProcessScanResult>(0), new ArrayList<Configuration>(0), this.configuration.getContainerName(), this.configuration.getPluginContainerDeployment()); ResourceDiscoveryContext<ResourceComponent<?>> discoveryContext = new ResourceDiscoveryContext<ResourceComponent<?>>( resourceType, parentResourceComponent, parentResourceContainer.getResourceContext(), SystemInfoFactory.createSystemInfo(), new ArrayList<ProcessScanResult>(0), pluginConfigurations, this.configuration.getContainerName(), this.configuration.getPluginContainerDeployment());
private <T extends ResourceComponent<?>> ResourceContext<T> createResourceContext(Resource resource, T parentComponent, ResourceContext<?> parentResourceContext, ResourceDiscoveryComponent<T> discoveryComponent) { return new ResourceContext<T>(resource, // the resource itself parentComponent, // its parent component parentResourceContext, //the resource context of the parent discoveryComponent, // the discovery component (this is actually the proxy to it) SystemInfoFactory.createSystemInfo(), // for native access this.configuration.getTemporaryDirectory(), // location for plugin to write temp files this.configuration.getDataDirectory(), // base location for plugin to write data files this.configuration.getContainerName(), // the name of the agent/PC getEventContext(resource), // for event access getOperationContext(resource), // for operation manager access getContentContext(resource), // for content manager access getAvailabilityContext(resource), getInventoryContext(resource), this.configuration.getPluginContainerDeployment(), // helps components make determinations of what to do new ComponentInvocationContextImpl()); }
parentResourceContext, SystemInfoFactory.createSystemInfo(), null, null, this.configuration.getContainerName(), this.configuration.getPluginContainerDeployment());