Class AttributesContainerCache<ATTRIBUTETYPE,​PARENTTYPE>

  • Type Parameters:
    ATTRIBUTETYPE - The type of the parent object's attributes.
    PARENTTYPE - The type of the parent object which holds the attributes.

    public class AttributesContainerCache<ATTRIBUTETYPE,​PARENTTYPE>
    extends Object
    The MBeanTree shows all available MBeans. Each Mbean has one or more attributes. Each attribute is selectable. The MBean's attributes are shown in a table. The problem is, that we must store the "is selected" state of each AttributeItem. So we have two choices:
    1. add ALL attributes from ALL MBeans to the container of the table and show only the one belonging to the selected Mbean.
    2. only add selected MBean's attributes to the container and save the container for later use.
    We stick to 2. So at the beginning this class simply maps each MBean to its container. But further on we realized that there are more scenarios where we have a parent object which has a list of attributes. So the AttributesContainerCache got more generic. Therefore the ATTRIBUTETYPE defines the type of the attribute (e.g. Attrib to stick with the MBeans example) and the PARENTTYPE defines the type of the parent object (e.g. Mbean to stick with the MBeans example).
    Author:
    Markus von RĂ¼den
    • Method Detail

      • getContainer

        public SelectableBeanItemContainer<ATTRIBUTETYPE> getContainer​(PARENTTYPE bean)
        Gets the container of the given bean. If there is no container a new one is created, otherwise the earlier used container is returned.
        Parameters:
        bean -
        Returns:
      • clear

        public void clear()
        Clears the containerMap.