Class QueryManager

    • Method Detail

      • createInstance

        public static void createInstance​(int numWorkers,
                                          int numUpdaters)
      • stop

        public void stop()
      • getActiveThreads

        public int getActiveThreads()
      • getQueryCount

        public int getQueryCount()
      • printReport

        public void printReport()
      • runUpdateQuery

        public void runUpdateQuery​(IQueryResponseListener adapter,
                                   java.lang.String query,
                                   java.lang.String datasource)
      • registerQuery

        public java.lang.Object registerQuery​(IQuery query,
                                              IQueryResponseListener listener,
                                              java.lang.Class targetType,
                                              int updateRate,
                                              boolean runOnce,
                                              boolean notifyLoading)
        Registers a new query to be run, either periodically or once. This "query" is an implementation of IQuery - anything that can retrieve a Dataset from the gateway.
        Parameters:
        targetType - The data type that will be pushed into the query response listener. Use Dataset.class to leave the IQuery's resulting dataset untouched. Use a scalar type to coerce the 1st value.
        updateRate - The rate (actually a delay) at which to run the query.
        runOnce - If true, the query will only be run once, regardless of the update rate
        notifyLoading - Controls whether or not the response listener will be notified when this query is running.
      • unregisterQuery

        public void unregisterQuery​(java.lang.Object key)
      • setPaused

        public void setPaused​(boolean paused)