Java Doc for AttachProvider.java in  » 6.0-JDK-Modules-com.sun » tools » com » sun » tools » attach » 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 » 6.0 JDK Modules com.sun » tools » com.sun.tools.attach.spi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.tools.attach.spi.AttachProvider

AttachProvider
abstract public class AttachProvider (Code)
Attach provider class for attaching to a Java virtual machine.

An attach provider is a concrete subclass of this class that has a zero-argument constructor and implements the abstract methods specified below.

An attach provider implementation is typically tied to a Java virtual machine implementation, version, or even mode of operation. That is, a specific provider implementation will typically only be capable of attaching to a specific Java virtual machine implementation or version. For example, Sun's JDK implementation ships with provider implementations that can only attach to Sun's HotSpot virtual machine. In general, if an environment consists of Java virtual machines of different versions and from different vendors then there will be an attach provider implementation for each family of implementations or versions.

An attach provider is identified by its AttachProvider.name name and AttachProvider.type type . The name is typically, but not required to be, a name that corresponds to the VM vendor. The Sun JDK implementation, for example, ships with attach providers that use the name "sun". The type typically corresponds to the attach mechanism. For example, an implementation that uses the Doors inter-process communication mechanism might use the type "doors". The purpose of the name and type is to identify providers in environments where there are multiple providers installed.

AttachProvider implementations are loaded and instantiated at the first invocation of the AttachProvider.providers() providers method. This method attempts to load all provider implementations that are installed on the platform.

All of the methods in this class are safe for use by multiple concurrent threads.


since:
   1.6



Constructor Summary
protected  AttachProvider()
     Initializes a new instance of this class.

Method Summary
abstract public  VirtualMachineattachVirtualMachine(String id)
     Attaches to a Java virtual machine.

A Java virtual machine is identified by an abstract identifier.

public  VirtualMachineattachVirtualMachine(VirtualMachineDescriptor vmd)
     Attaches to a Java virtual machine.

A Java virtual machine can be described using a com.sun.tools.attach.VirtualMachineDescriptor VirtualMachineDescriptor . This method invokes the descriptor's com.sun.tools.attach.VirtualMachineDescriptor.provider provider() method to check that it is equal to this provider.

abstract public  List<VirtualMachineDescriptor>listVirtualMachines()
     Lists the Java virtual machines known to this provider.

This method returns a list of com.sun.tools.attach.VirtualMachineDescriptor elements.

abstract public  Stringname()
     Return this provider's name.
public static  List<AttachProvider>providers()
     Returns a list of the installed attach providers.

An AttachProvider is installed on the platform if:

  • It is installed in a JAR file that is visible to the defining class loader of the AttachProvider type (usually, but not required to be, the java.lang.ClassLoader.getSystemClassLoader systemclass loader ).

  • The JAR file contains a provider configuration named com.sun.tools.attach.spi.AttachProvider in the resource directory META-INF/services.

abstract public  Stringtype()
     Return this provider's type.


Constructor Detail
AttachProvider
protected AttachProvider()(Code)
Initializes a new instance of this class.


throws:
  SecurityException - If a security manager has been installed and it deniescom.sun.tools.attach.AttachPermission AttachPermission("createAttachProvider")




Method Detail
attachVirtualMachine
abstract public VirtualMachine attachVirtualMachine(String id) throws AttachNotSupportedException, IOException(Code)
Attaches to a Java virtual machine.

A Java virtual machine is identified by an abstract identifier. The nature of this identifier is platform dependent but in many cases it will be the string representation of the process identifier (or pid).

This method parses the identifier and maps the identifier to a Java virtual machine (in an implementation dependent manner). If the identifier cannot be parsed by the provider then an com.sun.tools.attach.AttachNotSupportedException AttachNotSupportedException is thrown. Once parsed this method attempts to attach to the Java virtual machine. If the provider detects that the identifier corresponds to a Java virtual machine that does not exist, or it corresponds to a Java virtual machine that does not support the attach mechanism implemented by this provider, or it detects that the Java virtual machine is a version to which this provider cannot attach, then an AttachNotSupportedException is thrown.


Parameters:
  id - The abstract identifier that identifies the Java virtual machine. VirtualMachine representing the target virtual machine.
throws:
  SecurityException - If a security manager has been installed and it deniescom.sun.tools.attach.AttachPermission AttachPermission("attachVirtualMachine"), or other permissionrequired by the implementation.
throws:
  AttachNotSupportedException - If the identifier cannot be parsed, or it corresponds toto a Java virtual machine that does not exist, or itcorresponds to a Java virtual machine which this provider cannot attach.
throws:
  IOException - If some other I/O error occurs
throws:
  NullPointerException - If id is null



attachVirtualMachine
public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd) throws AttachNotSupportedException, IOException(Code)
Attaches to a Java virtual machine.

A Java virtual machine can be described using a com.sun.tools.attach.VirtualMachineDescriptor VirtualMachineDescriptor . This method invokes the descriptor's com.sun.tools.attach.VirtualMachineDescriptor.provider provider() method to check that it is equal to this provider. It then attempts to attach to the Java virtual machine.
Parameters:
  vmd - The virtual machine descriptor VirtualMachine representing the target virtual machine.
throws:
  SecurityException - If a security manager has been installed and it deniescom.sun.tools.attach.AttachPermission AttachPermission("attachVirtualMachine"), or other permissionrequired by the implementation.
throws:
  AttachNotSupportedException - If the descriptor's com.sun.tools.attach.VirtualMachineDescriptor.provider provider() methodreturns a provider that is not this provider, or it does not correspond to a Java virtual machine to which this provider can attach.
throws:
  IOException - If some other I/O error occurs
throws:
  NullPointerException - If vmd is null




listVirtualMachines
abstract public List<VirtualMachineDescriptor> listVirtualMachines()(Code)
Lists the Java virtual machines known to this provider.

This method returns a list of com.sun.tools.attach.VirtualMachineDescriptor elements. Each VirtualMachineDescriptor describes a Java virtual machine to which this provider can potentially attach. There isn't any guarantee that invoking AttachProvider.attachVirtualMachine(VirtualMachineDescriptor)attachVirtualMachine on each descriptor in the list will succeed. The list of virtual machine descriptors which describe theJava virtual machines known to this provider (may be empty).




name
abstract public String name()(Code)
Return this provider's name.

The name of this provider



providers
public static List<AttachProvider> providers()(Code)
Returns a list of the installed attach providers.

An AttachProvider is installed on the platform if:

  • It is installed in a JAR file that is visible to the defining class loader of the AttachProvider type (usually, but not required to be, the java.lang.ClassLoader.getSystemClassLoader systemclass loader ).

  • The JAR file contains a provider configuration named com.sun.tools.attach.spi.AttachProvider in the resource directory META-INF/services.

  • The provider configuration file lists the full-qualified class name of the AttachProvider implementation.

The format of the provider configuration file is one fully-qualified class name per line. Space and tab characters surrounding each class name, as well as blank lines are ignored. The comment character is '#' (0x23), and on each line all characters following the first comment character are ignored. The file must be encoded in UTF-8.

AttachProvider implementations are loaded and instantiated (using the zero-arg constructor) at the first invocation of this method. The list returned by the first invocation of this method is the list of providers. Subsequent invocations of this method return a list of the same providers. The list is unmodifable.

A list of the installed attach providers.



type
abstract public String type()(Code)
Return this provider's type.

The type of this provider



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.