langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/IdleResetSjavac.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
22 * or visit www.oracle.com if you need additional information or have any |
22 * or visit www.oracle.com if you need additional information or have any |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 package com.sun.tools.sjavac.server; |
25 package com.sun.tools.sjavac.server; |
26 |
26 |
27 import java.io.File; |
|
28 import java.net.URI; |
|
29 import java.util.List; |
|
30 import java.util.Set; |
|
31 import java.util.Timer; |
27 import java.util.Timer; |
32 import java.util.TimerTask; |
28 import java.util.TimerTask; |
33 |
29 |
34 /** |
30 /** |
35 * An sjavac implementation that keeps track of idleness and shuts down the |
31 * An sjavac implementation that keeps track of idleness and shuts down the |
62 this.idleTimeout = idleTimeout; |
58 this.idleTimeout = idleTimeout; |
63 scheduleTimeout(); |
59 scheduleTimeout(); |
64 } |
60 } |
65 |
61 |
66 @Override |
62 @Override |
67 public SysInfo getSysInfo() { |
63 public CompilationResult compile(String[] args) { |
68 startCall(); |
64 startCall(); |
69 try { |
65 try { |
70 return delegate.getSysInfo(); |
66 return delegate.compile(args); |
71 } finally { |
|
72 endCall(); |
|
73 } |
|
74 } |
|
75 |
|
76 @Override |
|
77 public CompilationResult compile(String protocolId, |
|
78 String invocationId, |
|
79 String[] args, |
|
80 List<File> explicitSources, |
|
81 Set<URI> sourcesToCompile, |
|
82 Set<URI> visibleSources) { |
|
83 startCall(); |
|
84 try { |
|
85 return delegate.compile(protocolId, |
|
86 invocationId, |
|
87 args, |
|
88 explicitSources, |
|
89 sourcesToCompile, |
|
90 visibleSources); |
|
91 } finally { |
67 } finally { |
92 endCall(); |
68 endCall(); |
93 } |
69 } |
94 } |
70 } |
95 |
71 |
127 public void shutdown() { |
103 public void shutdown() { |
128 idlenessTimer.cancel(); |
104 idlenessTimer.cancel(); |
129 delegate.shutdown(); |
105 delegate.shutdown(); |
130 } |
106 } |
131 |
107 |
132 @Override |
|
133 public String serverSettings() { |
|
134 return delegate.serverSettings(); |
|
135 } |
|
136 } |
108 } |