@Immutable public class ServletAsyncSpec extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
NO_TIMEOUT
The constant defining "no timeout defined"
|
static ServletAsyncSpec |
SYNC_SPEC
The constant for synchronous invocations
|
| Modifier | Constructor and Description |
|---|---|
protected |
ServletAsyncSpec(boolean bAsynchronous,
long nTimeoutMillis,
Iterable<? extends javax.servlet.AsyncListener> aAsyncListeners)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyToAsyncContext(javax.servlet.AsyncContext aAsyncCtx) |
static ServletAsyncSpec |
createAsync(long nTimeoutMillis,
Iterable<? extends javax.servlet.AsyncListener> aAsyncListeners)
Create an async spec.
|
static ServletAsyncSpec |
createAsyncDefault()
Create an async spec with 999999 (debug mode) or 30 (production) seconds
timeout and no async listeners.
|
com.helger.commons.collection.impl.ICommonsList<javax.servlet.AsyncListener> |
getAllAsyncListeners() |
static ServletAsyncSpec |
getSync() |
long |
getTimeoutMillis() |
boolean |
hasAsyncListeners() |
boolean |
hasTimeoutMillis() |
boolean |
isAsynchronous() |
String |
toString() |
public static final long NO_TIMEOUT
public static final ServletAsyncSpec SYNC_SPEC
protected ServletAsyncSpec(boolean bAsynchronous,
@CheckForSigned
long nTimeoutMillis,
@Nullable
Iterable<? extends javax.servlet.AsyncListener> aAsyncListeners)
bAsynchronous - true for asynchronous stuff, false for
synchronous spec.nTimeoutMillis - The timeout in milliseconds. Must be ≤ 0 for synchronous usage.aAsyncListeners - AsyncListeners to be added to the AsyncContext. Must be
null for synchronous usage.@CheckForSigned public long getTimeoutMillis()
public boolean hasTimeoutMillis()
true if a timeout is defined, false
otherwise. Only asynchronous definitions can have timeouts.public boolean isAsynchronous()
true for asynchronous, false for
synchronous.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<javax.servlet.AsyncListener> getAllAsyncListeners()
AsyncListener. Only contains
items if this is an asynchronous spec.public boolean hasAsyncListeners()
true if any async listener is present,
false otherwise.public void applyToAsyncContext(@Nonnull javax.servlet.AsyncContext aAsyncCtx)
@Nonnull public static ServletAsyncSpec getSync()
SYNC_SPEC. Never null.@Nonnull public static ServletAsyncSpec createAsync(@CheckForSigned long nTimeoutMillis, @Nullable Iterable<? extends javax.servlet.AsyncListener> aAsyncListeners)
nTimeoutMillis - Timeout in milliseconds. Only value > 0 are considered.aAsyncListeners - The async listeners to use. May be null.ServletAsyncSpec and never null.@Nonnull public static ServletAsyncSpec createAsyncDefault()
ServletAsyncSpec and never null.Copyright © 2016–2019 Philip Helger. All rights reserved.