locator
Class Locator

java.lang.Object
  extended bylocator.Locator
All Implemented Interfaces:
PDFDrain

public class Locator
extends java.lang.Object
implements PDFDrain

The locator is responsible for requesting current PDFs from all registered plugins and calculate the compound PDF out of it.


Constructor Summary
Locator()
           
 
Method Summary
 void callback(PDF pdf, int handle)
          implementation of the callback handler.
 CompoundPdf getCompoundPdf()
          triggers the plugins to create a current PDF and returns the compound PDF.
 void loadPlugin(java.lang.String name)
          load a new plugin.
 void unloadPlugin(java.lang.String name)
          unload a plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Locator

public Locator()
Method Detail

loadPlugin

public void loadPlugin(java.lang.String name)
load a new plugin. If it is loaded already, unload it first.

Parameters:
name - the name of the plugin class

unloadPlugin

public void unloadPlugin(java.lang.String name)
unload a plugin. If it is not loaded nothing happens

Parameters:
name - the name of the plugin class

callback

public void callback(PDF pdf,
                     int handle)
implementation of the callback handler. Accepts a PDF from a plugin only if the handle matches. This is to block late deliveries of PDFs.

Specified by:
callback in interface PDFDrain
Parameters:
pdf - the plugins PDF
handle - the handle which was passed to the plugin when triggered to generate a new PDF

getCompoundPdf

public CompoundPdf getCompoundPdf()
triggers the plugins to create a current PDF and returns the compound PDF. After triggering all plugins the function waits to give the plugins enough time. As soon as all plugins returned a PDF through the callback or after the timeout exceeded the function starts to calculate the compound PDF

Returns:
the compound PDF over all delivered PDFs