Class ProtoScope

  • All Implemented Interfaces:
    Scope

    public class ProtoScope
    extends java.lang.Object
    implements Scope
    Prototype scope doesn't pool any beans, so each time bean is requested, a new instance will be created. Prototype scope does not call destroy methods.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProtoScope()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(Scope referenceScope)
      Allows all scopes to be injected into prototype scoped beans.
      java.lang.Object lookup​(java.lang.String name)
      Returns null as no bean instance is stored.
      void register​(BeanDefinition beanDefinition, java.lang.Object bean)
      Does nothing, as bean instances are not stored.
      void remove​(java.lang.String name)
      Does nothing.
      void shutdown()
      Does nothing.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProtoScope

        public ProtoScope()
    • Method Detail

      • lookup

        public java.lang.Object lookup​(java.lang.String name)
        Returns null as no bean instance is stored.
        Specified by:
        lookup in interface Scope
      • register

        public void register​(BeanDefinition beanDefinition,
                             java.lang.Object bean)
        Does nothing, as bean instances are not stored.
        Specified by:
        register in interface Scope
      • remove

        public void remove​(java.lang.String name)
        Does nothing.
        Specified by:
        remove in interface Scope
      • accept

        public boolean accept​(Scope referenceScope)
        Allows all scopes to be injected into prototype scoped beans.
        Specified by:
        accept in interface Scope
      • shutdown

        public void shutdown()
        Does nothing.
        Specified by:
        shutdown in interface Scope