Class ContainerLifeCycle

    • Constructor Detail

      • ContainerLifeCycle

        public ContainerLifeCycle()
        Deprecated.
    • Method Detail

      • destroy

        public void destroy()
        Deprecated.
        Destroys the managed Destroyable beans in the reverse order they were added.
        Specified by:
        destroy in interface Destroyable
      • contains

        public boolean contains​(java.lang.Object bean)
        Deprecated.
        Parameters:
        bean - the bean to test
        Returns:
        whether this aggregate contains the bean
      • isManaged

        public boolean isManaged​(java.lang.Object bean)
        Deprecated.
        Description copied from interface: Container
        Test if this container manages a bean
        Specified by:
        isManaged in interface Container
        Parameters:
        bean - the bean to test
        Returns:
        whether this aggregate contains and manages the bean
      • isAuto

        public boolean isAuto​(java.lang.Object bean)
        Deprecated.
        Parameters:
        bean - the bean to test
        Returns:
        whether this aggregate contains the bean in auto state
      • isUnmanaged

        public boolean isUnmanaged​(java.lang.Object bean)
        Deprecated.
        Parameters:
        bean - the bean to test
        Returns:
        whether this aggregate contains the bean in auto state
      • addBean

        public boolean addBean​(java.lang.Object o)
        Deprecated.
        Adds the given bean, detecting whether to manage it or not. If the bean is a LifeCycle, then it will be managed if it is not already started and not managed if it is already started. The addBean(Object, boolean) method should be used if this is not correct, or the manage(Object) and unmanage(Object) methods may be used after an add to change the status.
        Specified by:
        addBean in interface Container
        Parameters:
        o - the bean object to add
        Returns:
        true if the bean was added, false if it was already present
      • addBean

        public boolean addBean​(java.lang.Object o,
                               boolean managed)
        Deprecated.
        Adds the given bean, explicitly managing it or not.
        Specified by:
        addBean in interface Container
        Parameters:
        o - The bean object to add
        managed - whether to managed the lifecycle of the bean
        Returns:
        true if the bean was added, false if it was already present
      • addManaged

        public void addManaged​(LifeCycle lifecycle)
        Deprecated.
        Adds a managed lifecycle.

        This is a convenience method that uses addBean(lifecycle,true) and then ensures that the added bean is started iff this container is running. Exception from nested calls to start are caught and wrapped as RuntimeExceptions

        Parameters:
        lifecycle - the managed lifecycle to add
      • manage

        public void manage​(java.lang.Object bean)
        Deprecated.
        Manages a bean already contained by this aggregate, so that it is started/stopped/destroyed with this aggregate.
        Specified by:
        manage in interface Container
        Parameters:
        bean - The bean to manage (must already have been added).
      • unmanage

        public void unmanage​(java.lang.Object bean)
        Deprecated.
        Unmanages a bean already contained by this aggregate, so that it is not started/stopped/destroyed with this aggregate.
        Specified by:
        unmanage in interface Container
        Parameters:
        bean - The bean to unmanage (must already have been added).
      • getBeans

        public java.util.Collection<java.lang.Object> getBeans()
        Deprecated.
        Specified by:
        getBeans in interface Container
        Returns:
        the collection of beans known to this aggregate, in the order they were added.
        See Also:
        Container.getBean(Class)
      • setBeans

        public void setBeans​(java.util.Collection<java.lang.Object> beans)
        Deprecated.
      • getBeans

        public <T> java.util.Collection<T> getBeans​(java.lang.Class<T> clazz)
        Deprecated.
        Specified by:
        getBeans in interface Container
        Type Parameters:
        T - the Bean type
        Parameters:
        clazz - the class of the beans
        Returns:
        a list of beans of the given class (or subclass), in the order they were added.
        See Also:
        Container.getBeans(), Container.getContainedBeans(Class)
      • getBean

        public <T> T getBean​(java.lang.Class<T> clazz)
        Deprecated.
        Specified by:
        getBean in interface Container
        Type Parameters:
        T - the Bean type
        Parameters:
        clazz - the class of the bean
        Returns:
        the first bean (in order added) of a specific class (or subclass), or null if no such bean exist
      • removeBeans

        public void removeBeans()
        Deprecated.
        Removes all bean
      • dumpStdErr

        @ManagedOperation("Dump the object to stderr")
        public void dumpStdErr()
        Deprecated.
        Dumps to System.err.
        See Also:
        dump()
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Deprecated.
        Description copied from interface: Dumpable
        Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
        Specified by:
        dump in interface Dumpable
        Parameters:
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws:
        java.io.IOException - if unable to write to Appendable
      • dump

        public void dump​(java.lang.Appendable out)
                  throws java.io.IOException
        Deprecated.
        Dump this object to an Appendable with no indent.
        Parameters:
        out - The appendable to dump to.
        Throws:
        java.io.IOException - May be thrown by the Appendable
      • dumpObject

        @Deprecated
        public static void dumpObject​(java.lang.Appendable out,
                                      java.lang.Object obj)
                               throws java.io.IOException
        Description copied from interface: Dumpable
        Dump just an Object (but not it's contained items) to an Appendable.
        Parameters:
        out - The Appendable to dump to
        obj - The object to dump
        Throws:
        java.io.IOException - May be thrown by the Appendable
      • dump

        @Deprecated
        public static void dump​(java.lang.Appendable out,
                                java.lang.String indent,
                                java.util.Collection<?>... collections)
                         throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • updateBean

        public void updateBean​(java.lang.Object oldBean,
                               java.lang.Object newBean)
        Deprecated.
      • updateBean

        public void updateBean​(java.lang.Object oldBean,
                               java.lang.Object newBean,
                               boolean managed)
        Deprecated.
      • updateBeans

        public void updateBeans​(java.lang.Object[] oldBeans,
                                java.lang.Object[] newBeans)
        Deprecated.
      • getContainedBeans

        public <T> java.util.Collection<T> getContainedBeans​(java.lang.Class<T> clazz)
        Deprecated.
        Specified by:
        getContainedBeans in interface Container
        Type Parameters:
        T - the Bean type
        Parameters:
        clazz - the class of the beans
        Returns:
        the list of beans of the given class from the entire Container hierarchy. The order is primarily depth first and secondarily added order.