Class DetachableBeanHolder

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    HotswapSpringInvocationHandler

    public class DetachableBeanHolder
    extends java.lang.Object
    implements java.io.Serializable
    Loadable detachable Spring bean holder
    Author:
    Erki Ehtla
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      DetachableBeanHolder​(java.lang.Object bean, java.lang.Object beanFactry, java.lang.Class<?>[] paramClasses, java.lang.Object[] paramValues)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void detach()
      Clear the bean for this proxy
      static void detachBeans()
      Clears the bean references inside all of the proxies
      java.lang.Object getBean()
      Returns an existing bean instance or retrieves and stores new bean from the Spring BeanFactory
      java.lang.Object getTarget()
      Returns current target bean.
      protected boolean isBeanLoaded()  
      void setTarget​(java.lang.Object bean)
      Sets current target bean.
      • Methods inherited from class java.lang.Object

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

      • DetachableBeanHolder

        public DetachableBeanHolder​(java.lang.Object bean,
                                    java.lang.Object beanFactry,
                                    java.lang.Class<?>[] paramClasses,
                                    java.lang.Object[] paramValues)
        Parameters:
        bean - Spring Bean this object holds
        beanFactry - Spring factory that produced the bean with a ProxyReplacer.FACTORY_METHOD_NAME method
        paramClasses -
        paramValues -
    • Method Detail

      • detachBeans

        public static void detachBeans()
        Clears the bean references inside all of the proxies
      • detach

        public void detach()
        Clear the bean for this proxy
      • setTarget

        public void setTarget​(java.lang.Object bean)
        Sets current target bean.
      • getTarget

        public java.lang.Object getTarget()
        Returns current target bean.
        Returns:
        current target bean.
      • getBean

        public java.lang.Object getBean()
                                 throws java.lang.IllegalAccessException,
                                        java.lang.reflect.InvocationTargetException
        Returns an existing bean instance or retrieves and stores new bean from the Spring BeanFactory
        Returns:
        Bean this instance holds
        Throws:
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • isBeanLoaded

        protected boolean isBeanLoaded()