public interface ServiceContext
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close context and release resources.
|
AgrosystServiceConfig |
getConfig()
Let each service get the current configuration
|
Date |
getCurrentDate()
Méthode à utiliser plutôt que new Date() pour une meilleure testabilité
|
AgrosystTopiaDaoSupplier |
getDaoSupplier()
Permet à chaque service d'obtenir un fournisseur de Dao
|
com.google.gson.Gson |
getGson() |
AgrosystTopiaPersistenceContext |
getPersistenceContext() |
AgrosystTopiaPersistenceContext |
getPersistenceContext(boolean create) |
SecurityContext |
getSecurityContext()
Returns the current security context.
|
SecurityContext |
getSecurityContextAsUser(String userId)
Returns the current security context to operate as specified
userId. |
org.nuiton.topia.persistence.TopiaTransaction |
getTransaction()
Permet à chaque service d'obtenir la transaction en cours.
|
org.nuiton.topia.persistence.TopiaTransaction |
getTransaction(boolean create)
Permet à chaque service d'obtenir la transaction en cours
|
<I> I |
newInstance(Class<I> clazz)
Build new
clazz instance with inject objects (Service, Config, DAO...) |
<E extends AgrosystService> |
newService(Class<E> clazz)
Build new service instance depending on factory implementation.
|
ServiceContext |
newServiceContext()
Create new service context from current service context with custom lifecycle.
|
Date getCurrentDate()
org.nuiton.topia.persistence.TopiaTransaction getTransaction()
getTransaction(boolean))} avec la valeur 'true'getTransaction(boolean)org.nuiton.topia.persistence.TopiaTransaction getTransaction(boolean create)
create - indique si il faut créer la transaction si elle n'existe pasAgrosystTopiaDaoSupplier getDaoSupplier()
AgrosystTopiaPersistenceContext getPersistenceContext()
AgrosystTopiaPersistenceContext getPersistenceContext(boolean create)
create - indique si il faut créer la transaction si elle n'existe pasServiceContext newServiceContext()
void close()
<E extends AgrosystService> E newService(Class<E> clazz)
clazz - service interfaceServiceFactory.newService(Class)<I> I newInstance(Class<I> clazz)
clazz instance with inject objects (Service, Config, DAO...)clazz - implementation classAgrosystServiceConfig getConfig()
SecurityContext getSecurityContext()
SecurityContext getSecurityContextAsUser(String userId)
userId. Note : the life cycle of this object is linked to the security context
life cycle (request).userId - userId to operate withcom.google.gson.Gson getGson()
Copyright © 2013–2015 Inra. All rights reserved.