Class QNotification

  • All Implemented Interfaces:
    java.lang.Runnable

    public class QNotification
    extends java.lang.Thread
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int OP_AVAILABLE  
      static int OP_EMPTY  
      static int OP_FULL  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void register​(QCallback a, int purpose)
      register : registers a callback which will be called when memQ is empty/full/data available it is assumed that the callback implements the handle()function
      void run()
      run : the thread run method issues full/empty/data available triggers to objects registered for respective triggers
      void setPurpose​(int p)
      setPurpose set the operation that should be handled
      void unregister​(QCallback a, int purpose)
      unregister : unregisters a callback
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

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

      • QNotification

        public QNotification​(Log l,
                             MemBufferQ src)
    • Method Detail

      • setPurpose

        public void setPurpose​(int p)
        setPurpose set the operation that should be handled
        Parameters:
        p - full/empty/data available
      • register

        public void register​(QCallback a,
                             int purpose)
        register : registers a callback which will be called when memQ is empty/full/data available it is assumed that the callback implements the handle()function
        Parameters:
        a - object to be triggered
        purpose - full/empty/data available
      • unregister

        public void unregister​(QCallback a,
                               int purpose)
                        throws java.lang.Exception
        unregister : unregisters a callback
        Parameters:
        a - object to be unregistered
        purpose - full/empty/data available if -1 unregister the object from all callbacks
        Throws:
        java.lang.Exception - if callback object is not found
      • run

        public void run()
        run : the thread run method issues full/empty/data available triggers to objects registered for respective triggers
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread