|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.utils.guice.AgentScope
public class AgentScope
Scope used during the construction of the agent - treating all new instances (of classes annotated with AgentScoped
)
as singletons.
After instantiation of the agent, Pogamut calls clearScope() to release all references to instantiated objects that allows to reuse the injector again to get another instance of the agent.
We need this, because we're usually have one connection object that must be injected into two different classes thus must be treated "as a singleton for one instantiation of the agent". (This is not the only example...)
Every pogamut.base class is AgentScoped
.
Nested Class Summary | |
---|---|
static class |
AgentScope.SingletonProvider<T>
|
Constructor Summary | |
---|---|
AgentScope()
|
Method Summary | ||
---|---|---|
void |
clearScope()
Release all AgentScoped objects that the scope is holding. |
|
|
scope(com.google.inject.Key<T> key,
com.google.inject.Provider<T> creator)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.google.inject.Scope |
---|
toString |
Constructor Detail |
---|
public AgentScope()
Method Detail |
---|
public <T> com.google.inject.Provider scope(com.google.inject.Key<T> key, com.google.inject.Provider<T> creator)
scope
in interface com.google.inject.Scope
public void clearScope()
IAgentScope
AgentScoped
objects that the scope is holding.
clearScope
in interface IAgentScope
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |