Class Layer

    • Constructor Summary

      Constructors 
      Constructor Description
      Layer()  
      Layer​(boolean stateful)  
      Layer​(java.lang.String implName)  
      Layer​(java.lang.String implName, boolean stateful)
      This is the end point for all the layers constructor.
    • Method Summary

      Modifier and Type Method Description
      protected Layer.Access checkAccess()
      This method must be override to add restrictions over particular implementations of the layers.
      java.util.Set<java.lang.String> getAliases()
      Return the string set with all the aliases for this implementation.
      java.lang.String getImplName()
      Return the layer implementation name.
      protected <L extends LayerInterface>
      L
      getLayer​(java.lang.Class<? extends L> layerClass, java.lang.String implName)
      Delegation method to get some layer implementation.
      LayerProxy getProxy()
      Return the layer proxy of the layer or null by default.
      protected ServiceSession getSession()
      Return the session associated to the execution thread.
      protected java.lang.Object getTarget()
      This method return the invocation target.
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
      This method intercepts the call to layer implementation and save some information about the thread behavior.
      boolean isOverwritable()
      This method return true if the layer instance is overwritable for other instance whit the same name.
      boolean isPlugin()
      Returns true if the layer implementations is a instanceof plugin or false in the otherwise.
      boolean isStateful()
      Return if the layer is stateful or not.
      • Methods inherited from class java.lang.Object

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

      • Layer

        public Layer​(java.lang.String implName,
                     boolean stateful)
        This is the end point for all the layers constructor.
        Parameters:
        implName - Implementation name.
        stateful - Stateful status.
      • Layer

        public Layer​(java.lang.String implName)
      • Layer

        public Layer​(boolean stateful)
      • Layer

        public Layer()
    • Method Detail

      • getImplName

        public java.lang.String getImplName()
        Return the layer implementation name.
        Specified by:
        getImplName in interface LayerInterface
        Returns:
        Layer implementation name.
      • isStateful

        public final boolean isStateful()
        Return if the layer is stateful or not.
        Specified by:
        isStateful in interface LayerInterface
        Returns:
        Stateful
      • isPlugin

        public final boolean isPlugin()
        Returns true if the layer implementations is a instanceof plugin or false in the otherwise.
        Specified by:
        isPlugin in interface LayerInterface
        Returns:
        Plugin status.
      • getAliases

        public java.util.Set<java.lang.String> getAliases()
        Return the string set with all the aliases for this implementation.
        Returns:
        Aliases for this implementation.
      • isOverwritable

        public boolean isOverwritable()
        This method return true if the layer instance is overwritable for other instance whit the same name.
        Returns:
        True if the layer is overwritable or false in the otherwise.
      • checkAccess

        protected Layer.Access checkAccess()
        This method must be override to add restrictions over particular implementations of the layers.
        Returns:
        Access object.
      • getLayer

        protected final <L extends LayerInterface> L getLayer​(java.lang.Class<? extends L> layerClass,
                                                              java.lang.String implName)
        Delegation method to get some layer implementation.
        Type Parameters:
        L - Expected layer implementation class.
        Parameters:
        layerClass - Layer implementation class.
        implName - Layer implementation name.
        Returns:
        Layer implementation.
      • getProxy

        public LayerProxy getProxy()
        Return the layer proxy of the layer or null by default.
        Returns:
        Layer proxy instance.
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        This method intercepts the call to layer implementation and save some information about the thread behavior.
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Parameters:
        proxy - Object to be called.
        method - Method to be called.
        args - Method to invoke the method.
        Returns:
        Return the value returned for the proxy method.
        Throws:
        java.lang.Throwable - Throw all the generated exceptions.
      • getTarget

        protected java.lang.Object getTarget()
        This method return the invocation target.
        Returns:
        Invocation target.
      • getSession

        protected final ServiceSession getSession()
        Return the session associated to the execution thread.
        Returns:
        Service session.