Most, if not all, problems relating to class loading can be tracked down to a problem occurring in one of these phases.
虽然不是所有的问题,但至少大多数与类装入有关的问题都可以追溯到在这三个阶段中发生的某个问题。
The first section of this introductory article describes the fundamentals of class loading; the second introduces some JVM debugging features.
这份介绍性的文章的第一节描述类装入的基础;第二节介绍一些JVM调试特性。
This article, the second in a series of four, looks at the various class loading exceptions typically thrown when running applications.
本文是系列中四篇文章的第二篇,它考察了一般在运行应用程序时抛出的各种类装入异常。
Many developers find constraint violations to be a difficult type of class loading problem to resolve.
许多开发人员发现约束违反是一种很难解决的类装入问题。
This section describes the core concepts of class loading to provide a knowledge base for the rest of this series.
这一节描述类装入的核心概念,为系列剩下的部分提供知识基础。
Once you understand the class loaders involved in the loading of the library, you can resolve these types of problems by placing the library in an appropriate location.
一旦理解了库装入过程所涉及的类装入器,就可以通过把库放在合适位置来解决这类问题。
This exception is thrown during the verification stage of the linking phase of class loading.
这个异常是在类装入的链接阶段的校验过程中抛出。
Note that class loading can be performed in a lazy manner and therefore some parts of the class loading process may be done on first use of the class rather than at load time.
请注意可以用惰性方式执行类装入,所以类装入过程的某些部分可能在第一次使用类的时候才执行,而不是在装入时执行。
Due to some peculiarities of class loading, the requirement is even stronger.
由于类加载的一些独特特性,因此这个需求变得更加强烈。
In this series of articles, we'll provide an in-depth look at class loading problems and use comprehensive examples to illustrate them.
在这个系列的文章中,我们将深入研究类装入的问题,并用丰富的示例演示它们。
The loading phase consists of locating the required class file (by searching though the respective classpaths) and loading in the bytecode.
装入阶段包括:找到必要的类(通过查找每个类路径)并装入字节码。
In this article, you learned the fundamentals of class loading in JVMs and the debugging features available in the IBM JVM.
在这篇文章中,学习了JVM中类装入的基础知识和IBM JVM中可以使用的调试特性。
Implicit class loading occurs when a class is loaded as result of a reference, instantiation, or inheritance (not via an explicit method call).
隐式类装入发生在由于引用、实例化或继承导致装入类的时候(不是通过显式方法调用)。
The class loader delegation model is the graph of class loaders that pass loading requests to each other.
类装入器委托模型是把装入请求相互传给对方的类装入器图。
We hope that the insights provided by these articles will enable you to better understand class loading and to make better use of class loaders in your applications.
我们希望这些文章提供的知识能够让您更好地理解类装入,并在应用程序中更好地利用类装入器。
The loading of a class can essentially be broken down into three phases: loading, linking, and initializing.
类的装入实际上可以分成三个阶段:装入、链接和初始化。
Classes are often loaded through a combination of explicit and implicit class loading.
类的装入通常组合了显式和隐式类装入。
If you want to avoid such problems, you need to understand the fundamental mechanics of class loading.
如果想避免这类问题,需要理解类装入的基本机制。
No matter what kind of class loader you're using, however, there are many problems that can occur in the class loading process.
但是,不论使用哪种类装入器,在类装入过程中都可能发生许多问题。
In each of these cases, the loading is initiated under the covers and the JVM resolves the necessary references and loads the class.
在每种情况下,装入都是在幕后启动的,jvm会解析必要的引用并装入类。
You can use dynamic class loading techniques to ensure the correct set of beans is loaded.
可以使用动态类加载技术确保加载正确的bean集合。
Therefore, a thorough understanding of each phase helps in the diagnosing of class loading problems. The phases are illustrated in Figure 2.
所以,对于每一阶段的深入理解有助于对类装入问题的诊断。
A good example of this class loading structure is an OSGi framework, such as the one Eclipse is built on.
这种类装入结构的示例就是OSGi框架,例如eclipse构建于其上的框架。
The Sca framework provides an ScaTestExecutor utility class that manages the loading of test data and executes the corresponding test. The code for test methods, then, becomes very simple.
Sca框架提供了管理测试数据加载的ScaTestExecutor实用工具类,它可以执行相应的测试。
Using classloader hooks, you can intercept the process of loading classes into the JVM and transform the class representations before they're actually loaded.
通过使用classloader挂钩(hook),您可以拦截将类加载到JVM中的过程,并在实际加载这些类之前转换它们。
The DirectLoader class (at the end of Listing 6) just provides an easy way of loading the generated classes.
directloader类(在清单6的结尾)只提供了装载生成的类的一种容易的方式。
Every class loader has a parent class loader, which delegates the searching and loading of a class to its parent (parent-first delegation) before it attempts to load the class itself.
每个类加载器有一个父类加载器,在尝试加载类本身时,先将类搜索和类加载委托给它的父加载器,即父加载器优先(parent-first)委托。
If the class that implements the CustomService interface also claims to implement the JMXManageable interface, then much of the loading and activating of your MBean will be automatic.
如果实现CustomService接口的类还声明实现JMXManageable接口,那么MBean的装入和激活在很大程度上将是自动的。
The beauty of using JUnit is that the framework takes care of loading the test class, running the test, and reporting the results.
使用JUnit的美妙之处在于,该框架负责装入测试类、运行测试以及报告结果。
The SecureClassLoader starts by loading the bytes of the class from the appropriate URL and verifying the digital signature of the enclosing archive file, if required.
SecureClassLoader 首先从相应URL 处装载字节,如果需要还会验证包围文档文件的数字签名。
应用推荐