未验证 提交 a97ed3c4 编写于 作者: O Oleg Nenashev 提交者: GitHub

Bulk cleanup of hudson.slaves and jenkins.slaves (#3207)

* Bulk cleanup of hudson.slaves and jenkins.slaves

- [x] Use Jenkins.get() instead of the deprecated getInstance()
- [x] Remove unused imports
- [x] Use diamond type definitions where possible
- [x] Squash similar extension handlers
- [x] Other minor refactorings and NPE checks

* Update core/src/main/java/hudson/slaves/SlaveComputer.java
上级 a026f89e
......@@ -67,7 +67,7 @@ public abstract class AbstractCloudSlave extends Slave {
_terminate(new StreamTaskListener(System.out, Charset.defaultCharset()));
} finally {
try {
Jenkins.getInstance().removeNode(this);
Jenkins.get().removeNode(this);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to remove "+name,e);
}
......
......@@ -34,7 +34,6 @@ import hudson.slaves.NodeProvisioner.PlannedNode;
import hudson.model.Describable;
import jenkins.model.Jenkins;
import hudson.model.Node;
import hudson.model.AbstractModelObject;
import hudson.model.Label;
import hudson.model.Descriptor;
import hudson.security.ACL;
......@@ -125,7 +124,7 @@ public abstract class Cloud extends Actionable implements ExtensionPoint, Descri
}
public ACL getACL() {
return Jenkins.getInstance().getAuthorizationStrategy().getACL(this);
return Jenkins.get().getAuthorizationStrategy().getACL(this);
}
/**
......@@ -169,7 +168,7 @@ public abstract class Cloud extends Actionable implements ExtensionPoint, Descri
public abstract boolean canProvision(Label label);
public Descriptor<Cloud> getDescriptor() {
return Jenkins.getInstance().getDescriptorOrDie(getClass());
return Jenkins.get().getDescriptorOrDie(getClass());
}
/**
......@@ -179,13 +178,13 @@ public abstract class Cloud extends Actionable implements ExtensionPoint, Descri
* Use {@link #all()} for read access, and {@link Extension} for registration.
*/
@Deprecated
public static final DescriptorList<Cloud> ALL = new DescriptorList<Cloud>(Cloud.class);
public static final DescriptorList<Cloud> ALL = new DescriptorList<>(Cloud.class);
/**
* Returns all the registered {@link Cloud} descriptors.
*/
public static DescriptorExtensionList<Cloud,Descriptor<Cloud>> all() {
return Jenkins.getInstance().<Cloud,Descriptor<Cloud>>getDescriptorList(Cloud.class);
return Jenkins.get().getDescriptorList(Cloud.class);
}
private static final PermissionScope PERMISSION_SCOPE = new PermissionScope(Cloud.class);
......
......@@ -57,9 +57,7 @@ public class CloudRetentionStrategy extends RetentionStrategy<AbstractCloudCompu
LOGGER.log(Level.INFO, "Disconnecting {0}", c.getName());
try {
computerNode.terminate();
} catch (InterruptedException e) {
LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
} catch (IOException e) {
} catch (InterruptedException | IOException e) {
LOGGER.log(WARNING, "Failed to terminate " + c.getName(), e);
}
}
......
......@@ -47,7 +47,7 @@ public class CloudSlaveRetentionStrategy<T extends Computer> extends RetentionSt
* To actually deallocate the resource tied to this {@link Node}, implement {@link Computer#onRemoved()}.
*/
protected void kill(Node n) throws IOException {
Jenkins.getInstance().removeNode(n);
Jenkins.get().removeNode(n);
}
/**
......
......@@ -12,7 +12,6 @@ import jenkins.model.Jenkins;
*/
public abstract class ComputerConnectorDescriptor extends Descriptor<ComputerConnector> {
public static DescriptorExtensionList<ComputerConnector,ComputerConnectorDescriptor> all() {
return Jenkins.getInstance().<ComputerConnector,ComputerConnectorDescriptor>
getDescriptorList(ComputerConnector.class);
return Jenkins.get().getDescriptorList(ComputerConnector.class);
}
}
......@@ -163,7 +163,7 @@ public abstract class ComputerLauncher extends AbstractDescribableImpl<ComputerL
* {@link jenkins.model.Jenkins#getDescriptorList(Class)} for read access.
*/
@Deprecated
public static final DescriptorList<ComputerLauncher> LIST = new DescriptorList<ComputerLauncher>(ComputerLauncher.class);
public static final DescriptorList<ComputerLauncher> LIST = new DescriptorList<>(ComputerLauncher.class);
/**
* Given the output of "java -version" in <code>r</code>, determine if this
......
......@@ -46,7 +46,7 @@ public class ComputerRetentionWork extends PeriodicWork {
/**
* Use weak hash map to avoid leaking {@link Computer}.
*/
private final Map<Computer, Long> nextCheck = new WeakHashMap<Computer, Long>();
private final Map<Computer, Long> nextCheck = new WeakHashMap<>();
public long getRecurrencePeriod() {
return MIN;
......@@ -59,7 +59,7 @@ public class ComputerRetentionWork extends PeriodicWork {
@Override
protected void doRun() {
final long startRun = System.currentTimeMillis();
for (final Computer c : Jenkins.getInstance().getComputers()) {
for (final Computer c : Jenkins.get().getComputers()) {
Queue.withLock(new Runnable() {
@Override
public void run() {
......
......@@ -58,7 +58,7 @@ public class ConnectionActivityMonitor extends AsyncPeriodicWork {
if (!enabled) return;
long now = System.currentTimeMillis();
for (Computer c: Jenkins.getInstance().getComputers()) {
for (Computer c: Jenkins.get().getComputers()) {
VirtualChannel ch = c.getChannel();
if (ch instanceof Channel) {
Channel channel = (Channel) ch;
......
......@@ -100,7 +100,7 @@ public abstract class DelegatingComputerLauncher extends ComputerLauncher {
public List<Descriptor<ComputerLauncher>> getApplicableDescriptors() {
List<Descriptor<ComputerLauncher>> r = new ArrayList<Descriptor<ComputerLauncher>>();
for (Descriptor<ComputerLauncher> d :
Jenkins.getInstance().<ComputerLauncher, Descriptor<ComputerLauncher>>getDescriptorList(ComputerLauncher.class)) {
Jenkins.get().getDescriptorList(ComputerLauncher.class)) {
if (DelegatingComputerLauncher.class.isAssignableFrom(d.getKlass().toJavaClass())) continue;
r.add(d);
}
......
......@@ -195,7 +195,7 @@ public class JNLPLauncher extends ComputerLauncher {
// Causes JENKINS-45895 in the case of includes otherwise
return DescriptorImpl.class.equals(getClass());
}
};
}
/**
* Hides the JNLP launcher when the JNLP agent port is not enabled.
......@@ -210,7 +210,7 @@ public class JNLPLauncher extends ComputerLauncher {
*/
@Override
public boolean filter(@CheckForNull Object context, @Nonnull Descriptor descriptor) {
return descriptor.clazz != JNLPLauncher.class || Jenkins.getInstance().getTcpSlaveAgentListener() != null;
return descriptor.clazz != JNLPLauncher.class || Jenkins.get().getTcpSlaveAgentListener() != null;
}
/**
......@@ -218,7 +218,7 @@ public class JNLPLauncher extends ComputerLauncher {
*/
@Override
public boolean filterType(@Nonnull Class<?> contextClass, @Nonnull Descriptor descriptor) {
return descriptor.clazz != JNLPLauncher.class || Jenkins.getInstance().getTcpSlaveAgentListener() != null;
return descriptor.clazz != JNLPLauncher.class || Jenkins.get().getTcpSlaveAgentListener() != null;
}
}
......
......@@ -112,7 +112,7 @@ public abstract class NodeDescriptor extends Descriptor<Node> {
* Returns all the registered {@link NodeDescriptor} descriptors.
*/
public static DescriptorExtensionList<Node,NodeDescriptor> all() {
return Jenkins.getInstance().<Node,NodeDescriptor>getDescriptorList(Node.class);
return Jenkins.get().getDescriptorList(Node.class);
}
/**
......@@ -121,10 +121,10 @@ public abstract class NodeDescriptor extends Descriptor<Node> {
* Use {@link #all()} for read access, and {@link Extension} for registration.
*/
@Deprecated
public static final DescriptorList<Node> ALL = new DescriptorList<Node>(Node.class);
public static final DescriptorList<Node> ALL = new DescriptorList<>(Node.class);
public static List<NodeDescriptor> allInstantiable() {
List<NodeDescriptor> r = new ArrayList<NodeDescriptor>();
List<NodeDescriptor> r = new ArrayList<>();
for (NodeDescriptor d : all())
if(d.isInstantiable())
r.add(d);
......
......@@ -49,7 +49,7 @@ import javax.annotation.CheckForNull;
*/
public final class NodeList extends ArrayList<Node> {
private Map<String,Node> map = new HashMap<String, Node>();
private Map<String,Node> map = new HashMap<>();
public NodeList() {
}
......
......@@ -83,7 +83,7 @@ public abstract class NodeProperty<N extends Node> implements ReconfigurableDesc
protected void setNode(N node) { this.node = node; }
public NodePropertyDescriptor getDescriptor() {
return (NodePropertyDescriptor) Jenkins.getInstance().getDescriptorOrDie(getClass());
return (NodePropertyDescriptor) Jenkins.get().getDescriptorOrDie(getClass());
}
/**
......@@ -178,7 +178,7 @@ public abstract class NodeProperty<N extends Node> implements ReconfigurableDesc
* Lists up all the registered {@link NodeDescriptor}s in the system.
*/
public static DescriptorExtensionList<NodeProperty<?>,NodePropertyDescriptor> all() {
return (DescriptorExtensionList) Jenkins.getInstance().getDescriptorList(NodeProperty.class);
return (DescriptorExtensionList) Jenkins.get().getDescriptorList(NodeProperty.class);
}
/**
......
......@@ -55,6 +55,6 @@ public abstract class NodePropertyDescriptor extends PropertyDescriptor<NodeProp
// preserve legacy behaviour, even if brain-dead stupid, where applying to Jenkins was the discriminator
// note that it would be a mistake to assume Jenkins.getInstance().getClass() == Jenkins.class
// the groovy code tested against app.class, so we replicate that exact logic.
return isApplicable(Jenkins.getInstance().getClass());
return isApplicable(Jenkins.get().getClass());
}
}
......@@ -38,6 +38,7 @@ import javax.annotation.Nonnull;
import javax.annotation.concurrent.GuardedBy;
import java.awt.Color;
import java.util.Arrays;
import java.util.Collections;
import java.util.concurrent.Future;
import java.util.concurrent.ExecutionException;
import java.util.List;
......@@ -127,7 +128,7 @@ public class NodeProvisioner {
private final Label label;
private final AtomicReference<List<PlannedNode>> pendingLaunches
= new AtomicReference<List<PlannedNode>>(new ArrayList<PlannedNode>());
= new AtomicReference<>(new ArrayList<>());
private final Lock provisioningLock = new ReentrantLock();
......@@ -159,7 +160,7 @@ public class NodeProvisioner {
* @since 1.401
*/
public List<PlannedNode> getPendingLaunches() {
return new ArrayList<PlannedNode>(pendingLaunches.get());
return new ArrayList<>(pendingLaunches.get());
}
/**
......@@ -207,15 +208,14 @@ public class NodeProvisioner {
Queue.withLock(new Runnable() {
@Override
public void run() {
Jenkins jenkins = Jenkins.getInstance();
Jenkins jenkins = Jenkins.get();
// clean up the cancelled launch activity, then count the # of executors that we are about to
// bring up.
int plannedCapacitySnapshot = 0;
List<PlannedNode> snapPendingLaunches = new ArrayList<PlannedNode>(pendingLaunches.get());
for (Iterator<PlannedNode> itr = snapPendingLaunches.iterator(); itr.hasNext(); ) {
PlannedNode f = itr.next();
List<PlannedNode> snapPendingLaunches = new ArrayList<>(pendingLaunches.get());
for (PlannedNode f : snapPendingLaunches) {
if (f.future.isDone()) {
try {
Node node = null;
......@@ -263,7 +263,7 @@ public class NodeProvisioner {
} finally {
while (true) {
List<PlannedNode> orig = pendingLaunches.get();
List<PlannedNode> repl = new ArrayList<PlannedNode>(orig);
List<PlannedNode> repl = new ArrayList<>(orig);
// the contract for List.remove(o) is that the first element i where
// (o==null ? get(i)==null : o.equals(get(i)))
// is true will be removed from the list
......@@ -305,15 +305,15 @@ public class NodeProvisioner {
new Object[]{queueLengthSnapshot, availableSnapshot});
provisioningState = null;
} else {
provisioningState = new StrategyState(snapshot, label, plannedCapacitySnapshot);;
provisioningState = new StrategyState(snapshot, label, plannedCapacitySnapshot);
}
}
});
if (provisioningState != null) {
List<Strategy> strategies = Jenkins.getInstance().getExtensionList(Strategy.class);
List<Strategy> strategies = Jenkins.get().getExtensionList(Strategy.class);
for (Strategy strategy : strategies.isEmpty()
? Arrays.<Strategy>asList(new StandardStrategyImpl())
? Collections.<Strategy>singletonList(new StandardStrategyImpl())
: strategies) {
LOGGER.log(Level.FINER, "Consulting {0} provisioning strategy with state {1}",
new Object[]{strategy, provisioningState});
......@@ -580,7 +580,7 @@ public class NodeProvisioner {
}
while (!plannedNodes.isEmpty()) {
List<PlannedNode> orig = pendingLaunches.get();
List<PlannedNode> repl = new ArrayList<PlannedNode>(orig);
List<PlannedNode> repl = new ArrayList<>(orig);
repl.addAll(plannedNodes);
if (pendingLaunches.compareAndSet(orig, repl)) {
if (additionalPlannedCapacity > 0) {
......@@ -687,7 +687,7 @@ public class NodeProvisioner {
});
CLOUD:
for (Cloud c : Jenkins.getInstance().clouds) {
for (Cloud c : Jenkins.get().clouds) {
if (excessWorkload < 0) {
break; // enough agents allocated
}
......@@ -803,9 +803,9 @@ public class NodeProvisioner {
@Override
protected void doRun() {
Jenkins h = Jenkins.getInstance();
h.unlabeledNodeProvisioner.update();
for( Label l : h.getLabels() )
Jenkins j = Jenkins.get();
j.unlabeledNodeProvisioner.update();
for( Label l : j.getLabels() )
l.nodeProvisioner.update();
}
}
......
......@@ -104,7 +104,7 @@ public abstract class RetentionStrategy<T extends Computer> extends AbstractDesc
* Returns all the registered {@link RetentionStrategy} descriptors.
*/
public static DescriptorExtensionList<RetentionStrategy<?>,Descriptor<RetentionStrategy<?>>> all() {
return (DescriptorExtensionList) Jenkins.getInstance().getDescriptorList(RetentionStrategy.class);
return (DescriptorExtensionList) Jenkins.get().getDescriptorList(RetentionStrategy.class);
}
/**
......@@ -216,8 +216,8 @@ public abstract class RetentionStrategy<T extends Computer> extends AbstractDesc
@GuardedBy("hudson.model.Queue.lock")
public long check(final SlaveComputer c) {
if (c.isOffline() && c.isLaunchSupported()) {
final HashMap<Computer, Integer> availableComputers = new HashMap<Computer, Integer>();
for (Computer o : Jenkins.getInstance().getComputers()) {
final HashMap<Computer, Integer> availableComputers = new HashMap<>();
for (Computer o : Jenkins.get().getComputers()) {
if ((o.isOnline() || o.isConnecting()) && o.isPartiallyIdle() && o.isAcceptingTasks()) {
final int idleExecutors = o.countIdle();
if (idleExecutors>0)
......
......@@ -26,6 +26,7 @@ package hudson.slaves;
import hudson.AbortException;
import hudson.FilePath;
import hudson.Functions;
import hudson.RestrictedSince;
import hudson.Util;
import hudson.console.ConsoleLogFilter;
import hudson.model.Computer;
......@@ -557,7 +558,11 @@ public class SlaveComputer extends Computer {
static class LoadingPrefetchCacheCount extends MasterToSlaveCallable<Integer,RuntimeException> {
@Override public Integer call() {
return Channel.current().classLoadingPrefetchCacheCount.get();
Channel c = Channel.current();
if (c == null) {
return -1;
}
return c.classLoadingPrefetchCacheCount.get();
}
}
......@@ -569,7 +574,7 @@ public class SlaveComputer extends Computer {
@Override public Long call() {
Channel c = Channel.current();
if (c == null) {
return Long.valueOf(-1);
return -1L;
}
return resource ? c.resourceLoadingTime.get() : c.classLoadingTime.get();
}
......@@ -695,7 +700,7 @@ public class SlaveComputer extends Computer {
SecurityContextHolder.setContext(old);
}
log.println("Agent successfully connected and online");
Jenkins.getInstance().getQueue().scheduleMaintenance();
Jenkins.get().getQueue().scheduleMaintenance();
}
@Override
......@@ -993,13 +998,15 @@ public class SlaveComputer extends Computer {
/**
* Helper method for Jelly.
*/
@Restricted(DoNotUse.class)
@RestrictedSince("TODO")
public static List<SlaveSystemInfo> getSystemInfoExtensions() {
return SlaveSystemInfo.all();
}
private static class SlaveLogFetcher extends MasterToSlaveCallable<List<LogRecord>,RuntimeException> {
public List<LogRecord> call() {
return new ArrayList<LogRecord>(SLAVE_LOG_HANDLER.getView());
return new ArrayList<>(SLAVE_LOG_HANDLER.getView());
}
}
......
......@@ -112,7 +112,9 @@ public final class WorkspaceList {
public final @Nonnull FilePath path;
protected Lease(@Nonnull FilePath path) {
path.getRemote(); // null check
if (path == null) { // Protection from old API
throw new NullPointerException("The specified FilePath is null");
}
this.path = path;
}
......@@ -153,7 +155,7 @@ public final class WorkspaceList {
}
}
private final Map<FilePath,Entry> inUse = new HashMap<FilePath,Entry>();
private final Map<FilePath,Entry> inUse = new HashMap<>();
public WorkspaceList() {
}
......
......@@ -56,7 +56,7 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver {
@Override
public boolean owns(String clientName) {
Computer computer = Jenkins.getInstance().getComputer(clientName);
Computer computer = Jenkins.get().getComputer(clientName);
return computer != null;
}
......@@ -83,7 +83,7 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver {
@Override
public void afterProperties(@NonNull JnlpConnectionState event) {
String clientName = event.getProperty(JnlpConnectionState.CLIENT_NAME_KEY);
SlaveComputer computer = (SlaveComputer) Jenkins.getInstance().getComputer(clientName);
SlaveComputer computer = (SlaveComputer) Jenkins.get().getComputer(clientName);
if (computer == null) {
event.reject(new ConnectionRefusalException(String.format("%s is not a JNLP agent", clientName)));
return;
......
......@@ -60,7 +60,7 @@ public class DeprecatedAgentProtocolMonitor extends AdministrativeMonitor {
@Override
public boolean isActivated() {
final Set<String> agentProtocols = Jenkins.getInstance().getAgentProtocols();
final Set<String> agentProtocols = Jenkins.get().getAgentProtocols();
for (String name : agentProtocols) {
AgentProtocol pr = AgentProtocol.of(name);
if (pr != null && pr.isDeprecated()) {
......@@ -79,7 +79,7 @@ public class DeprecatedAgentProtocolMonitor extends AdministrativeMonitor {
@CheckForNull
public static String getDeprecatedProtocolsString() {
final List<String> deprecatedProtocols = new ArrayList<>();
final Set<String> agentProtocols = Jenkins.getInstance().getAgentProtocols();
final Set<String> agentProtocols = Jenkins.get().getAgentProtocols();
for (String name : agentProtocols) {
AgentProtocol pr = AgentProtocol.of(name);
if (pr != null && pr.isDeprecated()) {
......
......@@ -7,15 +7,12 @@ import hudson.model.Computer;
import java.io.IOException;
import java.net.Socket;
import java.util.Collections;
import java.util.HashMap;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
import javax.inject.Inject;
import jenkins.AgentProtocol;
import jenkins.model.Jenkins;
import jenkins.security.HMACConfidentialKey;
import org.jenkinsci.Symbol;
import org.jenkinsci.remoting.engine.JnlpClientDatabase;
import org.jenkinsci.remoting.engine.JnlpConnectionState;
import org.jenkinsci.remoting.engine.JnlpProtocol1Handler;
......@@ -104,4 +101,5 @@ public class JnlpSlaveAgentProtocol extends AgentProtocol {
ExtensionList.lookup(JnlpAgentReceiver.class));
}
}
......@@ -6,12 +6,9 @@ import hudson.model.Computer;
import java.io.IOException;
import java.net.Socket;
import java.util.Collections;
import java.util.HashMap;
import javax.annotation.Nonnull;
import javax.inject.Inject;
import jenkins.AgentProtocol;
import org.jenkinsci.Symbol;
import org.jenkinsci.remoting.engine.JnlpClientDatabase;
import org.jenkinsci.remoting.engine.JnlpConnectionState;
import org.jenkinsci.remoting.engine.JnlpProtocol2Handler;
......
......@@ -8,14 +8,11 @@ import hudson.model.Computer;
import java.io.IOException;
import java.net.Socket;
import java.util.Collections;
import java.util.HashMap;
import javax.annotation.Nonnull;
import javax.inject.Inject;
import jenkins.AgentProtocol;
import jenkins.model.Jenkins;
import jenkins.util.SystemProperties;
import org.jenkinsci.Symbol;
import org.jenkinsci.remoting.engine.JnlpClientDatabase;
import org.jenkinsci.remoting.engine.JnlpConnectionState;
import org.jenkinsci.remoting.engine.JnlpProtocol3Handler;
import org.kohsuke.accmod.Restricted;
......
......@@ -37,8 +37,6 @@ import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.security.interfaces.RSAPrivateKey;
import java.util.Collections;
import java.util.HashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
......
......@@ -28,6 +28,6 @@ public abstract class PingFailureAnalyzer implements ExtensionPoint {
public abstract void onPingFailure(Channel c, Throwable cause) throws IOException;
public static ExtensionList<PingFailureAnalyzer> all() {
return Jenkins.getInstance().getExtensionList(PingFailureAnalyzer.class);
return Jenkins.get().getExtensionList(PingFailureAnalyzer.class);
}
}
......@@ -124,7 +124,7 @@ public class RemotingWorkDirSettings implements Describable<RemotingWorkDirSetti
@Override
public Descriptor<RemotingWorkDirSettings> getDescriptor() {
return Jenkins.getInstance().getDescriptor(RemotingWorkDirSettings.class);
return Jenkins.get().getDescriptor(RemotingWorkDirSettings.class);
}
/**
......@@ -152,7 +152,7 @@ public class RemotingWorkDirSettings implements Describable<RemotingWorkDirSetti
if (!DEFAULT_INTERNAL_DIR.equals(internalDir)) {
args.add("-internalDir");
args.add(internalDir);;
args.add(internalDir);
}
if (failIfWorkDirIsMissing) {
......
......@@ -53,7 +53,7 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser
private static void install(Computer c, TaskListener listener) {
try {
final List<SlaveRestarter> restarters = new ArrayList<SlaveRestarter>(SlaveRestarter.all());
final List<SlaveRestarter> restarters = new ArrayList<>(SlaveRestarter.all());
VirtualChannel ch = c.getChannel();
if (ch==null) return; // defensive check
......
......@@ -37,13 +37,7 @@ public class UnixSlaveRestarter extends SlaveRestarter {
LIBC.execv("positively/no/such/executable", new StringArray(new String[]{"a","b","c"}));
return true;
} catch (UnsupportedOperationException e) {
LOGGER.log(FINE, getClass()+" unsuitable", e);
return false;
} catch (LinkageError e) {
LOGGER.log(FINE, getClass()+" unsuitable", e);
return false;
} catch (IOException e) {
} catch (UnsupportedOperationException | LinkageError | IOException e) {
LOGGER.log(FINE, getClass()+" unsuitable", e);
return false;
}
......
......@@ -24,10 +24,7 @@ public class WinswSlaveRestarter extends SlaveRestarter {
return false; // not under winsw
return exec("status") ==0;
} catch (InterruptedException e) {
LOGGER.log(FINE, getClass()+" unsuitable", e);
return false;
} catch (IOException e) {
} catch (InterruptedException | IOException e) {
LOGGER.log(FINE, getClass()+" unsuitable", e);
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册