http://docs.spring.io/spring-amqp/docs/1.3.6.RELEASE/reference/html/sample-apps.html#d4e1285

http://docs.spring.io/spring-amqp/reference/html/index.html

http://docs.spring.io/spring-amqp/docs/1.4.0.M1/api/

原文:http://docs.oracle.com/javase/tutorial/ext/basics/load.html

The extension framework makes use of the class-loading delegation mechanism. When the runtime environment needs to load a new class for an application, it looks for the class in the following locations, in order:

  1. Bootstrap classes: the runtime classes in rt.jar, internationalization classes in i18n.jar, and others.
  2. Installed extensions: classes in JAR files in the lib/ext directory of the JRE, and in the system-wide, platform-specific extension directory (such as /usr/jdk/packages/lib/ext on the Solaris™ Operating System, but note that use of this directory applies only to Java™ 6 and later).
  3. The class path: classes, including classes in JAR files, on paths specified by the system property java.class.path. If a JAR file on the class path has a manifest with the Class-Path attribute, JAR files specified by the Class-Path attribute will be searched also. By default, the java.class.path property's value is ., the current directory. You can change the value by using the -classpath or -cp command-line options, or setting the CLASSPATH environment variable. The command-line options override the setting of the CLASSPATHenvironment variable.

The precedence list tells you, for example, that the class path is searched only if a class to be loaded hasn't been found among the classes in rt.jari18n.jar or the installed extensions.

Unless your software instantiates its own class loaders for special purposes, you don't really need to know much more than to keep this precedence list in mind. In particular, you should be aware of any class name conflicts that might be present. For example, if you list a class on the class path, you'll get unexpected results if the runtime environment instead loads another class of the same name that it found in an installed extension.

The Java Class Loading Mechanism

The Java platform uses a delegation model for loading classes. The basic idea is that every class loader has a "parent" class loader. When loading a class, a class loader first "delegates" the search for the class to its parent class loader before attempting to find the class itself.

Here are some highlights of the class-loading API:

  • Constructors in java.lang.ClassLoader and its subclasses allow you to specify a parent when you instantiate a new class loader. If you don't explicitly specify a parent, the virtual machine's system class loader will be assigned as the default parent.
  • The loadClass method in ClassLoader performs these tasks, in order, when called to load a class:
    1. If a class has already been loaded, it returns it.
    2. Otherwise, it delegates the search for the new class to the parent class loader.
    3. If the parent class loader does not find the class, loadClass calls the method findClass to find and load the class.
  • The findClass method of ClassLoader searches for the class in the current class loader if the class wasn't found by the parent class loader. You will probably want to override this method when you instantiate a class loader subclass in your application.
  • The class java.net.URLClassLoader serves as the basic class loader for extensions and other JAR files, overriding the findClass method of java.lang.ClassLoader to search one or more specified URLs for classes and resources.

To see a sample application that uses some of the API as it relates to JAR files, see the Using JAR-related APIs lesson in this tutorial.

Class Loading and the java Command

The Java platform's class-loading mechanism is reflected in the java command.

  • In the java tool, the -classpath option is a shorthand way to set the java.class.path property.
  • The -cp and -classpath options are equivalent.
  • The -jar option runs applications that are packaged in JAR files. For a description and examples of this option, see the Running JAR-Packaged Software lesson in this tutorial。

转载于:https://www.cnblogs.com/davidwang456/p/4056290.html

