T
- The type to be returned (normally the subclass' type)public abstract class SlowLoadableComponent<T extends LoadableComponent<T>> extends LoadableComponent<T>
LoadableComponent
which might not have finished loading when load() returns. After a
call to load(), the isLoaded() method should continue to fail until the component has fully
loaded.
new SlowHypotheticalComponent().get();
Constructor and Description |
---|
SlowLoadableComponent(Clock clock,
int timeOutInSeconds)
Deprecated.
|
SlowLoadableComponent(java.time.Clock clock,
int timeOutInSeconds) |
Modifier and Type | Method and Description |
---|---|
T |
get()
Ensure that the component is currently loaded.
|
protected void |
isError()
Check for well known error cases, which would mean that loading has finished, but an error
condition was seen.
|
protected long |
sleepFor() |
isLoaded, load
@Deprecated public SlowLoadableComponent(Clock clock, int timeOutInSeconds)
SlowLoadableComponent(java.time.Clock, int)
.public SlowLoadableComponent(java.time.Clock clock, int timeOutInSeconds)
public T get()
LoadableComponent
get
in class LoadableComponent<T extends LoadableComponent<T>>
protected void isError() throws java.lang.Error
java.lang.Error
- When a well-known error condition has caused the load to failprotected long sleepFor()