Java Doc for IsReachable.java in  » Build » ANT » org » apache » tools » ant » taskdefs » condition » 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 » Build » ANT » org.apache.tools.ant.taskdefs.condition 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.taskdefs.condition.IsReachable

IsReachable
public class IsReachable extends ProjectComponent implements Condition(Code)
Test for a host being reachable using ICMP "ping" packets & echo operations. Ping packets are very reliable for assessing reachability in a LAN or WAN, but they do not get through any well-configured firewall. Echo (port 7) may.

This condition turns unknown host exceptions into false conditions. This is because on a laptop, DNS is one of the first services lost when the network goes; you are implicitly offline.

If a URL is supplied instead of a host, the hostname is extracted and used in the test--all other parts of the URL are discarded.

The test may not work through firewalls; that is, something may be reachable using a protocol such as HTTP, while the lower level ICMP packets get dropped on the floor. Similarly, a host may be detected as reachable with ICMP, but not reachable on other ports (i.e. port 80), because of firewalls.

Requires Java1.5+ to work properly. On Java1.4 and earlier, if a hostname can be resolved, the destination is assumed to be reachable.
since:
   Ant 1.7



Field Summary
final public static  intDEFAULT_TIMEOUT
     The default timeout.
final public static  StringERROR_BAD_TIMEOUT
    
final public static  StringERROR_BAD_URL
     Error message when an invalid url is used.
final public static  StringERROR_BOTH_TARGETS
     Error message when url and host are specified.
final public static  StringERROR_NO_HOSTNAME
    
final public static  StringERROR_NO_HOST_IN_URL
     Error message when no hostname in url.
final public static  StringERROR_ON_NETWORK
     Network error message is seen.
final public static  StringMETHOD_NAME
    
final public static  StringMSG_NO_REACHABLE_TEST
     Error message when no reachably test avail.


Method Summary
public  booleaneval()
     Evaluate the condition.
public  voidsetHost(String host)
     Set the host to ping.
public  voidsetTimeout(int timeout)
     Set the timeout for the reachability test in seconds.
public  voidsetUrl(String url)
     Set the URL from which to extract the hostname.

Field Detail
DEFAULT_TIMEOUT
final public static int DEFAULT_TIMEOUT(Code)
The default timeout.



ERROR_BAD_TIMEOUT
final public static String ERROR_BAD_TIMEOUT(Code)
Error when invalid timeout value is defined



ERROR_BAD_URL
final public static String ERROR_BAD_URL(Code)
Error message when an invalid url is used.



ERROR_BOTH_TARGETS
final public static String ERROR_BOTH_TARGETS(Code)
Error message when url and host are specified.



ERROR_NO_HOSTNAME
final public static String ERROR_NO_HOSTNAME(Code)
Error when no hostname is defined



ERROR_NO_HOST_IN_URL
final public static String ERROR_NO_HOST_IN_URL(Code)
Error message when no hostname in url.



ERROR_ON_NETWORK
final public static String ERROR_ON_NETWORK(Code)
Network error message is seen.



METHOD_NAME
final public static String METHOD_NAME(Code)
The method name to look for in InetAddress



MSG_NO_REACHABLE_TEST
final public static String MSG_NO_REACHABLE_TEST(Code)
Error message when no reachably test avail.





Method Detail
eval
public boolean eval() throws BuildException(Code)
Evaluate the condition. true if the condition is true.
throws:
  org.apache.tools.ant.BuildException - if an error occurs



setHost
public void setHost(String host)(Code)
Set the host to ping.
Parameters:
  host - the host to ping.



setTimeout
public void setTimeout(int timeout)(Code)
Set the timeout for the reachability test in seconds.
Parameters:
  timeout - the timeout in seconds.



setUrl
public void setUrl(String url)(Code)
Set the URL from which to extract the hostname.
Parameters:
  url - a URL object.



Fields inherited from org.apache.tools.ant.ProjectComponent
protected String description(Code)(Java Doc)
protected Location location(Code)(Java Doc)
protected Project project(Code)(Java Doc)

Methods inherited from org.apache.tools.ant.ProjectComponent
public Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public Location getLocation()(Code)(Java Doc)
public Project getProject()(Code)(Java Doc)
public void log(String msg)(Code)(Java Doc)
public void log(String msg, int msgLevel)(Code)(Java Doc)
public void setDescription(String desc)(Code)(Java Doc)
public void setLocation(Location location)(Code)(Java Doc)
public void setProject(Project project)(Code)(Java Doc)

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.