Java Doc for GlobalPathRegistry.java in  » IDE-Netbeans » gsf » org » netbeans » modules » gsfpath » api » classpath » 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 » gsf » org.netbeans.modules.gsfpath.api.classpath 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.gsfpath.api.classpath.GlobalPathRegistry

GlobalPathRegistry
final public class GlobalPathRegistry (Code)
Maintains a global registry of "interesting" classpaths of various kinds. You may add and remove different kinds of ClassPath s to the registry and listen to changes in them.

It is permitted to register the same classpath more than once; unregistration keeps track of the number of registrations so that the operation is symmetric. However GlobalPathRegistry.getPaths only ever returns one copy of the classpath, and listeners are only notified the first time a given classpath is added to the registry, or the last time it is removed. (Classpath identity is object identity, so there could be multiple paths returned that at the time share the same list of roots. There may also be several paths which contain some shared roots.)

The registry is not persisted between JVM sessions.

Intended usage patterns:

  1. When a project is opened using org.netbeans.spi.project.ui.ProjectOpenedHook it should add any paths it defines, i.e. paths it might return from a org.netbeans.modules.gsfpath.spi.classpath.ClassPathProvider . When closed it should remove them.

  2. The Fast Open feature of the editor and other features which require a global list of relevant sources should use GlobalPathRegistry.getSourceRoots or the equivalent.

  3. The Javadoc Index Search feature and View → Documentation Indices submenu should operate on open Javadoc paths, meaning that Javadoc corresponding to registered compile and boot classpaths (according to org.netbeans.modules.gsfpath.api.queries.JavadocForBinaryQuery ).

  4. Stack trace hyperlinking can use the global list of source paths to find sources, in case no more specific information about their origin is available. The same would be true of debugging: if the debugger cannot find Java-like sources using more precise means ( SourceForBinaryQuery ), it can use GlobalPathRegistry.findResource as a fallback.


author:
   Jesse Glick
since:
   org.netbeans.modules.gsfpath.api/1 1.4




Method Summary
public synchronized  voidaddGlobalPathRegistryListener(GlobalPathRegistryListener l)
     Add a listener to the registry.
 voidclear()
    
public  FileObjectfindResource(String resource)
     Convenience method to find a particular source file by resource path. This simply uses GlobalPathRegistry.getSourceRoots to find possible roots and looks up the resource among them. In case more than one source root contains the resource, one is chosen arbitrarily. As with ClassPath.findResource , include/exclude lists can affect the result.
Parameters:
  resource - a resource path, e.g.
public static  GlobalPathRegistrygetDefault()
     Get the singleton instance of the registry.
public synchronized  Set<ClassPath>getPaths(String id)
     Find all paths of a certain type.
Parameters:
  id - a classpath type, e.g.
public  Set<FileObject>getSourceRoots()
     Convenience method to find all relevant source roots. This consists of:
  1. Roots of all registered ClassPath.SOURCE paths.
  2. Sources (according to SourceForBinaryQuery ) of all registered ClassPath.COMPILE paths.
  3. Sources of all registered ClassPath.BOOT paths.
Order is not significant.

Currently there is no reliable way to listen for changes in the value of this method: while you can listen to changes in the paths mentioned, it is possible for SourceForBinaryQuery results to change.

public  voidregister(String id, ClassPath[] paths)
     Register some classpaths of a certain type.
Parameters:
  id - a classpath type, e.g.
public synchronized  voidremoveGlobalPathRegistryListener(GlobalPathRegistryListener l)
     Remove a listener to the registry.
public  voidunregister(String id, ClassPath[] paths)
     Unregister some classpaths of a certain type.
Parameters:
  id - a classpath type, e.g.



Method Detail
addGlobalPathRegistryListener
public synchronized void addGlobalPathRegistryListener(GlobalPathRegistryListener l)(Code)
Add a listener to the registry.
Parameters:
  l - a listener to add



clear
void clear()(Code)
for use from unit test



findResource
public FileObject findResource(String resource)(Code)
Convenience method to find a particular source file by resource path. This simply uses GlobalPathRegistry.getSourceRoots to find possible roots and looks up the resource among them. In case more than one source root contains the resource, one is chosen arbitrarily. As with ClassPath.findResource , include/exclude lists can affect the result.
Parameters:
  resource - a resource path, e.g. somepkg/Foo.java some file found with that path, or null



getDefault
public static GlobalPathRegistry getDefault()(Code)
Get the singleton instance of the registry. the default instance



getPaths
public synchronized Set<ClassPath> getPaths(String id)(Code)
Find all paths of a certain type.
Parameters:
  id - a classpath type, e.g. ClassPath.SOURCE an immutable set of all registered ClassPaths of that type (may be empty but not null)



getSourceRoots
public Set<FileObject> getSourceRoots()(Code)
Convenience method to find all relevant source roots. This consists of:
  1. Roots of all registered ClassPath.SOURCE paths.
  2. Sources (according to SourceForBinaryQuery ) of all registered ClassPath.COMPILE paths.
  3. Sources of all registered ClassPath.BOOT paths.
Order is not significant.

Currently there is no reliable way to listen for changes in the value of this method: while you can listen to changes in the paths mentioned, it is possible for SourceForBinaryQuery results to change. In the future a change listener might be added for the value of the source roots.

Note that this method takes no account of package includes/excludes.

an immutable set of FileObject source roots



register
public void register(String id, ClassPath[] paths)(Code)
Register some classpaths of a certain type.
Parameters:
  id - a classpath type, e.g. ClassPath.SOURCE
Parameters:
  paths - a list of classpaths to add to the registry



removeGlobalPathRegistryListener
public synchronized void removeGlobalPathRegistryListener(GlobalPathRegistryListener l)(Code)
Remove a listener to the registry.
Parameters:
  l - a listener to remove



unregister
public void unregister(String id, ClassPath[] paths) throws IllegalArgumentException(Code)
Unregister some classpaths of a certain type.
Parameters:
  id - a classpath type, e.g. ClassPath.SOURCE
Parameters:
  paths - a list of classpaths to remove from the registry
throws:
  IllegalArgumentException - if they had not been registered before



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.