uk.ac.starlink.vo
Class TapMetaManager

java.lang.Object
  extended by uk.ac.starlink.vo.TapMetaManager

public class TapMetaManager
extends Object

Handles asynchronous population of the TAP metadata hierarchy. It owns a TapMetaReader and invokes its methods as required to populate the metadata hiearchy objects, providing methods that allow callbacks to be invoked when the relevant items are available.

Since:
23 Mar 2015
Author:
Mark Taylor

Constructor Summary
TapMetaManager(TapMetaReader rdr)
          Constructor.
 
Method Summary
 java.util.concurrent.ExecutorService getExecutor()
          Lazily create and return an executor instance.
 TapMetaReader getReader()
          Returns the object that performs the actual data reads.
 boolean onColumns(TableMeta tmeta, Runnable callback)
          Invokes a runnable on the Event Dispatch Thread when the column metadata is available for a given table metadata object.
 boolean onForeignKeys(TableMeta tmeta, Runnable callback)
          Invokes a runnable on the Event Dispatch Thread when the foreign key metadata is available for a given table metadata object.
 boolean onTables(SchemaMeta smeta, Runnable callback)
          Invokes a runnable on the Event Dispatch Thread when the table metadata is available for a given schema metadata object.
 void shutdown()
          Releases resources and terminates any currently running asynchronous metadata reads.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TapMetaManager

public TapMetaManager(TapMetaReader rdr)
Constructor.

Parameters:
rdr - object that knows how to acquire metadata
Method Detail

getReader

public TapMetaReader getReader()
Returns the object that performs the actual data reads.

Returns:
metadata reader

onTables

public boolean onTables(SchemaMeta smeta,
                        Runnable callback)
Invokes a runnable on the Event Dispatch Thread when the table metadata is available for a given schema metadata object. This method, and the supplied callback, are invoked on the EDT.

Parameters:
smeta - schema metadata item
callback - runnable to be invoked on the EDT when smeta.getTables() has a non-null return
Returns:
true iff callback has been called synchronously

onColumns

public boolean onColumns(TableMeta tmeta,
                         Runnable callback)
Invokes a runnable on the Event Dispatch Thread when the column metadata is available for a given table metadata object. This method, and the supplied callback, are invoked on the EDT.

Parameters:
tmeta - table metadata item
callback - runnable to be invoked on the EDT when tmeta.getColumns() has a non-null return
Returns:
true iff callback has been called synchronously

onForeignKeys

public boolean onForeignKeys(TableMeta tmeta,
                             Runnable callback)
Invokes a runnable on the Event Dispatch Thread when the foreign key metadata is available for a given table metadata object. This method, and the supplied callback, are invoked on the EDT.

Parameters:
tmeta - table metadata item
callback - runnable to be invoked on the EDT when tmeta.getForeignKeys() has a non-null return
Returns:
true iff callback has been called synchronously

shutdown

public void shutdown()
Releases resources and terminates any currently running asynchronous metadata reads. Calling this method does not prevent future use of this object.


getExecutor

public java.util.concurrent.ExecutorService getExecutor()
Lazily create and return an executor instance.

Returns:
executor used for asynchronous queries by this object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.