public class ServiceGetter<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Future<T> |
callfut
Ongoing call future.
|
protected IInternalAccess |
component
The internal access.
|
protected long |
delay
The delay between searches when no service was found.
|
protected long |
lastsearch
The time of the last search.
|
protected ServiceScope |
scope
The scope.
|
protected T |
service
The cached service.
|
protected java.lang.Class<T> |
type
The service type.
|
Constructor and Description |
---|
ServiceGetter(IInternalAccess component,
java.lang.Class<T> type,
ServiceScope scope)
Create a new service getter.
|
ServiceGetter(IInternalAccess component,
long delay,
java.lang.Class<T> type,
ServiceScope scope)
Create a new service getter.
|
Modifier and Type | Method and Description |
---|---|
T |
getLastService()
Get last service.
|
IFuture<T> |
getService()
Get or search the service with a delay in case not found.
|
void |
resetService()
Set the service to null, if e.g.
|
protected IInternalAccess component
protected java.lang.Class<T> type
protected T service
protected ServiceScope scope
protected long lastsearch
protected long delay
public ServiceGetter(IInternalAccess component, java.lang.Class<T> type, ServiceScope scope)
public ServiceGetter(IInternalAccess component, long delay, java.lang.Class<T> type, ServiceScope scope)