public ProcessExecutionResults executeProcess(ProcessExecution processExecution) { // TODO: doesn't look like SIGAR has an API to fork/execute processes? fallback to using the Java way return SystemInfoFactory.createJavaSystemInfo().executeProcess(processExecution); }
public FileSystemInfo(String mountPoint, boolean deferedFetchInfo) { this.mountPoint = mountPoint; this.fetchedInfo = false; if (!deferedFetchInfo) { refresh(); } else { SigarProxy sigar = SigarAccess.getSigar(); createFileSystemObject(sigar); } }
/** * Throws {@link UnsupportedOperationException} since the Java API cannot obtain information about currently running * processes. * * @see SystemInfo#getThisProcess() */ public ProcessInfo getThisProcess() { throw getUnsupportedException("Cannot get information on this process without native support"); }
private boolean isRediscoveryRequired(ProcessInfo processInfo) { return processInfo == null || !processInfo.freshSnapshot().isRunning(); }
/** * @deprecated as of 4.6. For similar purpose, call {@link #priorSnaphot()} and then corresponding method * from the returned {@link ProcessInfoSnapshot}. */ @Deprecated public ProcExe getExecutable() throws SystemInfoException { return priorSnaphot().getExecutable(); }
/** * @deprecated as of 4.6. For similar purpose, call {@link #priorSnaphot()} and then corresponding method * from the returned {@link ProcessInfoSnapshot}. */ @Deprecated public ProcState getState() throws SystemInfoException { return priorSnaphot().getState(); }
/** * @deprecated as of 4.6. For similar purpose, call {@link #priorSnaphot()} and then corresponding method * from the returned {@link ProcessInfoSnapshot}. */ @Deprecated public ProcMem getMemory() throws SystemInfoException { return priorSnaphot().getMemory(); }
public NetworkAdapterStats getNetworkAdapterStats(String interfaceName) { try { NetInterfaceStat interfaceStat = sigar.getNetInterfaceStat(interfaceName); return new NetworkAdapterStats(interfaceStat); } catch (SigarException e) { throw new SystemInfoException(e); } }
/** * The process's output will be captured and returned in the results. This may be ignored if * <code>waitForCompletion</code> is 0 or less. By default capturing to memory is limited to 2MB of * process output. If the process writes more output, it will be ignored. * @return captureMode */ public static CaptureMode memory() { return new CaptureMode(true); }
/** * If there is a native library available for the JVM's platform/operating system, <code>true</code> is returned. If * the JVM's platform does not have native libraries available, <code>false</code> is returned (in which case, the * only {@link SystemInfo} implementation that is available is {@link JavaSystemInfo}). * * @return <code>true</code> if there are native library APIs available for the JVM platform * @see JavaSystemInfo */ public static boolean isNativeSystemInfoAvailable() { initialize(); return nativeLibraryLoadable; }
public ProcessInfo(long pid, SigarProxy sigar) throws SystemInfoException { this.pid = pid; this.sigar = sigar; update(pid); }
/** * Takes a fresh snapshot of the non static process properties. * * @return a fresh {@link ProcessInfoSnapshot} */ public ProcessInfoSnapshot freshSnapshot() { refresh(); return snapshot; }
@Override protected ProcessInfo getPotentialStartScriptProcess(ProcessInfo serverProcess) { // If the server was started via domain.sh/bat, its parent process will be the process controller JVM, and the // process controller JVM's parent process will be domain.sh/bat. return serverProcess.getParentProcess().getParentProcess(); }
public ProcessExecutionResults executeProcess(ProcessExecution processExecution) { // TODO: doesn't look like SIGAR has an API to fork/execute processes? fallback to using the Java way return SystemInfoFactory.createJavaSystemInfo().executeProcess(processExecution); }
/** * Throws {@link UnsupportedOperationException} since the Java API cannot obtain information about low level memory * details. * * @see SystemInfo#getMemoryInfo() */ public Mem getMemoryInfo() { throw getUnsupportedException("Cannot get any information about memory without native support"); }
/** * The process's output will be captured and returned in the results. This may be ignored if * <code>waitForCompletion</code> is 0 or less. Process output will be logged into agent.log and at the same time * captured into memory. With <code>limit</code> parameter you can set maximum memory buffer to be captured (and possibly returned) * captured output size. If the process writes more output, it will only be redirected to agent.log. * * @param limit in Bytes (if given value < 0, it's ignored and default 2MB is used instead) * @return captureMode */ public static CaptureMode agentLog(int limit) { return new CaptureMode(true, true, limit); }
/** * Throws {@link UnsupportedOperationException} since the Java API cannot obtain information about CPUs. * * @see SystemInfo#getCpu(int) */ public CpuInformation getCpu(int cpuIndex) { throw getUnsupportedException("Cannot get CPU information without native support"); }
/** * Returns partially filled {@link NetworkAdapterInfo} objects - only the data available via the Java API * (particularly the <code>NetworkInterface</code> class) will be available in the returned objects. * * @see SystemInfo#getAllServices() */ public List<NetworkAdapterInfo> getAllNetworkAdapters() throws SystemInfoException { throw getUnsupportedException("Cannot get list of network adaptors without native support"); }
/** * Throws {@link UnsupportedOperationException} since the Java API cannot obtain information about currently running * processes. * * @see SystemInfo#getThisProcess() */ public ProcessInfo getThisProcess() { throw getUnsupportedException("Cannot get information on this process without native support"); }
/** * Throws {@link UnsupportedOperationException} since the Java API cannot obtain information about file systems. * * @see SystemInfo#getFileSystems() */ public List<FileSystemInfo> getFileSystems() { throw getUnsupportedException("Cannot get file systems information"); }