Class ItemHolder<Base,​Secured extends SecuredItem>

  • Type Parameters:
    Base - The base class that is being secured
    Secured - The implementation (proxy) of the secured class.

    public class ItemHolder<Base,​Secured extends SecuredItem>
    extends java.lang.Object
    A class that holds the original item and the secured version of it. This class is used by the Invoker to return secured versions of the object during calls that return the called class for cascading.
    • Constructor Detail

      • ItemHolder

        public ItemHolder​(Base baseItem)
        Constructor.
        Parameters:
        baseItem - The base item.
    • Method Detail

      • getBaseItem

        public Base getBaseItem()
        Get the base item. This method is used in the proxy to get call to the underlying instance.
        Returns:
        The instance that is being protected.
      • getSecuredItem

        public Secured getSecuredItem()
        Get the secured item. This method is used in the invocation handler to get the instance of the proxy on which a method call was made. Generally used in returning the original object to support cascading.
        Returns:
        the proxy.
      • setSecuredItem

        public final Secured setSecuredItem​(SecuredItemInvoker handler)
        Creates the proxy, saves it as the securedItem and returns it.
        Parameters:
        handler - The SecuredItemInvoker to create the proxy with.
        Returns:
        The proxy.