Class AbstractScope

java.lang.Object
com.aspectran.core.component.bean.scope.AbstractScope
All Implemented Interfaces:
Scope, NonPersistent
Direct Known Subclasses:
RequestScope, SessionScope, SingletonScope

public abstract class AbstractScope extends Object implements Scope
Base class for Scope implementations.
Since:
2011. 3. 12.
  • Constructor Details

    • AbstractScope

      public AbstractScope()
  • Method Details

    • getScopedBeanInstances

      protected Map<BeanRule,BeanInstance> getScopedBeanInstances()
    • getBeanInstance

      public BeanInstance getBeanInstance(BeanRule beanRule)
      Description copied from interface: Scope
      Returns an instance of the bean that matches the given bean rule.
      Specified by:
      getBeanInstance in interface Scope
      Parameters:
      beanRule - the bean rule of the bean to retrieve
      Returns:
      an instance of the bean
    • putBeanInstance

      public void putBeanInstance(Activity activity, BeanRule beanRule, BeanInstance beanInstance)
      Description copied from interface: Scope
      Saves an instantiated bean with the given bean rule into the scope.
      Specified by:
      putBeanInstance in interface Scope
      Parameters:
      activity - the current activity
      beanRule - the bean rule of the bean to save
      beanInstance - an instance of the bean
    • getBeanRuleByInstance

      public BeanRule getBeanRuleByInstance(Object bean)
      Description copied from interface: Scope
      Returns the bean rule corresponding to the bean object.
      Specified by:
      getBeanRuleByInstance in interface Scope
      Parameters:
      bean - the bean object to find
      Returns:
      the bean rule
    • containsBeanRule

      public boolean containsBeanRule(BeanRule beanRule)
      Description copied from interface: Scope
      Returns whether the bean rule exists in this scope.
      Specified by:
      containsBeanRule in interface Scope
      Parameters:
      beanRule - the bean rule to find
      Returns:
      true if the bean rule exists in this scope, false otherwise
    • destroy

      public void destroy(Object bean) throws Exception
      Description copied from interface: Scope
      Destroy the bean that matches the given object in this scope.
      Specified by:
      destroy in interface Scope
      Parameters:
      bean - the bean object to destroy
      Throws:
      Exception - if the bean cannot be destroyed
    • destroy

      public void destroy()
      Description copied from interface: Scope
      Destroy all scoped beans in this scope.
      Specified by:
      destroy in interface Scope