Made isOpen() public to avoid clashes with AbstractEndPoint.
This commit is contained in:
parent
e1a31f468e
commit
b66ec3d57e
|
@ -26,16 +26,13 @@ import org.eclipse.jetty.util.log.Log;
|
|||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.thread.Scheduler;
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** An Abstract implementation of an Idle Timeout.
|
||||
*
|
||||
/**
|
||||
* An Abstract implementation of an Idle Timeout.
|
||||
* <p/>
|
||||
* This implementation is optimised that timeout operations are not cancelled on
|
||||
* every operation. Rather timeout are allowed to expire and a check is then made
|
||||
* to see when the last operation took place. If the idle timeout has not expired,
|
||||
* the timeout is rescheduled for the earliest possible time a timeout could occur.
|
||||
*
|
||||
*/
|
||||
public abstract class IdleTimeout
|
||||
{
|
||||
|
@ -95,10 +92,10 @@ public abstract class IdleTimeout
|
|||
// If we have a new timeout, then check and reschedule
|
||||
if (idleTimeout > 0 && isOpen())
|
||||
_idleTask.run();
|
||||
|
||||
}
|
||||
|
||||
/** This method should be called when non-idle activity has taken place.
|
||||
/**
|
||||
* This method should be called when non-idle activity has taken place.
|
||||
*/
|
||||
public void notIdle()
|
||||
{
|
||||
|
@ -167,17 +164,18 @@ public abstract class IdleTimeout
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** This abstract method is called when the idle timeout has expired.
|
||||
/**
|
||||
* This abstract method is called when the idle timeout has expired.
|
||||
*
|
||||
* @param timeout a TimeoutException
|
||||
*/
|
||||
abstract protected void onIdleExpired(TimeoutException timeout);
|
||||
protected abstract void onIdleExpired(TimeoutException timeout);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** This abstract method should be called to check if idle timeouts
|
||||
/**
|
||||
* This abstract method should be called to check if idle timeouts
|
||||
* should still be checked.
|
||||
*
|
||||
* @return True if the entity monitored should still be checked for idle timeouts
|
||||
*/
|
||||
abstract protected boolean isOpen();
|
||||
public abstract boolean isOpen();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.eclipse.jetty.io;
|
|||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.eclipse.jetty.util.thread.TimerScheduler;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
@ -52,7 +51,7 @@ public class IdleTimeoutTest
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean isOpen()
|
||||
public boolean isOpen()
|
||||
{
|
||||
return _open;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue