0%

☕Java


https://github.com/EsotericSoftware/kryo
Kryo 是一个快速高效的 Java 二进制对象图序列化框架。该项目的目标是高速、小尺寸和易于使用的 API。该项目在任何需要持久化对象的时候都很有用,无论是保存到文件、数据库还是通过网络。


https://poi.apache.org/components/index.html
Apache POI 项目是开发基于 Microsoft 的 OLE 2 复合文档格式的文件格式的纯 Java 端口的主项目。 Microsoft Office Documents 以及使用 MFC 属性集序列化其文档对象的程序都使用 OLE 2 复合文档格式。
Apache POI 也是开发基于Office Open XML (ooxml) 的文件格式的纯Java 端口的主项目。 OOXML 是 ECMA/ISO 标准化工作的一部分。该文档相当大,但您通常可以毫不费力地找到所需的内容! ECMA-376 标准在这里,并且也在 Microsoft OSP 之下。


https://site.mockito.org/#intro
https://github.com/mockito/mockito
Mockito 是一个用于 Java 单元测试的模拟框架。它被设计为在测试需要模拟时使用直观。


http://sikulix.com/
https://raiman.github.io/SikuliX1/downloads.html
https://github.com/RaiMan/SikuliX1
SikuliX 可以自动化您在运行 Windows、Mac 或某些 Linux/Unix 的台式计算机屏幕上看到的任何内容。它使用由 OpenCV 提供支持的图像识别来识别 GUI 组件。如果无法轻松访问 GUI 的内部结构或要操作的应用程序或网页的源代码,这将非常方便。


https://github.com/alibaba/druid/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98
https://github.com/drtrang/druid-spring-boot/blob/master/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml
https://github.com/drtrang/druid-spring-boot/blob/master/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/druid.yml
Druid是Java语言中最好的数据库连接池。Druid能够提供强大的监控和扩展功能。


https://github.com/alibaba/Sentinel/wiki/%E4%B8%BB%E9%A1%B5
https://github.com/alibaba/spring-cloud-alibaba/wiki/Sentinel
Sentinel 是面向分布式服务架构的流量控制组件,主要以流量为切入点,从限流、流量整形、熔断降级、系统负载保护、热点防护等多个维度来帮助开发者保障微服务的稳定性。

⚡Javascript


http://momentjs.cn/docs/#/parsing/
Moment JavaScript日期处理类库

https://echarts.apache.org/zh/option.html#title
Echarts 一个基于 JavaScript 的开源可视化图表库

http://mikemcl.github.io/big.js/
Big.js 用于任意精度十进制算术的小型、快速、易于使用的库。

https://mikemcl.github.io/decimal.js/
decimal.js 功能同上

https://socket.io/
Socket.IO 是一个库,可以在浏览器和服务器之间实现实时、双向和基于事件的通信。

https://shepherdjs.dev/
shepherdjs 引导您的用户浏览您的应用

http://llever.com/vue-scrollto-zh/
vue-scrollto 滚动元素从未如此简单!

https://api.onlyoffice.com/
OnlyOffice 文档编辑器

http://tinymce.ax-z.cn/general/basic-setup.php
TinyMCE 功能强大、所见即所得的富文本编辑器

转载:https://www.cnblogs.com/kevingrace/p/6547616.html

Docker容器应用的开发和运行离不开可靠的镜像管理,虽然Docker官方也提供了公共的镜像仓库,但是从安全和效率等方面考虑,部署我们私有环境内的Registry
也是非常必要的。之前介绍了Docker私有仓库Registry,这里介绍另一款企业级Docker镜像仓库Harbor的部署和使用,在Kubernetes集群中,推荐使用Harbor仓库环境。

阅读全文 »

转载:https://www.cnblogs.com/kevingrace/p/5575666.html

一、Kubernetes 介绍

Kubernetes是一个全新的基于容器技术的分布式架构领先方案, 它是Google在2014年6月开源的一个容器集群管理系统,使用Go语言开发,Kubernetes也叫K8S。K8S是Google内部一个叫Borg的容器集群管理系统衍生出来的,Borg已经在Google大规模生产运行十年之久。K8S主要用于自动化部署、扩展和管理容器应用,提供了资源调度、部署管理、服务发现、扩容缩容、监控等一整套功能。2015年7月,Kubernetes v1.0正式发布,截止到2017年9月29日最新稳定版本是v1.8。Kubernetes目标是让部署容器化应用简单高效。

Kubernetes最初源于谷歌内部的Borg,提供了面向应用的容器集群部署和管理系统。Kubernetes 的目标旨在消除编排物理/虚拟计算,网络和存储基础设施的负担,并使应用程序运营商和开发人员完全将重点放在以容器为中心的原语上进行自助运营。Kubernetes 也提供稳定、兼容的基础(平台),用于构建定制化的workflows 和更高级的自动化任务。

Kubernetes 具备完善的集群管理能力,包括多层次的安全防护和准入机制、多租户应用支撑能力、透明的服务注册和服务发现机制、内建负载均衡器、故障发现和自我修复能力、服务滚动升级和在线扩容、可扩展的资源自动调度机制、多粒度的资源配额管理能力。Kubernetes 还提供完善的管理工具,涵盖开发、部署测试、运维监控等各个环节。

