gate.gui
Class NameBearerHandle.ExportApplicationAction.ExporterBuildListener

java.lang.Object
  extended by gate.gui.NameBearerHandle.ExportApplicationAction.ExporterBuildListener
All Implemented Interfaces:
Executable, EventListener, org.apache.tools.ant.BuildListener
Enclosing class:
NameBearerHandle.ExportApplicationAction

 class NameBearerHandle.ExportApplicationAction.ExporterBuildListener
extends Object
implements org.apache.tools.ant.BuildListener, Executable

Build listener to receive log messages from Ant tasks and forward them to the GATE status listener (i.e. the status bar). This class implements Executable not because it is itself executed, but in order to support interruption. If the user presses the stop button in the GUI lock window this object will be interrupted, and will throw an exception at the next call to messageLogged, which has the effect of interrupting the currently executing Ant task.


Field Summary
private  boolean interrupted
           
 
Constructor Summary
NameBearerHandle.ExportApplicationAction.ExporterBuildListener()
           
 
Method Summary
 void buildFinished(org.apache.tools.ant.BuildEvent buildEvent)
           
 void buildStarted(org.apache.tools.ant.BuildEvent buildEvent)
           
 void execute()
          Starts the execution of this executable
 void interrupt()
          Notifies this executable that it should stop its execution as soon as possible.
 boolean isInterrupted()
          Returns true if this executable has been interrupted via the Executable.interrupt() method since the last time its Executable.execute() method was called
 void messageLogged(org.apache.tools.ant.BuildEvent buildEvent)
          This is called for every log message (of any priority).
 void targetFinished(org.apache.tools.ant.BuildEvent buildEvent)
           
 void targetStarted(org.apache.tools.ant.BuildEvent buildEvent)
           
 void taskFinished(org.apache.tools.ant.BuildEvent buildEvent)
          Set status message appropriately when task completes or fails.
 void taskStarted(org.apache.tools.ant.BuildEvent buildEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interrupted

private boolean interrupted
Constructor Detail

NameBearerHandle.ExportApplicationAction.ExporterBuildListener

NameBearerHandle.ExportApplicationAction.ExporterBuildListener()
Method Detail

isInterrupted

public boolean isInterrupted()
Description copied from interface: Executable
Returns true if this executable has been interrupted via the Executable.interrupt() method since the last time its Executable.execute() method was called

Specified by:
isInterrupted in interface Executable

interrupt

public void interrupt()
Description copied from interface: Executable
Notifies this executable that it should stop its execution as soon as possible.

Specified by:
interrupt in interface Executable

taskFinished

public void taskFinished(org.apache.tools.ant.BuildEvent buildEvent)
Set status message appropriately when task completes or fails.

Specified by:
taskFinished in interface org.apache.tools.ant.BuildListener

messageLogged

public void messageLogged(org.apache.tools.ant.BuildEvent buildEvent)
This is called for every log message (of any priority). If the current process has been interrupted (the user pressed the stop button) then we throw an exception to interrupt the currently executing Ant task. Other than that, we simply pass INFO and higher messages to the GATE status listener.

Specified by:
messageLogged in interface org.apache.tools.ant.BuildListener

buildStarted

public void buildStarted(org.apache.tools.ant.BuildEvent buildEvent)
Specified by:
buildStarted in interface org.apache.tools.ant.BuildListener

buildFinished

public void buildFinished(org.apache.tools.ant.BuildEvent buildEvent)
Specified by:
buildFinished in interface org.apache.tools.ant.BuildListener

targetStarted

public void targetStarted(org.apache.tools.ant.BuildEvent buildEvent)
Specified by:
targetStarted in interface org.apache.tools.ant.BuildListener

targetFinished

public void targetFinished(org.apache.tools.ant.BuildEvent buildEvent)
Specified by:
targetFinished in interface org.apache.tools.ant.BuildListener

taskStarted

public void taskStarted(org.apache.tools.ant.BuildEvent buildEvent)
Specified by:
taskStarted in interface org.apache.tools.ant.BuildListener

execute

public void execute()
Description copied from interface: Executable
Starts the execution of this executable

Specified by:
execute in interface Executable