io.sarl.sre.janus.services.context
Class AbstractContextService
All Superinterfaces:
ContextService, org.arakhne.afc.services.IService
All Known Subclasses:
AbstractInjectionBasedContextService
@javax.inject.Singleton
abstract class AbstractContextService
extends java.lang.Object
implements ContextService
A service managing the root context and enabling the creation of contexts.

This service is thread-safe.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Property Summary
Modifier and type Property and description
protected java.util.Map<K,V> contextInternalStructure
Replies the internal data structure for storing the contexts.
java.lang.Class<T> referenceType
Context rootContext
Inherited: allContexts
Field Summary
Modifier and type Field and description
protected val java.util.concurrent.locks.ReadWriteLock lock
The lock resource.
protected val java.util.logging.Logger logger
The logger for this service.
Constructor Summary
Constructor and description
new(Context,LoggingService,Provider<T>)
Constructor.
Action Summary
Modifier and type Action and description
final Context createContext(UUID,UUID,Agent)
final Context createContextWithoutRegistration(UUID,UUID,Agent)
protected java.util.logging.Logger createLogger(LoggingService)
Create the instance of the logger for this service.
Context getContext(UUID)
protected abstract java.util.Map<K,V> getContextInternalStructure
Replies the internal data structure for storing the contexts.
java.lang.Class<T> getReferenceType
Context getRootContext
protected abstract Context newContextInstance(UUID,UUID,Agent)
Create a context instance.
void onStart
void onStop
Context removeContext(UUID)
Inherited: getAllContexts
Property Details
contextInternalStructure
protected val contextInternalStructure : java.util.Map<K,V>
Replies the internal data structure for storing the contexts.

This function is not thread-safe.

This property is an alias for the action: getContextInternalStructure

referenceType
val referenceType : java.lang.Class<T>

This property is an alias for the action: getReferenceType

rootContext
val rootContext : Context

This property is an alias for the action: getRootContext

Field Details
lock
protected val lock : java.util.concurrent.locks.ReadWriteLock
The lock resource.
logger
protected val logger : java.util.logging.Logger
The logger for this service.
Constructor Details
new(Context,LoggingService,Provider<T>)
protected new(Context,LoggingService,Provider<T>)
Constructor.
Parameters:
rootContext - the root context.
logger - the logging service to be used.
factories - the provider of factories tool.
Action Details
createContext(UUID,UUID,Agent)
def createContext(UUID,UUID,Agent) : Context
createContextWithoutRegistration(UUID,UUID,Agent)
def createContextWithoutRegistration(UUID,UUID,Agent) : Context
createLogger(LoggingService)
protected def createLogger(LoggingService) : java.util.logging.Logger
Create the instance of the logger for this service.
Parameters:
loggingService - the logging service.
Returns:
the logger.
Since:
0.12
getContext(UUID)
def getContext(UUID) : Context
getContextInternalStructure
protected def getContextInternalStructure : java.util.Map<K,V>
Replies the internal data structure for storing the contexts.

This function is not thread-safe.
getReferenceType
def getReferenceType : java.lang.Class<T>
getRootContext
def getRootContext : Context
newContextInstance(UUID,UUID,Agent)
protected def newContextInstance(UUID,UUID,Agent) : Context
Create a context instance.

This function is not thread-safe.
Parameters:
contextID - the identifier of the context.
defaultSpaceID - the identifier of the default space in the context.
owner - is the owner of the context. If null, the context is the root context
onStart
def onStart
onStop
def onStop
removeContext(UUID)
def removeContext(UUID) : Context