Class TypesKnowledge
java.lang.Object
org.gcube.informationsystem.types.knowledge.TypesKnowledge
Manages the knowledge about types.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CalendarThe creation time.static final longThe default expiring timeout.protected CalendarThe expiring time.intThe expiring timeout.protected booleanA flag indicating whether the knowledge has been initialized.protected ModelKnowledge<Type,TypeInformation> The model knowledge.protected TypesDiscoverer<Type>The types discoverer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddiscover()This method do nothing if TypesDiscoverer was not set.static TypesKnowledgeReturns the singleton instance of this class.Returns the model knowledge.Returns the types discoverer.protected voidinit(boolean forceReinitialization) Initializes the knowledge.voidrenew()Force reinitialization ofvoidsetExpiringTimeout(int expiringTimeout) Sets the expiring timeout.voidsetTypesDiscoverer(TypesDiscoverer<Type> typesDiscoverer) Sets the types discoverer.
-
Field Details
-
DEFAULT_EXPIRING_TIMEOUT
public static final long DEFAULT_EXPIRING_TIMEOUTThe default expiring timeout. -
initialized
protected boolean initializedA flag indicating whether the knowledge has been initialized. -
expiringTimeout
public int expiringTimeoutThe expiring timeout. -
creationTime
The creation time. -
expiringTime
The expiring time. -
modelKnowledge
The model knowledge. -
typesDiscoverer
The types discoverer.
-
-
Constructor Details
-
TypesKnowledge
public TypesKnowledge()Constructs a newTypesKnowledge.
-
-
Method Details
-
getInstance
Returns the singleton instance of this class.- Returns:
- The singleton instance.
-
setExpiringTimeout
public void setExpiringTimeout(int expiringTimeout) Sets the expiring timeout.- Parameters:
expiringTimeout- The expiring timeout in milliseconds.
-
getTypesDiscoverer
Returns the types discoverer.- Returns:
- The types discoverer.
-
setTypesDiscoverer
Sets the types discoverer.- Parameters:
typesDiscoverer- The types discoverer.
-
getModelKnowledge
Returns the model knowledge.- Returns:
- The model knowledge.
-
init
protected void init(boolean forceReinitialization) Initializes the knowledge.- Parameters:
forceReinitialization- A flag indicating whether to force reinitialization.
-
discover
public void discover()This method do nothing if TypesDiscoverer was not set. Otherwise initialized the ModelKnowledge if it was not already initialized. To enforce rediscovery use renew method. -
renew
public void renew()Force reinitialization of
-