Class AbstractPrototypeBasedTargetSource

    • Constructor Detail

      • AbstractPrototypeBasedTargetSource

        public AbstractPrototypeBasedTargetSource()
    • Method Detail

      • newPrototypeInstance

        protected java.lang.Object newPrototypeInstance()
                                                 throws BeansException
        Subclasses should call this method to create a new prototype instance.
        BeansException - if bean creation failed
      • destroyPrototypeInstance

        protected void destroyPrototypeInstance(java.lang.Object target)
        Subclasses should call this method to destroy an obsolete prototype instance.
        target - the bean instance to destroy
      • writeReplace

        protected java.lang.Object writeReplace()
        Replaces this object with a SingletonTargetSource on serialization. Protected as otherwise it won't be invoked for subclasses. (The writeReplace() method must be visible to the class being serialized.)

        With this implementation of this method, there is no need to mark non-serializable fields in this class or subclasses as transient.