com.sun.jini.jeri.internal.http
Class ConnectionTimer
java.lang.Object
com.sun.jini.jeri.internal.http.ConnectionTimer
public class ConnectionTimer
- extends Object
Utility class for timing out connections.
- Author:
- Sun Microsystems, Inc.
Constructor Summary |
ConnectionTimer(long timeout)
Creates new ConnectionTimer which shuts down overdue connections after
the given timeout. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
systemThreadPool
private static final Executor systemThreadPool
timeouts
private final ConnectionTimer.TimeoutMap timeouts
ConnectionTimer
public ConnectionTimer(long timeout)
- Creates new ConnectionTimer which shuts down overdue connections after
the given timeout.
scheduleTimeout
public void scheduleTimeout(TimedConnection conn,
boolean force)
- Schedules timeout for given connection. If timeout is already scheduled
for given connection, renews timeout. When the timeout occurs, the
connection's shutdown method will be called with the given force value.
cancelTimeout
public boolean cancelTimeout(TimedConnection conn)
- Attempts to cancel timeout for the given connection. Returns true if a
timeout was successfully cancelled, false otherwise (e.g. if connection
was never scheduled for a timeout, has already been timed out, or is
already in the midst of being timed out).
Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.