Java Doc for AntLogger.java in  » IDE-Netbeans » library » org » apache » tools » ant » module » spi » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » library » org.apache.tools.ant.module.spi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tools.ant.module.spi.AntLogger

All known Subclasses:   org.apache.tools.ant.module.run.StandardLogger,
AntLogger
abstract public class AntLogger (Code)
A pluggable logger that can listen to AntEvent s during one or more AntSession s.

There can be several loggers active on a given session, so AntEvent.consume may be used to cooperate. Implementations may be registered to default org.openide.util.Lookup . Loggers are notified of events in the order of their registration in lookup.

A logger will always first be asked if it is interested in a given session; if it declines, it will receive no further events for that session. Otherwise it will normally receive AntLogger.buildStarted ; then some combination of target, task, and message logged events; then AntLogger.buildFinished . (Or it may receive just AntLogger.buildInitializationFailed .) A logger may not assume that target and task events are properly nested in any way, due to Ant's <parallel> task and other complexities such as <import> handling. Events may also be delivered from the originating script or any subscripts, again with no guaranteed nesting behavior. A logger may not assume that it will not receive any events after AntLogger.buildFinished .

Various mask methods permit loggers to declare themselves uninterested in some kinds of events. Such events will not be delivered to them. Loggers should declare themselves interested only in events they will actually use in some way, to permit the Ant engine to minimize the number of events delivered. Note that loggers which do not declare themselves interested in the given session will not receive AntLogger.buildStarted , AntLogger.buildFinished , or AntLogger.buildInitializationFailed at all, and loggers not additionally interested in all scripts will not receive AntLogger.buildInitializationFailed .

A logger should not keep any state as a rule; this would be a memory leak, and also a logger may be called from multiple threads with different sessions. Use AntSession.getCustomData and AntSession.putCustomData instead. Loggers may not make calls to the session, event, or task structure objects outside the dynamic scope of an event callback.

This is an abstract class so that new event types or masks may be added in the future. To prevent possible conflicts, implementors are forbidden to define other methods which take a single parameter of type AntEvent or which have a name beginning with the string interested.

The Ant module registers one logger at position 100 in META-INF/services lookup which may or may not handle any events which have not already been consumed (marking them consumed itself) and will typically process message logged events by printing them to the output somehow, using hyperlinks for common file error patterns such as /path/to/File.java:34: some message. It may also handle sequences of messages logged within a task in the format

 /path/to/File.java:34: you cannot throw a bogus exception here
          throw new Exception("bogus!");
                              ^

by linking to the column number indicated by the caret (^).


author:
   Jesse Glick
See Also:    Issue #42525
since:
   org.apache.tools.ant.module/3 3.12


Field Summary
final public static  String[]ALL_TARGETS
     Special constant indicating the logger is interested in receiving all target events.
final public static  String[]ALL_TASKS
     Special constant indicating the logger is interested in receiving all task events.
final public static  String[]NO_TARGETS
     Special constant indicating the logger is not interested in receiving any target events.
final public static  String[]NO_TASKS
     Special constant indicating the logger is not interested in receiving any task events.

Constructor Summary
protected  AntLogger()
     No-op constructor for implementors.

Method Summary
public  voidbuildFinished(AntEvent event)
     Fired once when a build is finished.
public  voidbuildInitializationFailed(AntEvent event)
     Fired only if the build could not even be started.
public  voidbuildStarted(AntEvent event)
     Fired once when a build is started.
public  booleaninterestedInAllScripts(AntSession session)
     Mark whether this logger is interested in any Ant script.
public  int[]interestedInLogLevels(AntSession session)
     Mark which kinds of message log events this logger is interested in.
public  booleaninterestedInScript(File script, AntSession session)
     Mark whether this logger is interested in a given Ant script.
public  booleaninterestedInSession(AntSession session)
     Mark whether this logger is interested in a given Ant session.
public  String[]interestedInTargets(AntSession session)
     Mark which kinds of targets this logger is interested in.
public  String[]interestedInTasks(AntSession session)
     Mark which kinds of tasks this logger is interested in.
public  voidmessageLogged(AntEvent event)
     Fired when a message is logged.
public  voidtargetFinished(AntEvent event)
     Fired when a target is finished.
public  voidtargetStarted(AntEvent event)
     Fired when a target is started.
public  voidtaskFinished(AntEvent event)
     Fired when a task is finished.
public  voidtaskStarted(AntEvent event)
     Fired when a task is started.

Field Detail
ALL_TARGETS
final public static String[] ALL_TARGETS(Code)
Special constant indicating the logger is interested in receiving all target events.
See Also:   AntLogger.interestedInTargets



ALL_TASKS
final public static String[] ALL_TASKS(Code)
Special constant indicating the logger is interested in receiving all task events.
See Also:   AntLogger.interestedInTasks



