Class AspectAdapter

    • Constructor Detail

      • AspectAdapter

        public AspectAdapter()
    • Method Detail

      • addListener

        public void addListener​(AspectListener listener)
                         throws java.lang.ClassCastException,
                                java.lang.IllegalStateException
        Adds listener.
        Parameters:
        listener - Listener for aspect messages
        Throws:
        java.lang.ClassCastException - Incorrect listener class
        java.lang.IllegalStateException - Cannot change the set of listeners now
      • removeListener

        public void removeListener​(AspectListener listener)
                            throws java.lang.IllegalStateException
        Deletes handler.
        Parameters:
        listener - Handler to delete
        Throws:
        java.lang.IllegalStateException - Cannot change the set of listeners now
      • processMessage

        protected void processMessage​(TraceMessage msg)
                               throws java.lang.IllegalArgumentException
        Handles one message from provider. Realized by concrete aspect dependent adapters. Usual method behaviour - converts raw message from provider into aspect dependent message and distributes it to handlers. Class messages TagMessage come in adapter via method call processTagMessage(TagMessage).
        Throws:
        java.lang.IllegalArgumentException - Incorrect message struct or incorrect message data
      • getListenerClass

        public abstract java.lang.Class<? extends AspectListener> getListenerClass()
        Gets interface class which must be realized by all handlers of this aspect.
      • getAspect

        public abstract java.lang.String getAspect()
        Gets the name of the aspect that is being handled.
      • processTagMessage

        protected void processTagMessage​(TagMessage msg)
        Notification about tags change from provider. This message is being send to the CommonAdapter and to the corresponding aspect adapter.
      • getListeners

        protected java.util.List<? extends AspectListener> getListeners()
        Gets list of handlers for the internal use. Subclasses must override this method with an appropriate type of return value.
      • getTraceProvider

        protected final TraceProvider getTraceProvider()
        Gets current provider.
      • getCurrentChannel

        public java.lang.String getCurrentChannel()
      • setCurrentChannel

        protected void setCurrentChannel​(java.lang.String currentChannel)
      • getAllTags

        public final java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getAllTags()
        Gets copy of all tags from provider. Calls method TraceProvider.getAllTags()
        Returns:
        Copy of all tags from provider. Changes of return value have no influence on provider.
      • getMyTags

        protected final java.util.Set<java.lang.String> getMyTags()
        Gets tags for the aspect from the provider. Calls method TraceProvider.getTags(String)
        Returns:
        Direct link on the corresponding part of provider state.
      • processingStarted

        public void processingStarted​(java.lang.String providerDesc)
        Notification from provider: begin trace handling. By agreement, this method is overridden only in the class which CommonAdapter distributes the corresponding message between the handlers and provider notifies only this method.
      • processingFinished

        public void processingFinished​(java.lang.String providerDesc,
                                       boolean normally)
        Notification from provider: end trace handling. By agreement, this method is overridden only in the class which CommonAdapter, distributes the corresponding message between the handlers and provider notifies only this method.