Interface Scope
-
- All Superinterfaces:
NonPersistent
- All Known Implementing Classes:
AbstractScope,HttpSessionScope,RequestScope,SessionScope,SingletonScope
public interface Scope extends NonPersistent
The Interface Scope.- Since:
- 2011. 3. 12.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsBeanRule(BeanRule beanRule)Returns whether the bean rule exists in this scope.voiddestroy()Destroy all scoped beans in this scope.voiddestroy(java.lang.Object bean)Destroy the bean that matches the given object in this scope.BeanInstancegetBeanInstance(BeanRule beanRule)Returns an instance of the bean that matches the given bean rule.BeanRulegetBeanRule(java.lang.Object bean)Returns the bean rule corresponding to the bean object.java.util.concurrent.locks.ReadWriteLockgetScopeLock()Returns the lock of this scope.ScopeTypegetScopeType()Returns the type of this scope.voidputBeanInstance(Activity activity, BeanRule beanRule, BeanInstance beanInstance)Saves an instantiated bean with the given bean rule into the scope.
-
-
-
Method Detail
-
getScopeType
ScopeType getScopeType()
Returns the type of this scope.- Returns:
- the scope type
-
getScopeLock
java.util.concurrent.locks.ReadWriteLock getScopeLock()
Returns the lock of this scope.- Returns:
- the scope lock
-
getBeanInstance
BeanInstance getBeanInstance(BeanRule beanRule)
Returns an instance of the bean that matches the given bean rule.- Parameters:
beanRule- the bean rule of the bean to retrieve- Returns:
- an instance of the bean
-
putBeanInstance
void putBeanInstance(Activity activity, BeanRule beanRule, BeanInstance beanInstance)
Saves an instantiated bean with the given bean rule into the scope.- Parameters:
activity- the current activitybeanRule- the bean rule of the bean to savebeanInstance- an instance of the bean
-
getBeanRule
BeanRule getBeanRule(java.lang.Object bean)
Returns the bean rule corresponding to the bean object.- Parameters:
bean- the bean object to find- Returns:
- the bean rule
-
containsBeanRule
boolean containsBeanRule(BeanRule beanRule)
Returns whether the bean rule exists in this scope.- Parameters:
beanRule- the bean rule to find- Returns:
trueif the bean rule exists in this scope,falseotherwise
-
destroy
void destroy(java.lang.Object bean) throws java.lang.ExceptionDestroy the bean that matches the given object in this scope.- Parameters:
bean- the bean object to destroy- Throws:
java.lang.Exception- if the bean cannot be destroyed
-
destroy
void destroy()
Destroy all scoped beans in this scope.
-
-