* variables causes threading issues and state is too complex to pass and
* return single ServletRequest or ServletResponse objects.
*/
- private class State {
+ private static class State {
State(ServletRequest request, ServletResponse response,
boolean including) {
this.outerRequest = request;
}
- protected final class PrivilegedGetClassLoader
+ protected static final class PrivilegedGetClassLoader
implements PrivilegedAction<ClassLoader> {
public Class<?> clazz;
}
- protected class LockRecord {
+ protected static class LockRecord {
private AtomicInteger failures = new AtomicInteger(0);
private long lastFailureTime = 0;
}
+ @Override
public void log(String message, Throwable throwable) {
//We can't assume that Servlet.log( message, null )
//is the same as Servlet.log( message ), since API
}
+ @Override
public void addVariableNames(Collection<String> variableNames) {
for (int i = 0; i < VARIABLE_NAMES.length; i++) {
String variableName = VARIABLE_NAMES[i];
}
+ @Override
public void setVariableValue(String name, String value) {
if (!isNameReserved(name)) {
req.setAttribute(name, value);
}
+ @Override
public String getVariableValue(String name) {
String retVal = null;
Object object = getReqAttributeIgnoreCase(name);
return retVal;
}
+ @Override
public Date getCurrentDate() {
return new Date();
}
}
+ @Override
public long getFileLastModified(String path, boolean virtual)
throws IOException {
long lastModified = 0;
}
+ @Override
public long getFileSize(String path, boolean virtual) throws IOException {
long fileSize = -1;
try {
//We are making lots of unnecessary copies of the included data here. If
//someone ever complains that this is slow, we should connect the included
// stream to the print writer that SSICommand uses.
+ @Override
public String getFileText(String originalPath, boolean virtual)
throws IOException {
try {
}
}
- protected class ServletContextAndPath {
+ protected static class ServletContextAndPath {
protected ServletContext servletContext;
protected String path;
}
}
- private class PrivilegedGetPageContext
+ private static class PrivilegedGetPageContext
implements PrivilegedAction<PageContext> {
private JspFactoryImpl factory;
}
}
- private class PrivilegedReleasePageContext
+ private static class PrivilegedReleasePageContext
implements PrivilegedAction<Void> {
private JspFactoryImpl factory;
* This class is needed to instantiate the root of each per classloader
* hierarchy.
*/
- protected class RootLogger extends Logger {
+ protected static class RootLogger extends Logger {
public RootLogger() {
super("", null);
}
* This specialized resource implementation avoids opening the InputStream
* to the file right away (which would put a lock on the file).
*/
- protected class FileResource extends Resource {
+ protected static class FileResource extends Resource {
// -------------------------------------------------------- Constructor
protected File file;
- /**
- * File length.
- */
- protected long length = -1L;
-
-
// --------------------------------------------------- Resource Methods
* reading (to speed up simple checks, like checking the last modified
* date).
*/
- protected class FileResourceAttributes extends ResourceAttributes {
+ protected static class FileResourceAttributes extends ResourceAttributes {
private static final long serialVersionUID = 1L;
}
- protected class BlockPoller extends Thread {
+ protected static class BlockPoller extends Thread {
protected volatile boolean run = true;
protected Selector selector = null;
protected ConcurrentLinkedQueue<Runnable> events = new ConcurrentLinkedQueue<Runnable>();
protected AtomicInteger wakeupCounter = new AtomicInteger(0);
public void cancelKey(final SelectionKey key) {
Runnable r = new Runnable() {
+ @Override
public void run() {
key.cancel();
}
public void add(final KeyAttachment key, final int ops, final KeyReference ref) {
Runnable r = new Runnable() {
+ @Override
public void run() {
if ( key == null ) return;
NioChannel nch = key.getChannel();
public void remove(final KeyAttachment key, final int ops) {
Runnable r = new Runnable() {
+ @Override
public void run() {
if ( key == null ) return;
NioChannel nch = key.getChannel();
}
}
- public class KeyReference {
+ public static class KeyReference {
SelectionKey key = null;
@Override
// This can lead to false alarms about potential memory leaks because the
// thread may have a web application class loader for its context class
// loader.
- private class SingleThreadFactory implements ThreadFactory {
+ private static class SingleThreadFactory implements ThreadFactory {
private volatile Thread singleThread;
@Override
}
- private class ConnectThread extends Thread {
+ private static class ConnectThread extends Thread {
public boolean passed = true;
public boolean connectfailed = false;
@Override
tomcat.start();
}
- private class TestClient extends SimpleHttpClient {
+ private static class TestClient extends SimpleHttpClient {
private void doHttp10Request() throws Exception {