Package org.apache.ivy.plugins.resolver
Class LazyTimeoutConstraint
- java.lang.Object
-
- org.apache.ivy.plugins.resolver.LazyTimeoutConstraint
-
- All Implemented Interfaces:
TimeoutConstraint
final class LazyTimeoutConstraint extends java.lang.Object implements TimeoutConstraint
ATimeoutConstraint
which determines the timeouts by invoking theunderlying resolver
'sAbstractResolver.getTimeoutConstraint()
, whenever the timeouts are requested for. This class can be used when theTimeoutConstraint
is to be created but the underlying resolver, which decides the timeouts, hasn't yet been fully initialized
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractResolver
resolver
-
Constructor Summary
Constructors Constructor Description LazyTimeoutConstraint(AbstractResolver resolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getConnectionTimeout()
int
getReadTimeout()
-
-
-
Field Detail
-
resolver
private final AbstractResolver resolver
-
-
Constructor Detail
-
LazyTimeoutConstraint
public LazyTimeoutConstraint(AbstractResolver resolver)
-
-
Method Detail
-
getConnectionTimeout
public int getConnectionTimeout()
- Specified by:
getConnectionTimeout
in interfaceTimeoutConstraint
- Returns:
- Returns the timeout, in milliseconds, that's to be used while establishing a
connection to a resource. A value greater than zero indicates the specific timeout to be
used. A value of 0 indicates no timeout and essentially translates to wait-forever
semantics. A value lesser than 0 lets the users of this
TimeoutConstraint
decide what kind of timeout semantics to use while establishing a connection (for example, some implementations can decide to use some default value).
-
getReadTimeout
public int getReadTimeout()
- Specified by:
getReadTimeout
in interfaceTimeoutConstraint
- Returns:
- Returns the timeout, in milliseconds, that's to be used while reading content from
a resource. A value greater than zero indicates the specific timeout to be used. A value of
0 indicates no timeout and essentially translates to wait-forever semantics. A value lesser
than 0 lets the users of this
TimeoutConstraint
decide what kind of timeout semantics to use reading from the resource (for example, some implementations can decide to use some default value).
-
-