阅读全文 »

BufferedReader reader = ResourceUtil.getUtf8Reader("xxx.properties");
Properties properties = new Properties();
properties.load(reader);

替换成这样

BufferedReader reader = ResourceUtil.getUtf8Reader("xxx.properties");
Properties properties = new Properties();
properties.load(new StringReader(IoUtil.read(reader).replace("\\", "\\\\")));

1. Overview

In this tutorial, we'll analyze the technique to list all the classes loaded by a specific class loader in Java, using the Java Instrumentation API. We'll also see how to create and load a Java agent to acquire an Instrumentation instance and invoke the required methods to accomplish our task.

2. Class Loaders in Java

The class loaders are an integral part of the JRE (Java Runtime Environment). Their job is to dynamically load classes into the Java Virtual Machine. In other words, they load classes into memory on-demand when required by the application. The article on Java class loaders talks about their different types and provides a detailed understanding of how they work.

3. Using the Instrumentation API

The Instrumentation interface provides the getInitiatedClasses(Classloader loader) method that can be invoked to return an array comprising all the classes loaded by the particular loader. Let's see how this works.

First, we need to create and load an agent to acquire an instance of the Instrumentation interface. A Java agent is a tool to instrument programs running on the JVM (Java Virtual Machine).

In other words, it can add or modify the bytecode of methods for the purpose of gathering data. We'll require an agent to get a handle on the Instrumentation instance and invoke the required method.

There are multiple ways to create and load an agent. In this tutorial, we'll use the static loading approach using the premain method and the -javaagent option.

3.1. Creating a Java Agent

To create a Java agent, we need to define the premain method to which the Instrumentation instance will be passed on agent load. Let's now create the ListLoadedClassesAgent class:

public class ListLoadedClassesAgent {

private static Instrumentation instrumentation;

public static void premain(String agentArgs, Instrumentation instrumentation) {
ListLoadedClassesAgent.instrumentation = instrumentation;
}
}

3.2. Defining the listLoadedClasses Methods

In addition to defining the agent, we'll define and expose a static method to return an array of loaded classes for a given class loader.

Note that if we pass a class loader with a null value to the getInitiatedClasses method, it returns the classes loaded by the bootstrap class loader.

Let's see the code in action:

public static Class<?>[] listLoadedClasses(String classLoaderType) {
return instrumentation.getInitiatedClasses(
getClassLoader(classLoaderType));
}

private static ClassLoader getClassLoader(String classLoaderType) {
ClassLoader classLoader = null;
switch (classLoaderType) {
case "SYSTEM":
classLoader = ClassLoader.getSystemClassLoader();
break;
case "EXTENSION":
classLoader = ClassLoader.getSystemClassLoader().getParent();
break;
case "BOOTSTRAP":
break;
default:
break;
}
return classLoader;
}

Note that if we're using Java 9 or above, we can use the getPlatformClassLoader method. This will list the classes loaded by the Platform class loader. In that case, the switch case will also contain:

case "PLATFORM":
classLoader = ClassLoader.getPlatformClassLoader();
break;

3.3. Creating the Agent Manifest File

Now, let's create a manifest file, MANIFEST.MF, with appropriate attributes for our agent to run, including:

Premain-Class: com.baeldung.loadedclasslisting.ListLoadedClassesAgent

The complete list of manifest attributes for an agent JAR file is available on the official documentation of the java.lang.instrument package.

3.4. Loading the Agent and Running the Application

Let's now load the agent and run the application. First, we need the agent JAR file with a manifest file containing the Premain-Class information. Additionally, we need the application JAR file with a manifest file containing the Main-Class information. The Launcher class containing the main method will start our application. Then we'll be able to print the classes loaded by different types of class loaders:

public class Launcher {

public static void main(String[] args) {
printClassesLoadedBy("BOOTSTRAP");
printClassesLoadedBy("SYSTEM");
printClassesLoadedBy("EXTENSION");
}

private static void printClassesLoadedBy(String classLoaderType) {
System.out.println(classLoaderType + " ClassLoader : ");
Class<?>[] classes = ListLoadedClassesAgent.listLoadedClasses(classLoaderType);
Arrays.asList(classes)
.forEach(clazz -> System.out.println(clazz.getCanonicalName()));
}
}

Next, let's statically load the Java agent and start our application:

java -javaagent:agent.jar -jar app.jar

After running the above command, we'll see the output:

BOOTSTRAP ClassLoader :
java.lang.ClassValue.Entry[]
java.util.concurrent.ConcurrentHashMap.Segment
java.util.concurrent.ConcurrentHashMap.Segment[]
java.util.StringTokenizer
..............
SYSTEM ClassLoader :
java.lang.Object[]
java.lang.Object[][]
java.lang.Class
java.lang.Class[]
..............
EXTENSION ClassLoader :
byte[]
char[]
int[]
int[][]
short[]

4. Conclusion

In this tutorial, we learned about the technique to list all the classes loaded in a specific class loader.

First, we created the Java Agent. After that, we defined the method to list the loaded classes using the Java Instrumentation API. Finally, we created the agent manifest files, loaded the agent, and ran our application.

As always, the complete source code of the example can be found over on GitHub.

Reference: