Next is the class loader cache initialization.
下一步是类装载器缓存初始化。
The garbage collector interacts closely with the class loader.
垃圾收集器与类装入器的交互很密切。
Each class has a reference to the class loader that defined it.
每个类都有一个对其类装载器的引用。
The jboss-app.xml file specifies the class loader for this application.
jboss-app.xml文档为该应用指定了类加载器,每个EAR应用的类加载器应该有一个唯一的名称。
Another exception that can be thrown by the class loader is ClassCastException.
类装入器能够抛出的另一个异常是ClassCastException。
The parent of this class loader will be the class loader of the current thread context.
类加载器的父类加载器将是当前线程上下文的类加载器。
The class loader has a fairly tight security manager in place that restricts malicious calls.
类加载器有一个十分严格的安全管理器来限制恶意调用。
But how can that work if the class loader looks for existing class files for each class it loads?
但是,如果类装入器为它所装入的每个类查找现有类文件,那么它会如何工作呢?
When the class loader is dereferenced, the classes that it loaded are not garbage collectable.
当取消对类装入器的引用时,它装入的类就变成无法进行垃圾收集的了。
The class loader plays an important role in linking a native call to its appropriate native definition.
在把本机调用链接到对应的本机定义时,类装入器扮演着重要角色。
If either of the above rules are violated, then a ClassCastException is thrown by the class loader.
如果违反了以上任何一条规则,那么类装入器就会抛出ClassCastException。
The class loader delegation model is the graph of class loaders that pass loading requests to each other.
类装入器委托模型是把装入请求相互传给对方的类装入器图。
When a native method is invoked, the class loader attempts to load the native library that defines that method.
当调用本机方法时,类装入器会尝试装入定义了该方法的本机库。
The data files must be located in the mock Customer project so that they can be picked up from the class loader.
数据文件必须位于模拟Customer项目中,以便可以从类加载器中加载它们。
When one of these methods is invoked, the class whose name is specified as an argument is loaded by the class loader.
当调用其中一个方法的时候,指定的类(以类名为参数)由类装入器装入。
If the class hasn't been loaded yet, the class loader will load it now and return the newly constructed class instance.
如果类未被装入,类装入器将现在装入并返回新创建的类实例。
The class loader does a number of checks on the bytecodes of the class to ensure that it is well formed and well behaved.
类装入器对于类的字节码要做许多检测,以确保格式正确、行为正确。
These methods let the framework set the class loader to be used for each application while running code from that application.
这些方法允许该框架设置类装入器,使得在运行每个应用程序中的代码时可以将类装入器用于该应用程序。
For example, the selected class loader in Figure 5 now shows that it is the class loader for the PlantsByWebSphere Web application.
例如,图5中选中的类加载器显示它是PlantsByWebSphereweb应用程序的类加载器。
The Classloader summaries section provides details about each class loader in the system, including the type of the class loader.
Classloader汇总部分提供了系统中每个类装入器的细节。
As an example of a class loader hierarchy in action, Figure 1 shows the class loader hierarchy defined by the Tomcat servlet engine.
作为类装入器层次结构的实际示例,图1显示了Tomcatservlet引擎定义的类装入器层次结构。
If the class loader tries to find a nonexistent resource, all the JAR files within the application or applet will have to be downloaded.
如果类装载器试图寻找一个不存在的资源,那么在应用程序或者applet中的所有JAR文件都会下载。
If the parent returns null (or throws a ClassNotFoundException), then the class loader searches its own path for the source of the class.
如果父类返回null(或抛出ClassNotFoundException),那么类装入器会在自己的路径中寻找类的源。
Before you begin this article, you should be familiar with the class loader delegation model, along with the phases and stages of class linking.
在开始这篇文章之前,应当熟悉类装入委托模型,以及类链接的阶段和过程。
Because the parent class loader is always given the opportunity to load a class first, the class is loaded by the class loader nearest the root.
因为父类类装入器总是先得到装入类的机会,所以类装入器装入的类最靠近根。
public void setDefaultAssertionStatus(boolean enabled): This method sets the default status for packages and classes loaded by the class loader.
publicvoidsetDefaultAssertionStatus(booleanenabled) :该方法设置由类装入器装入的包和类的缺省状态。
Given an object being tested (such as item in Listing 5) and a target class (Integer) being cast to, the class loader checks the following rules.
当检查对象(例如清单5中的item)并把类型转换成目标类(Integer)时,类装入器会检查以下规则。
Each EAR application should have a unique string name for the class loader. Here, we use the application name in the class loader name to avoid repetition.
这里我们使用应用程序名作为类加载器的名称,以避免重复。
Among other things, the collector examines the class loader data structures to determine which classes are live — that is, are not garbage collectable.
在众多的事情当中,收集器检查类装入器的数据结构,来判断哪个类是活动的——也就是说,不应当被当作垃圾收集的。
public void clearAssertionStatus(): This method resets all package and class settings to false, and then resets the class loader to setting false also.
publicvoid clearAssertionStatus() :该方法将所有包和类的设置重设为false,然后将类装入器也重设为 false。
应用推荐