NO_TARGETS
final public static String[] NO_TARGETS(Code)
Special constant indicating the logger is not interested in receiving any target events.
See Also:   AntLogger.interestedInTargets



NO_TASKS
final public static String[] NO_TASKS(Code)
Special constant indicating the logger is not interested in receiving any task events.
See Also:   AntLogger.interestedInTasks




Constructor Detail
AntLogger
protected AntLogger()(Code)
No-op constructor for implementors.




Method Detail
buildFinished
public void buildFinished(AntEvent event)(Code)
Fired once when a build is finished. The default implementation does nothing.
Parameters:
  event - the associated event object
See Also:   AntEvent.getException



buildInitializationFailed
public void buildInitializationFailed(AntEvent event)(Code)
Fired only if the build could not even be started. AntEvent.getException will be non-null. The default implementation does nothing.
Parameters:
  event - the associated event object



buildStarted
public void buildStarted(AntEvent event)(Code)
Fired once when a build is started. The default implementation does nothing.
Parameters:
  event - the associated event object



interestedInAllScripts
public boolean interestedInAllScripts(AntSession session)(Code)
Mark whether this logger is interested in any Ant script. If true, no events will be masked due to the script location. Note that a few events have no defined script and so will only be delivered to loggers interested in all scripts; typically this applies to debugging messages when a project is just being configured.
Parameters:
  session - the relevant session true to receive events for all scripts; by default, false



interestedInLogLevels
public int[] interestedInLogLevels(AntSession session)(Code)
Mark which kinds of message log events this logger is interested in. This applies only to message log events and no others. Only events with log levels included in the returned list will be delivered.
Parameters:
  session - the relevant session a list of levels such as AntEvent.LOG_INFO; by default, an empty list
See Also:   AntSession.getVerbosity



interestedInScript
public boolean interestedInScript(File script, AntSession session)(Code)
Mark whether this logger is interested in a given Ant script. Called only if AntLogger.interestedInAllScripts is false. Only events with a defined script according to AntEvent.getScriptLocation which this logger is interested in will be delivered. Note that a few events have no defined script and so will only be delivered to loggers interested in all scripts; typically this applies to debugging messages when a project is just being configured. Note also that a single session can involve many different scripts.
Parameters:
  script - a particular build script
Parameters:
  session - the relevant session true to receive events sent from this script; by default, false



interestedInSession
public boolean interestedInSession(AntSession session)(Code)
Mark whether this logger is interested in a given Ant session.
Parameters:
  session - a session which is about to be start true to receive events about it; by default, false



interestedInTargets
public String[] interestedInTargets(AntSession session)(Code)
Mark which kinds of targets this logger is interested in. This applies to both target start and finish events, as well as any other events for which AntEvent.getTargetName is not null, such as task start and finish events, and message log events. If AntLogger.NO_TARGETS , no events with specific targets will be sent to it. If a specific list, only events with defined target names included in the list will be sent to it. If AntLogger.ALL_TARGETS , all events not otherwise excluded will be sent to it.
Parameters:
  session - the relevant session a nonempty (and non-null) list of target names; by default, AntLogger.NO_TARGETS



interestedInTasks
public String[] interestedInTasks(AntSession session)(Code)
Mark which kinds of tasks this logger is interested in. This applies to both task start and finish events, as well as any other events for which AntEvent.getTaskName is not null, such as message log events. If AntLogger.NO_TASKS , no events with specific tasks will be sent to it. If a specific list, only events with defined task names included in the list will be sent to it. If AntLogger.ALL_TASKS , all events not otherwise excluded will be sent to it.
Parameters:
  session - the relevant session a nonempty (and non-null) list of task names; by default, AntLogger.NO_TASKS



messageLogged
public void messageLogged(AntEvent event)(Code)
Fired when a message is logged. The task and target fields may or may not be defined. The default implementation does nothing.
Parameters:
  event - the associated event object



targetFinished
public void targetFinished(AntEvent event)(Code)
Fired when a target is finished. It is not guaranteed that AntEvent.getTargetName will be non-null. The default implementation does nothing.
Parameters:
  event - the associated event object



targetStarted
public void targetStarted(AntEvent event)(Code)
Fired when a target is started. It is not guaranteed that AntEvent.getTargetName will be non-null (as can happen in some circumstances with <import>, for example). The default implementation does nothing.
Parameters:
  event - the associated event object



taskFinished
public void taskFinished(AntEvent event)(Code)
Fired when a task is finished. It is not guaranteed that AntEvent.getTaskName or AntEvent.getTaskStructure will be non-null. AntEvent.getTargetName might also be null. The default implementation does nothing.
Parameters:
  event - the associated event object



taskStarted
public void taskStarted(AntEvent event)(Code)
Fired when a task is started. It is not guaranteed that AntEvent.getTaskName or AntEvent.getTaskStructure will be non-null, though they will usually be defined. AntEvent.getTargetName might also be null. The default implementation does nothing.
Parameters:
  event - the associated event object



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.