Understanding Extension Class Loading--官方相关推荐

  1. Understanding Java class loading - part 2

    1.Oracle博客上的一篇文章: https://blogs.oracle.com/sundararajan/entry/understanding_java_class_loading_part ...

  2. python wheel库(安装包查找)(适用于Python扩展程序包的非官方Windows二进制文件、Pypi官方库、清华大学开源软件镜像源)

    适用于Python扩展程序包的非官方Windows二进制文件 Unofficial Windows Binaries for Python Extension Packages Pypi官方库 官方库 ...

  3. c语言 vscode代码自动补全_借助C/C++ Extension实现VSCode C++代码补全

    在VSCode C/C++ IntelliSense领域,目前有两位实力相当的选手,它们分别是基于微软闭源技术的C/C++ Extension和开源方案clangd.根据我目前体验,它俩的特性可以总结 ...

  4. Tableau 2022.3的Table Extension到底怎么用?

    昨天晚上Tableau发布了2022年的3季度更新,其中有一个功能让我非常兴奋,那就是Table Extension. 按照官方的介绍,该功能可将Tableau数据源中的表,作为输入传入Table E ...

  5. 嵌入式Linux设备驱动程序:编写内核设备驱动程序

    嵌入式Linux设备驱动程序:编写内核设备驱动程序 Embedded Linux device drivers: Writing a kernel device driver 编写内核设备驱动程序 最 ...

  6. PHP7添加opcache.so模块

    启动php报错如下: # /usr/local/php7/sbin/php-fpm [09-Apr-2019 16:21:13] NOTICE: PHP message: PHP Warning: P ...

  7. AE导出JSON数据用CSS做前端交互---kalrry

    AE导出JSON数据用CSS做前端交互---kalrry 一.简介 二.准备 三.例子 四.参考 一.简介 关于网页端动画实现 web端做动画有多种形式,可以用CSS的animation,也可以用Ca ...

  8. Unity使用Package Manager管理自定义插件

    文章目录 前言 一.自定义插件流程 二.嵌入式程序包 1.简介 2.如何在unity中嵌入程序包 总结 前言 本文介绍Unity如何使用的Package Manager去构建自定义插件,主要介绍在开发 ...

  9. 猿创征文 | 国产数据库之openGauss的单机主备部署及快速入门

    猿创征文 | 国产数据库之openGauss的单机主备部署及快速入门 一.openGauss介绍 1.openGauss简介 2.openGauss特点 3.openGauss的逻辑架构图 二.环境检 ...

最新文章

  1. 包邮送书 | 中科院博士推荐的50本高质量Python、数据分析书籍
  2. 爱上MVC~为DisplayNameFor添加扩展,支持PagedList集合
  3. mysql主从只同步部分库或表
  4. OpenCV示例学习(二): 基本图形绘制算子:line(),circle(),fillPoly(), ellipse()
  5. Java 第五章 类的设计与包
  6. ElasticSearch教程——倒排索引及其数据结构以及优缺点
  7. 从“机器换人”到“虚拟数字员工”,我们应该担心人工智能“抢饭碗”吗?
  8. python爬虫:模拟有道词典翻译文本
  9. Verilog——74LVC161计数器
  10. 开发之准备:为目标设备创建映像
  11. 将CSDN文章内容转成PDF文件使用教程
  12. 请你讲讲wait方法的底层原理
  13. 阿里云服务器ECS-Apollo搭建MQTT服务器(Windows环境)
  14. CSS如何实现文字两端对齐
  15. HDU 1083 Coures(二分图匹配)
  16. Contextual Transformer Networks for Visual Recognition论文以及代码解析
  17. 安捷伦示波器DSO-X3034A进入不了测试界面是什么原因?
  18. 虚拟机环境下实现内网外网互相ping的方法
  19. 十四、基础教程-标示线(plotLines)
  20. 【推荐】2020-2021 AI人工智能技术领域行业研究报告大合集(58份)

热门文章

  1. dbeaver导出表结构和数据_python中的哈希表数据结构
  2. java逻辑代码_Java逻辑代码判断字数
  3. mysql 浏览器可视窗口_浏览器窗口的可视区域大小指的是哪里?
  4. .NET平台相关概念(简单了解)
  5. 页面重新加载_Chrome为PWA应用加入了返回和重新加载按钮
  6. 计算机控制综合应用题,计算机网络管理综合应用题
  7. android studio wcf,将图像从android studio上传到Wcf Service
  8. matlab示波器显示部分,Matlab 示波器显示设置
  9. 计算机成绩统计优秀率,基于决策树算法的成绩优秀率分析与研究.pdf
  10. 访问其他程序中的数据(ContentResolver的CRUD操作)