tailieunhanh - Beginning Java SE 6 Platform From Novice to Professional phần 6

NullPointerException là ném nếu basename là null. Trả về một có getFormats () phương thức trả về các định dạng quy định, và có getFallBackLocale () phương thức trả về null. NullPointerException được ném nếu danh sách các định dạng là | 232 CHAPTER 7 MONITORING AND MANAGEMENT for String option options option The source code introduces public static void agentmain String agentArgs Instrumentation inst as the entry point into the agent. According to the JDK 6 documentation for the package introduced by Java 5 it is likely that an application will be running and its public static void main String args method will have been invoked before the virtual machine invokes agentmain . Note According to the JDK documentation the target virtual machine will attempt to locate and invoke a public static void agentmain String agentArgs method if it cannot locate public static void agentmain String agentArgs Instrumentation inst . If it cannot find this fallback method the target virtual machine and its application will keep running without the agent running in the background. The target virtual machine application will also keep running if either agentmain method throws an exception the uncaught exception is ignored. The agentmain method specifies a String parameter that identifies any arguments passed to this method. These arguments originate from the arguments string passed to options in loadAgent String agent String options described in Table 7-2 . Because the arguments are combined into a single string the agent is responsible for parsing them. BasicAgent refers to these arguments as options. After compiling the agent s source code javac the resulting class file must be stored in a JAR file. As stated in the JDK documentation this JAR file s manifest must contain an Agent-Class attribute that identifies the class containing an agentmain method. Listing 7-4 presents a suitable manifest file with the Agent-Class attribute for the agent s JAR file. Listing 7-4. Agent-Class BasicAgent After creating a file via jar cvfm or a similar command you are almost ready to use the Attach API to .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.