<Get id='handler' name='Handler'/>
<Set name='Handler'>
<New id='idleTimeoutHandler' class='org.eclipse.jetty.server.handler.IdleTimeoutHandler'>
<Set name='Handler'><Ref id='handler'/></Set>
<Set name='IdleTimeoutMs'>5000</Set>
</New>
</Set>
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public boolean | handle(Request
the HTTP request to handle request, Response the HTTP response to handle response, Callback the callback to complete when the handling is complete callback)Overrides org. Implements org. Invoked to handle the passed HTTP request and response. |
| public boolean | |
| public void | setApplyToAsync(boolean
true if alternate idle timeout is applied to asynchronous requests applyToAsync)Should the adjusted idle time be maintained for asynchronous requests |
| public void |
| _applyToAsync | back to summary |
|---|---|
| private boolean _applyToAsync | |
| _idleTimeoutMs | back to summary |
|---|---|
| private long _idleTimeoutMs | |
| IdleTimeoutHandler | back to summary |
|---|---|
| public IdleTimeoutHandler() | |
| IdleTimeoutHandler | back to summary |
|---|---|
| public IdleTimeoutHandler(Handler handler) | |
| getIdleTimeoutMs | back to summary |
|---|---|
| public long getIdleTimeoutMs() | |
| handle | back to summary |
|---|---|
| public boolean handle(Request request, Response response, Callback callback) throws Exception Overrides org. Implements org. Doc from org. Invoked to handle the passed HTTP request and response. The request is accepted by returning true, then handling must be concluded by completing the passed callback. The handling may be asynchronous, i.e. this method may return true and complete the given callback later, possibly from a different thread. If this method returns false, then the callback must not be invoked and any mutation on the response reversed. Exceptions thrown by this method may be subsequently handled by an error The simplest implementation is:
public boolean handle(Request request, Response response, Callback callback)
{
callback.succeeded();
return true;
}
A HelloWorld implementation is:
public boolean handle(Request request, Response response, Callback callback)
{
response.write(true, ByteBuffer.wrap("Hello World\n".getBytes(StandardCharsets.UTF_8)), callback);
return true;
}
| |
| isApplyToAsync | back to summary |
|---|---|
| public boolean isApplyToAsync() | |
| setApplyToAsync | back to summary |
|---|---|
| public void setApplyToAsync(boolean applyToAsync) Should the adjusted idle time be maintained for asynchronous requests
| |
| setIdleTimeoutMs | back to summary |
|---|---|
public void setIdleTimeoutMs(long idleTimeoutMs)
| |