From 2ed3c2e45e1d8ce40f7af2159e71e63baaab9cbc Mon Sep 17 00:00:00 2001
From: Kimi Liu <839536@qq.com>
Date: Wed, 15 Jun 2022 11:37:31 +0800
Subject: [PATCH 1/9] bug fix and add method
---
.../core/beans/copier/BeanToMapCopier.java | 2 +-
.../bus/core/beans/copier/CopyOptions.java | 2 +
.../core/beans/copier/MapToBeanCopier.java | 2 +-
.../copier/ValueProviderToBeanCopier.java | 6 ++
.../aoju/bus/core/convert/ArrayConverter.java | 68 +++++++++++++---
.../org/aoju/bus/core/convert/Convert.java | 3 +
.../bus/core/convert/ConverterRegistry.java | 1 +
.../org/aoju/bus/core/date/Converter.java | 25 ++++++
.../java/org/aoju/bus/core/lang/FileType.java | 1 +
.../org/aoju/bus/core/lang/SimpleCache.java | 2 +-
.../org/aoju/bus/core/toolkit/ArrayKit.java | 15 +++-
.../org/aoju/bus/core/toolkit/BeanKit.java | 31 ++++++++
.../org/aoju/bus/core/toolkit/IterKit.java | 3 +
.../java/org/aoju/bus/extra/ssh/JSchKit.java | 17 +++-
.../aoju/bus/extra/ssh/JSchSessionPool.java | 4 +-
.../java/org/aoju/bus/extra/ssh/Sftp.java | 14 +++-
.../org/aoju/bus/health/builtin/Java.java | 77 -------------------
.../software/AbstractOperatingSystem.java | 5 +-
.../health/linux/hardware/LinuxNetworkIF.java | 5 +-
19 files changed, 178 insertions(+), 105 deletions(-)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToMapCopier.java b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToMapCopier.java
index 3002b772ad..fbee5a1c53 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToMapCopier.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToMapCopier.java
@@ -50,7 +50,7 @@ public class BeanToMapCopier extends AbstractCopier
-
+
@@ -97,7 +97,7 @@ Bus (应用/服务总线) 是一个基础框架、服务套件,它基于Java17
org.aoju
bus-all
- 6.5.1
+ 6.5.2
```
diff --git a/bus-all/pom.xml b/bus-all/pom.xml
index 7eea4f2766..6f02133974 100755
--- a/bus-all/pom.xml
+++ b/bus-all/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-all
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-base/pom.xml b/bus-base/pom.xml
index ecabc4b586..44a9cd169a 100755
--- a/bus-base/pom.xml
+++ b/bus-base/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-base
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-bom/pom.xml b/bus-bom/pom.xml
index 80d3810092..244b6f48b0 100755
--- a/bus-bom/pom.xml
+++ b/bus-bom/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-bom
- 6.5.1
+ 6.5.2
pom
${project.artifactId}
diff --git a/bus-cache/pom.xml b/bus-cache/pom.xml
index af4fa42f3c..cf3d448f58 100755
--- a/bus-cache/pom.xml
+++ b/bus-cache/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-cache
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-core/README.md b/bus-core/README.md
index 9a2992f2dc..9004bf2e85 100755
--- a/bus-core/README.md
+++ b/bus-core/README.md
@@ -14,7 +14,7 @@
org.aoju
bus-core
- 6.5.1
+ 6.5.2
```
diff --git a/bus-core/pom.xml b/bus-core/pom.xml
index e3b9143df9..4ea584fb47 100755
--- a/bus-core/pom.xml
+++ b/bus-core/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-core
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-core/src/main/java/org/aoju/bus/core/Version.java b/bus-core/src/main/java/org/aoju/bus/core/Version.java
index a4757cd0d1..a933fe3f41 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/Version.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/Version.java
@@ -60,7 +60,7 @@ public class Version {
* @return 项目的版本号
*/
public static String get() {
- return "6.5.1.RELEASE";
+ return "6.5.2.RELEASE";
}
/**
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java b/bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java
index 3e09a144a6..63815dac82 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java
@@ -168,20 +168,13 @@ public Object get(final Object bean) {
}
/**
- * 设置表达式指定位置(或filed对应)的值
- * 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
- * 注意:
- *
- *
- * 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
- * 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
- *
+ * 判断path列表中末尾的标记是否为数字
*
- * @param bean Bean、Map或List
- * @param value 值
+ * @param patternParts path列表
+ * @return 是否为数字
*/
- public void set(final Object bean, final Object value) {
- set(bean, this.patternParts, value);
+ private static boolean lastIsNumber(List patternParts) {
+ return MathKit.isInteger(patternParts.get(patternParts.size() - 1));
}
@Override
@@ -190,27 +183,13 @@ public String toString() {
}
/**
- * 设置表达式指定位置(或filed对应)的值
- * 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
- * 注意:
- *
- *
- * 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
- * 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
- *
+ * 获取父级路径列表
*
- * @param bean Bean、Map或List
- * @param patternParts 表达式块列表
- * @param value 值
+ * @param patternParts 路径列表
+ * @return 父级路径列表
*/
- private void set(final Object bean, final List patternParts, final Object value) {
- Object subBean = get(patternParts, bean, true);
- if (null == subBean) {
- set(bean, patternParts.subList(0, patternParts.size() - 1), new HashMap<>());
- //set中有可能做过转换,因此此处重新获取bean
- subBean = get(patternParts, bean, true);
- }
- BeanKit.setFieldValue(subBean, patternParts.get(patternParts.size() - 1), value);
+ private static List getParentParts(List patternParts) {
+ return patternParts.subList(0, patternParts.size() - 1);
}
/**
@@ -314,4 +293,46 @@ private void init(final String expression) {
this.patternParts = CollKit.unmodifiable(localPatternParts);
}
+ /**
+ * 设置表达式指定位置(或filed对应)的值
+ * 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
+ * 注意:
+ *
+ *
+ * 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
+ * 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
+ *
+ *
+ * @param bean Bean、Map或List
+ * @param value 值
+ */
+ public void set(final Object bean, final Object value) {
+ set(bean, this.patternParts, lastIsNumber(this.patternParts), value);
+ }
+
+ /**
+ * 设置表达式指定位置(或filed对应)的值
+ * 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
+ * 注意:
+ *
+ *
+ * 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
+ * 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
+ *
+ *
+ * @param bean Bean、Map或List
+ * @param patternParts 表达式块列表
+ * @param value 值
+ */
+ private void set(Object bean, List patternParts, boolean nextNumberPart, Object value) {
+ Object subBean = this.get(patternParts, bean, true);
+ if (null == subBean) {
+ final List parentParts = getParentParts(patternParts);
+ this.set(bean, parentParts, lastIsNumber(parentParts), nextNumberPart ? new ArrayList<>() : new HashMap<>());
+ //set中有可能做过转换,因此此处重新获取bean
+ subBean = this.get(patternParts, bean, true);
+ }
+ BeanKit.setFieldValue(subBean, patternParts.get(patternParts.size() - 1), value);
+ }
+
}
diff --git a/bus-core/src/main/java/org/aoju/bus/core/date/Converter.java b/bus-core/src/main/java/org/aoju/bus/core/date/Converter.java
index de7c4af47c..1b4993b0a4 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/date/Converter.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/date/Converter.java
@@ -302,7 +302,6 @@ public static LocalDate toLocalDate(YearMonth yearMonth, int dayOfMonth) {
* @param date {@link Date}
* @param zoneId {@link ZoneId}
* @return {@link DateTime}
- * @see DateTime(Date, ZoneId )
*/
public static DateTime toTimeZone(Date date, ZoneId zoneId) {
return new DateTime(date, ZoneKit.toTimeZone(zoneId));
@@ -314,7 +313,6 @@ public static DateTime toTimeZone(Date date, ZoneId zoneId) {
* @param date {@link Date}
* @param timeZone {@link TimeZone}
* @return {@link DateTime}
- * @see DateTime(Date,ZoneId)
*/
public static DateTime toTimeZone(Date date, TimeZone timeZone) {
return new DateTime(date, timeZone);
diff --git a/bus-core/src/main/java/org/aoju/bus/core/thread/BlockPolicy.java b/bus-core/src/main/java/org/aoju/bus/core/thread/BlockPolicy.java
index 2ad09a9b19..725540dee7 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/thread/BlockPolicy.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/thread/BlockPolicy.java
@@ -28,6 +28,7 @@
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
+import java.util.function.Consumer;
/**
* 当任务队列过长时处于阻塞状态,直到添加到队列中,如果阻塞过程中被中断,就会抛出{@link InterruptedException}异常
@@ -38,13 +39,42 @@
*/
public class BlockPolicy implements RejectedExecutionHandler {
+ /**
+ * 线程池关闭时,为避免任务丢失,留下处理方法
+ * 如果需要由调用方来运行,可以{@code new BlockPolicy(Runnable::run)}
+ */
+ private final Consumer handler;
+
+ /**
+ * 构造
+ *
+ * @param handler 线程池关闭后的执行策略
+ */
+ public BlockPolicy(final Consumer handler) {
+ this.handler = handler;
+ }
+
+ /**
+ * 构造
+ */
+ public BlockPolicy() {
+ this(null);
+ }
+
@Override
public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
- try {
- e.getQueue().put(r);
- } catch (InterruptedException ex) {
- throw new RejectedExecutionException("Task " + r + " rejected from " + e);
+ // 线程池未关闭时,阻塞等待
+ if (false == e.isShutdown()) {
+ try {
+ e.getQueue().put(r);
+ } catch (InterruptedException ex) {
+ throw new RejectedExecutionException("Task " + r + " rejected from " + e);
+ }
+ } else if (null != handler) {
+ // 当设置了关闭时候的处理
+ handler.accept(r);
}
+ // 线程池关闭后,丢弃任务
}
}
diff --git a/bus-core/src/main/java/org/aoju/bus/core/toolkit/CollKit.java b/bus-core/src/main/java/org/aoju/bus/core/toolkit/CollKit.java
index f2257d233d..d5c075f100 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/toolkit/CollKit.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/toolkit/CollKit.java
@@ -3014,6 +3014,43 @@ public static List setOrAppend(List list, int index, T element) {
return list;
}
+ /**
+ * 在指定位置设置元素。当index小于List的长度时,替换指定位置的值,否则追加{@code null}直到到达index后,设置值
+ *
+ * @param 元素类型
+ * @param list List列表
+ * @param index 位置
+ * @param element 新元素
+ * @return 原List
+ */
+ public static List setOrPadding(List list, int index, T element) {
+ return setOrPadding(list, index, element, null);
+ }
+
+ /**
+ * 在指定位置设置元素。当index小于List的长度时,替换指定位置的值,否则追加{@code paddingElement}直到到达index后,设置值
+ *
+ * @param 元素类型
+ * @param list List列表
+ * @param index 位置
+ * @param element 新元素
+ * @param paddingElement 填充的值
+ * @return 原List
+ */
+ public static List setOrPadding(List list, int index, T element, T paddingElement) {
+ Assert.notNull(list, "List must be not null !");
+ final int size = list.size();
+ if (index < size) {
+ list.set(index, element);
+ } else {
+ for (int i = size; i < index; i++) {
+ list.add(paddingElement);
+ }
+ list.add(element);
+ }
+ return list;
+ }
+
/**
* 将页数和每页条目数转换为开始位置和结束位置
* 此方法用于不包括结束位置的分页方法
diff --git a/bus-core/src/main/java/org/aoju/bus/core/toolkit/NetKit.java b/bus-core/src/main/java/org/aoju/bus/core/toolkit/NetKit.java
index f19093ccb5..ffe8bbe659 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/toolkit/NetKit.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/toolkit/NetKit.java
@@ -98,6 +98,17 @@ public static long ipv4ToLong(String strIP) {
throw new IllegalArgumentException("Invalid IPv4 address!");
}
+ /**
+ * 根据ip地址(xxx.xxx.xxx.xxx)计算出long型的数据, 如果格式不正确返回 defaultValue
+ *
+ * @param strIP IP V4 地址
+ * @param defaultValue 默认值
+ * @return long值
+ */
+ public static long ipv4ToLong(String strIP, long defaultValue) {
+ return Validator.isIpv4(strIP) ? ipv4ToLong(strIP) : defaultValue;
+ }
+
/**
* 将匹配到的Ipv4地址的4个分组分别处理
*
diff --git a/bus-cron/pom.xml b/bus-cron/pom.xml
index 4591e09b67..0ff5f5bf42 100755
--- a/bus-cron/pom.xml
+++ b/bus-cron/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-cron
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-crypto/pom.xml b/bus-crypto/pom.xml
index 714772b096..815fef1d34 100755
--- a/bus-crypto/pom.xml
+++ b/bus-crypto/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-crypto
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-extra/pom.xml b/bus-extra/pom.xml
index f8994a6b1d..7e744fb1c6 100644
--- a/bus-extra/pom.xml
+++ b/bus-extra/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-extra
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-gitlab/README.md b/bus-gitlab/README.md
index e63a97d83b..0af8fba165 100755
--- a/bus-gitlab/README.md
+++ b/bus-gitlab/README.md
@@ -70,7 +70,7 @@ dependencies {
org.aoju
bus-gitlab
- 6.5.1
+ 6.5.2
```
diff --git a/bus-gitlab/pom.xml b/bus-gitlab/pom.xml
index c9e2181375..91d6d19f36 100755
--- a/bus-gitlab/pom.xml
+++ b/bus-gitlab/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-gitlab
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-goalie/pom.xml b/bus-goalie/pom.xml
index 41f618ae6e..10ce91a048 100644
--- a/bus-goalie/pom.xml
+++ b/bus-goalie/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-goalie
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-health/pom.xml b/bus-health/pom.xml
index 7ea11db569..db1dd1dbf5 100755
--- a/bus-health/pom.xml
+++ b/bus-health/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-health
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-health/src/main/java/org/aoju/bus/health/Config.java b/bus-health/src/main/java/org/aoju/bus/health/Config.java
index cb5f436fc4..cf54cdeddf 100644
--- a/bus-health/src/main/java/org/aoju/bus/health/Config.java
+++ b/bus-health/src/main/java/org/aoju/bus/health/Config.java
@@ -45,7 +45,6 @@ public final class Config {
public static final String MACOS_VERSIONS_PROPERTIES = "bus.health.macos.version.properties";
public static final String VM_MAC_ADDR_PROPERTIES = "bus.health.vmmacaddr.properties";
public static final String ARCHITECTURE_PROPERTIES = "bus.health.architecture.properties";
-
public static final String MEMOIZER_EXPIRATION = "bus.health.memoizer.expiration";
public static final String WMI_TIMEOUT = "bus.health.wmi.timeout";
public static final String PROC_PATH = "bus.health.proc.path";
@@ -57,13 +56,10 @@ public final class Config {
public static final String OS_WINDOWS_HKEYPERFDATA = "bus.health.os.windows.hkeyperfdata";
public static final String OSHI_OS_WINDOWS_LOADAVERAGE = "bus.health.os.windows.loadaverage";
public static final String OS_WINDOWS_CPU_UTILITY = "bus.health.os.windows.cpu.utility";
-
public static final String OS_WINDOWS_PERFDISK_DIABLED = "bus.os.windows.perfdisk.disabled";
public static final String OS_WINDOWS_PERFOS_DIABLED = "bus.os.windows.perfos.disabled";
public static final String OS_WINDOWS_PERFPROC_DIABLED = "bus.os.windows.perfproc.disabled";
-
public static final String OS_UNIX_WHOCOMMAND = "bus.health.os.unix.whoCommand";
-
private static final Properties CONFIG = readProperties(PROPERTIES);
/**
diff --git a/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/KstatKit.java b/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/KstatKit.java
index 8ce3f6e9de..f68f9c6a40 100644
--- a/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/KstatKit.java
+++ b/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/KstatKit.java
@@ -69,6 +69,125 @@ private KstatKit() {
}
+ /**
+ * A copy of the Kstat chain, encapsulating a {@code kstat_ctl_t} object. Only
+ * one thread may actively use this object at any time.
+ *
+ * The chain is created once calling {@link LibKstat#kstat_open} and then this
+ * object is instantiated using the {@link KstatKit#openChain} method.
+ * Instantiating this object updates the chain using
+ * {@link LibKstat#kstat_chain_update}. The control object should be closed with
+ * {@link #close}, which releases the lock and allows another instance to be
+ * instantiated.
+ */
+ public static final class KstatChain implements AutoCloseable {
+
+ private final KstatCtl localCtlRef;
+
+ private KstatChain(KstatCtl ctl) {
+ this.localCtlRef = ctl;
+ update();
+ }
+
+ /**
+ * Convenience method for {@link LibKstat#kstat_read} which gets data from the
+ * kernel for the kstat pointed to by {@code ksp}. {@code ksp.ks_data} is
+ * automatically allocated (or reallocated) to be large enough to hold all of
+ * the data. {@code ksp.ks_ndata} is set to the number of data fields,
+ * {@code ksp.ks_data_size} is set to the total size of the data, and
+ * ksp.ks_snaptime is set to the high-resolution time at which the data snapshot
+ * was taken.
+ *
+ * @param ksp The kstat from which to retrieve data
+ * @return {@code true} if successful; {@code false} otherwise
+ */
+ @GuardeBy("CHAIN")
+ public boolean read(Kstat ksp) {
+ int retry = 0;
+ while (0 > LibKstat.INSTANCE.kstat_read(localCtlRef, ksp, null)) {
+ if (LibKstat.EAGAIN != Native.getLastError() || 5 <= ++retry) {
+ if (Logger.isDebug()) {
+ Logger.debug("Failed to read kstat {}:{}:{}",
+ Native.toString(ksp.ks_module, StandardCharsets.US_ASCII), ksp.ks_instance,
+ Native.toString(ksp.ks_name, StandardCharsets.US_ASCII));
+ }
+ return false;
+ }
+ ThreadKit.sleep(8 << retry);
+ }
+ return true;
+ }
+
+ /**
+ * Convenience method for {@link LibKstat#kstat_lookup}. Traverses the kstat
+ * chain, searching for a kstat with the same {@code module}, {@code instance},
+ * and {@code name} fields; this triplet uniquely identifies a kstat. If
+ * {@code module} is {@code null}, {@code instance} is -1, or {@code name} is
+ * {@code null}, then those fields will be ignored in the search.
+ *
+ * @param module The module, or null to ignore
+ * @param instance The instance, or -1 to ignore
+ * @param name The name, or null to ignore
+ * @return The first match of the requested Kstat structure if found, or
+ * {@code null}
+ */
+ @GuardeBy("CHAIN")
+ public Kstat lookup(String module, int instance, String name) {
+ return LibKstat.INSTANCE.kstat_lookup(localCtlRef, module, instance, name);
+ }
+
+ /**
+ * Convenience method for {@link LibKstat#kstat_lookup}. Traverses the kstat
+ * chain, searching for all kstats with the same {@code module},
+ * {@code instance}, and {@code name} fields; this triplet uniquely identifies a
+ * kstat. If {@code module} is {@code null}, {@code instance} is -1, or
+ * {@code name} is {@code null}, then those fields will be ignored in the
+ * search.
+ *
+ * @param module The module, or null to ignore
+ * @param instance The instance, or -1 to ignore
+ * @param name The name, or null to ignore
+ * @return All matches of the requested Kstat structure if found, or an empty
+ * list otherwise
+ */
+ @GuardeBy("CHAIN")
+ public List lookupAll(String module, int instance, String name) {
+ List kstats = new ArrayList<>();
+ for (Kstat ksp = LibKstat.INSTANCE.kstat_lookup(localCtlRef, module, instance, name); ksp != null; ksp = ksp
+ .next()) {
+ if ((module == null || module.equals(Native.toString(ksp.ks_module, StandardCharsets.US_ASCII)))
+ && (instance < 0 || instance == ksp.ks_instance)
+ && (name == null || name.equals(Native.toString(ksp.ks_name, StandardCharsets.US_ASCII)))) {
+ kstats.add(ksp);
+ }
+ }
+ return kstats;
+ }
+
+ /**
+ * Convenience method for {@link LibKstat#kstat_chain_update}. Brings this kstat
+ * header chain in sync with that of the kernel.
+ *
+ * This function compares the kernel's current kstat chain ID(KCID), which is
+ * incremented every time the kstat chain changes, to this object's KCID.
+ *
+ * @return the new KCID if the kstat chain has changed, 0 if it hasn't, or -1 on
+ * failure.
+ */
+ @GuardeBy("CHAIN")
+ public int update() {
+ return LibKstat.INSTANCE.kstat_chain_update(localCtlRef);
+ }
+
+ /**
+ * Release the lock on the chain.
+ */
+ @Override
+ public void close() {
+ CHAIN.unlock();
+ }
+ }
+
/**
* Lock the Kstat chain for use by this object until it's closed.
*
@@ -245,123 +364,4 @@ public static List queryKstat2List(String beforeStr, String afterStr,
return results;
}
- /**
- * A copy of the Kstat chain, encapsulating a {@code kstat_ctl_t} object. Only
- * one thread may actively use this object at any time.
- *
- * The chain is created once calling {@link LibKstat#kstat_open} and then this
- * object is instantiated using the {@link KstatKit#openChain} method.
- * Instantiating this object updates the chain using
- * {@link LibKstat#kstat_chain_update}. The control object should be closed with
- * {@link #close}, which releases the lock and allows another instance to be
- * instantiated.
- */
- public static final class KstatChain implements AutoCloseable {
-
- private final KstatCtl localCtlRef;
-
- private KstatChain(KstatCtl ctl) {
- this.localCtlRef = ctl;
- update();
- }
-
- /**
- * Convenience method for {@link LibKstat#kstat_read} which gets data from the
- * kernel for the kstat pointed to by {@code ksp}. {@code ksp.ks_data} is
- * automatically allocated (or reallocated) to be large enough to hold all of
- * the data. {@code ksp.ks_ndata} is set to the number of data fields,
- * {@code ksp.ks_data_size} is set to the total size of the data, and
- * ksp.ks_snaptime is set to the high-resolution time at which the data snapshot
- * was taken.
- *
- * @param ksp The kstat from which to retrieve data
- * @return {@code true} if successful; {@code false} otherwise
- */
- @GuardeBy("CHAIN")
- public boolean read(Kstat ksp) {
- int retry = 0;
- while (0 > LibKstat.INSTANCE.kstat_read(localCtlRef, ksp, null)) {
- if (LibKstat.EAGAIN != Native.getLastError() || 5 <= ++retry) {
- if (Logger.isDebug()) {
- Logger.debug("Failed to read kstat {}:{}:{}",
- Native.toString(ksp.ks_module, StandardCharsets.US_ASCII), ksp.ks_instance,
- Native.toString(ksp.ks_name, StandardCharsets.US_ASCII));
- }
- return false;
- }
- ThreadKit.sleep(8 << retry);
- }
- return true;
- }
-
- /**
- * Convenience method for {@link LibKstat#kstat_lookup}. Traverses the kstat
- * chain, searching for a kstat with the same {@code module}, {@code instance},
- * and {@code name} fields; this triplet uniquely identifies a kstat. If
- * {@code module} is {@code null}, {@code instance} is -1, or {@code name} is
- * {@code null}, then those fields will be ignored in the search.
- *
- * @param module The module, or null to ignore
- * @param instance The instance, or -1 to ignore
- * @param name The name, or null to ignore
- * @return The first match of the requested Kstat structure if found, or
- * {@code null}
- */
- @GuardeBy("CHAIN")
- public Kstat lookup(String module, int instance, String name) {
- return LibKstat.INSTANCE.kstat_lookup(localCtlRef, module, instance, name);
- }
-
- /**
- * Convenience method for {@link LibKstat#kstat_lookup}. Traverses the kstat
- * chain, searching for all kstats with the same {@code module},
- * {@code instance}, and {@code name} fields; this triplet uniquely identifies a
- * kstat. If {@code module} is {@code null}, {@code instance} is -1, or
- * {@code name} is {@code null}, then those fields will be ignored in the
- * search.
- *
- * @param module The module, or null to ignore
- * @param instance The instance, or -1 to ignore
- * @param name The name, or null to ignore
- * @return All matches of the requested Kstat structure if found, or an empty
- * list otherwise
- */
- @GuardeBy("CHAIN")
- public List lookupAll(String module, int instance, String name) {
- List kstats = new ArrayList<>();
- for (Kstat ksp = LibKstat.INSTANCE.kstat_lookup(localCtlRef, module, instance, name); ksp != null; ksp = ksp
- .next()) {
- if ((module == null || module.equals(Native.toString(ksp.ks_module, StandardCharsets.US_ASCII)))
- && (instance < 0 || instance == ksp.ks_instance)
- && (name == null || name.equals(Native.toString(ksp.ks_name, StandardCharsets.US_ASCII)))) {
- kstats.add(ksp);
- }
- }
- return kstats;
- }
-
- /**
- * Convenience method for {@link LibKstat#kstat_chain_update}. Brings this kstat
- * header chain in sync with that of the kernel.
- *
- * This function compares the kernel's current kstat chain ID(KCID), which is
- * incremented every time the kstat chain changes, to this object's KCID.
- *
- * @return the new KCID if the kstat chain has changed, 0 if it hasn't, or -1 on
- * failure.
- */
- @GuardeBy("CHAIN")
- public int update() {
- return LibKstat.INSTANCE.kstat_chain_update(localCtlRef);
- }
-
- /**
- * Release the lock on the chain.
- */
- @Override
- public void close() {
- CHAIN.unlock();
- }
- }
-
-}
+}
\ No newline at end of file
diff --git a/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/hardware/SolarisCentralProcessor.java b/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/hardware/SolarisCentralProcessor.java
index 1ab8a38696..a77cc00ce0 100644
--- a/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/hardware/SolarisCentralProcessor.java
+++ b/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/hardware/SolarisCentralProcessor.java
@@ -302,7 +302,7 @@ public long[] queryCurrentFreq() {
try (KstatKit.KstatChain kc = KstatKit.openChain()) {
for (int i = 0; i < freqs.length; i++) {
for (Kstat ksp : kc.lookupAll(CPU_INFO, i, null)) {
- if (kc.read(ksp)) {
+ if (ksp != null && kc.read(ksp)) {
freqs[i] = KstatKit.dataLookupLong(ksp, "current_clock_Hz");
}
}
diff --git a/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/hardware/SolarisPowerSource.java b/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/hardware/SolarisPowerSource.java
index e316aa71aa..10bf631552 100644
--- a/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/hardware/SolarisPowerSource.java
+++ b/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/hardware/SolarisPowerSource.java
@@ -111,7 +111,7 @@ private static SolarisPowerSource getPowerSource(String name) {
// Get kstat for the battery information
try (KstatKit.KstatChain kc = KstatKit.openChain()) {
Kstat ksp = kc.lookup(KSTAT_BATT_MOD[KSTAT_BATT_IDX], 0, "battery BIF0");
- if (ksp != null) {
+ if (ksp != null && kc.read(ksp)) {
// Predicted battery capacity when fully charged.
long energyFull = KstatKit.dataLookupLong(ksp, "bif_last_cap");
if (energyFull == 0xffffffff || energyFull <= 0) {
@@ -134,7 +134,7 @@ private static SolarisPowerSource getPowerSource(String name) {
// Get kstat for the battery state
ksp = kc.lookup(KSTAT_BATT_MOD[KSTAT_BATT_IDX], 0, "battery BST0");
- if (ksp != null) {
+ if (ksp != null && kc.read(ksp)) {
// estimated remaining battery capacity
long energyNow = KstatKit.dataLookupLong(ksp, "bst_rem_cap");
if (energyNow >= 0) {
diff --git a/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/software/SolarisOperatingSystem.java b/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/software/SolarisOperatingSystem.java
index 6c92e153ac..f552ae3246 100644
--- a/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/software/SolarisOperatingSystem.java
+++ b/bus-health/src/main/java/org/aoju/bus/health/unix/solaris/software/SolarisOperatingSystem.java
@@ -124,7 +124,7 @@ private static long querySystemUptime() {
}
try (KstatKit.KstatChain kc = KstatKit.openChain()) {
Kstat ksp = kc.lookup("unix", 0, "system_misc");
- if (ksp != null) {
+ if (ksp != null && kc.read(ksp)) {
// Snap Time is in nanoseconds; divide for seconds
return ksp.ks_snaptime / 1_000_000_000L;
}
diff --git a/bus-health/src/main/java/org/aoju/bus/health/windows/drivers/LogicalProcessorInformation.java b/bus-health/src/main/java/org/aoju/bus/health/windows/drivers/LogicalProcessorInformation.java
index c528592f35..192c3f89d7 100644
--- a/bus-health/src/main/java/org/aoju/bus/health/windows/drivers/LogicalProcessorInformation.java
+++ b/bus-health/src/main/java/org/aoju/bus/health/windows/drivers/LogicalProcessorInformation.java
@@ -94,10 +94,10 @@ public static Pair, List> getLogicalPr
}
// Windows doesn't define core and package numbers, so we define our own for
// consistent use across the API. Here we sort so core and package numbers
- // increment consistently with processor umbers/bitmasks, ordered in groups.
- cores.sort(Comparator.comparing(c -> c.group * 64L + c.mask.longValue()));
+ // increment consistently with processor numbers/bitmasks, ordered in groups.
+ cores.sort(Comparator.comparing(c -> c.group * 64L + Long.numberOfTrailingZeros(c.mask.longValue())));
// if package in multiple groups will still use first group for sorting
- packages.sort(Comparator.comparing(p -> p[0].group * 64L + p[0].mask.longValue()));
+ packages.sort(Comparator.comparing(p -> p[0].group * 64L + Long.numberOfTrailingZeros(p[0].mask.longValue())));
// Iterate Logical Processors and use bitmasks to match packages, cores,
// and NUMA nodes. Perfmon instances are numa node + processor number, so we
diff --git a/bus-health/src/main/java/org/aoju/bus/health/windows/drivers/registry/HkeyPerformanceDataUtil.java b/bus-health/src/main/java/org/aoju/bus/health/windows/drivers/registry/HkeyPerformanceDataUtil.java
index 1aac8976d0..ff14212a55 100644
--- a/bus-health/src/main/java/org/aoju/bus/health/windows/drivers/registry/HkeyPerformanceDataUtil.java
+++ b/bus-health/src/main/java/org/aoju/bus/health/windows/drivers/registry/HkeyPerformanceDataUtil.java
@@ -55,6 +55,8 @@ public final class HkeyPerformanceDataUtil {
private static final String COUNTER = "Counter";
private static final Map COUNTER_INDEX_MAP = mapCounterIndicesFromRegistry();
+ private static int maxPerfBufferSize = 4096;
+
/**
* Reads and parses a block of performance data from the registry.
*
@@ -234,14 +236,14 @@ private static & PerfCounterWildcardQuery.PdhCounterWildcardP
* {@link #COUNTER_INDEX_MAP}.
* @return A buffer containing the data if successful, null otherwise.
*/
- private static Memory readPerfDataBuffer(String objectName) {
+ private static synchronized Memory readPerfDataBuffer(String objectName) {
// Need this index as a string
String objectIndexStr = Integer.toString(COUNTER_INDEX_MAP.get(objectName));
// Now load the data from the regsitry.
- int bufferSize = 4096;
- IntByReference lpcbData = new IntByReference(bufferSize);
- Memory pPerfData = new Memory(bufferSize);
+
+ IntByReference lpcbData = new IntByReference(maxPerfBufferSize);
+ Memory pPerfData = new Memory(maxPerfBufferSize);
int ret = Advapi32.INSTANCE.RegQueryValueEx(WinReg.HKEY_PERFORMANCE_DATA, objectIndexStr, 0, null, pPerfData,
lpcbData);
if (ret != WinError.ERROR_SUCCESS && ret != WinError.ERROR_MORE_DATA) {
@@ -250,9 +252,9 @@ private static Memory readPerfDataBuffer(String objectName) {
}
// Grow buffer as needed to fit the data
while (ret == WinError.ERROR_MORE_DATA) {
- bufferSize += 4096;
- lpcbData.setValue(bufferSize);
- pPerfData = new Memory(bufferSize);
+ maxPerfBufferSize += 4096;
+ lpcbData.setValue(maxPerfBufferSize);
+ pPerfData = new Memory(maxPerfBufferSize);
ret = Advapi32.INSTANCE.RegQueryValueEx(WinReg.HKEY_PERFORMANCE_DATA, objectIndexStr, 0, null, pPerfData,
lpcbData);
}
diff --git a/bus-http/pom.xml b/bus-http/pom.xml
index b395f22a9f..974cfc1c0b 100755
--- a/bus-http/pom.xml
+++ b/bus-http/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-http
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-image/pom.xml b/bus-image/pom.xml
index c66cd6c04e..8f32a6f07c 100755
--- a/bus-image/pom.xml
+++ b/bus-image/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-image
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-limiter/pom.xml b/bus-limiter/pom.xml
index 03e3eeb673..f4d03822d3 100755
--- a/bus-limiter/pom.xml
+++ b/bus-limiter/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-limiter
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-logger/pom.xml b/bus-logger/pom.xml
index c85667711e..c518228abc 100644
--- a/bus-logger/pom.xml
+++ b/bus-logger/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-logger
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-mapper/pom.xml b/bus-mapper/pom.xml
index c423f7fbab..84b3d0162f 100755
--- a/bus-mapper/pom.xml
+++ b/bus-mapper/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-mapper
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-notify/README.md b/bus-notify/README.md
index 44b88ab10b..e8ee1f31b6 100755
--- a/bus-notify/README.md
+++ b/bus-notify/README.md
@@ -11,7 +11,7 @@
org.aoju
bus-notify
- 6.5.1
+ 6.5.2
```
diff --git a/bus-notify/pom.xml b/bus-notify/pom.xml
index 1676c4a377..eea110897f 100755
--- a/bus-notify/pom.xml
+++ b/bus-notify/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-notify
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-oauth/README.md b/bus-oauth/README.md
index f1657a2906..fc477dbedf 100755
--- a/bus-oauth/README.md
+++ b/bus-oauth/README.md
@@ -16,7 +16,7 @@
org.aoju
bus-oauth
- 6.5.1
+ 6.5.2
```
diff --git a/bus-oauth/pom.xml b/bus-oauth/pom.xml
index 1e147672f7..41ce7ba6c1 100755
--- a/bus-oauth/pom.xml
+++ b/bus-oauth/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-oauth
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-office/pom.xml b/bus-office/pom.xml
index 03d5a1313b..d6cddb9e0e 100755
--- a/bus-office/pom.xml
+++ b/bus-office/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-office
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-opencv/pom.xml b/bus-opencv/pom.xml
index bc0e6295a5..6b8246bf37 100755
--- a/bus-opencv/pom.xml
+++ b/bus-opencv/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-opencv
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-pager/README.md b/bus-pager/README.md
index 827404f310..b2b61e2ccd 100755
--- a/bus-pager/README.md
+++ b/bus-pager/README.md
@@ -42,7 +42,7 @@
org.aoju
bus-pager
- 6.5.1
+ 6.5.2
```
diff --git a/bus-pager/pom.xml b/bus-pager/pom.xml
index 03450fcaf7..8307ecc51e 100755
--- a/bus-pager/pom.xml
+++ b/bus-pager/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-pager
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-pay/pom.xml b/bus-pay/pom.xml
index b74e8bf484..26186cacb2 100644
--- a/bus-pay/pom.xml
+++ b/bus-pay/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-pay
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-proxy/pom.xml b/bus-proxy/pom.xml
index 85e15c368d..49132b4533 100755
--- a/bus-proxy/pom.xml
+++ b/bus-proxy/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-proxy
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-sensitive/pom.xml b/bus-sensitive/pom.xml
index 832a551036..bef8bd208d 100755
--- a/bus-sensitive/pom.xml
+++ b/bus-sensitive/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-sensitive
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-setting/pom.xml b/bus-setting/pom.xml
index b815fc7267..c7be60f76b 100755
--- a/bus-setting/pom.xml
+++ b/bus-setting/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-setting
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-shade/pom.xml b/bus-shade/pom.xml
index cd2ff2c8c4..daa64dce9b 100755
--- a/bus-shade/pom.xml
+++ b/bus-shade/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-shade
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-socket/pom.xml b/bus-socket/pom.xml
index 012a0fb2a1..9032ad2dbe 100755
--- a/bus-socket/pom.xml
+++ b/bus-socket/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-socket
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-starter/pom.xml b/bus-starter/pom.xml
index d711405f3a..a2f345f61e 100755
--- a/bus-starter/pom.xml
+++ b/bus-starter/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-starter
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-storage/pom.xml b/bus-storage/pom.xml
index 7b2e753313..d9c668ab6f 100755
--- a/bus-storage/pom.xml
+++ b/bus-storage/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-storage
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-tracer/pom.xml b/bus-tracer/pom.xml
index 7c67e9c8f0..da4e10c50d 100755
--- a/bus-tracer/pom.xml
+++ b/bus-tracer/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-tracer
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
diff --git a/bus-validate/pom.xml b/bus-validate/pom.xml
index ff4d41434b..8eb9000624 100755
--- a/bus-validate/pom.xml
+++ b/bus-validate/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-validate
- 6.5.1
+ 6.5.2
jar
${project.artifactId}
From e8183746b4d90b90ae6dad4a57b360e252b737ad Mon Sep 17 00:00:00 2001
From: Kimi Liu <839536@qq.com>
Date: Wed, 22 Jun 2022 10:58:36 +0800
Subject: [PATCH 7/9] v6.5.2
---
.../org/aoju/bus/logger/GlobalFactory.java | 3 --
.../commons/ApacheCommonsLog4JLog.java | 52 -------------------
.../commons/ApacheCommonsLogFactory.java | 12 +----
3 files changed, 2 insertions(+), 65 deletions(-)
delete mode 100755 bus-logger/src/main/java/org/aoju/bus/logger/dialect/commons/ApacheCommonsLog4JLog.java
diff --git a/bus-logger/src/main/java/org/aoju/bus/logger/GlobalFactory.java b/bus-logger/src/main/java/org/aoju/bus/logger/GlobalFactory.java
index 2146c6da3e..eb26f2b5a2 100755
--- a/bus-logger/src/main/java/org/aoju/bus/logger/GlobalFactory.java
+++ b/bus-logger/src/main/java/org/aoju/bus/logger/GlobalFactory.java
@@ -28,7 +28,6 @@
import org.aoju.bus.logger.dialect.commons.ApacheCommonsLogFactory;
import org.aoju.bus.logger.dialect.console.ConsoleLogFactory;
import org.aoju.bus.logger.dialect.jdk.JdkLogFactory;
-import org.aoju.bus.logger.dialect.log4j.Log4jLogFactory;
import org.aoju.bus.logger.dialect.log4j2.Log4j2LogFactory;
import org.aoju.bus.logger.dialect.slf4j.Slf4jLogFactory;
@@ -66,7 +65,6 @@ public static LogFactory get() {
* @param logFactoryClass 日志工厂类
* @return 自定义的日志工厂类
* @see Slf4jLogFactory
- * @see Log4jLogFactory
* @see Log4j2LogFactory
* @see ApacheCommonsLogFactory
* @see JdkLogFactory
@@ -86,7 +84,6 @@ public static LogFactory set(Class extends LogFactory> logFactoryClass) {
* @param logFactory 日志工厂类对象
* @return 自定义的日志工厂类
* @see Slf4jLogFactory
- * @see Log4jLogFactory
* @see Log4j2LogFactory
* @see ApacheCommonsLogFactory
* @see JdkLogFactory
diff --git a/bus-logger/src/main/java/org/aoju/bus/logger/dialect/commons/ApacheCommonsLog4JLog.java b/bus-logger/src/main/java/org/aoju/bus/logger/dialect/commons/ApacheCommonsLog4JLog.java
deleted file mode 100755
index 9b8618b127..0000000000
--- a/bus-logger/src/main/java/org/aoju/bus/logger/dialect/commons/ApacheCommonsLog4JLog.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*********************************************************************************
- * *
- * The MIT License (MIT) *
- * *
- * Copyright (c) 2015-2022 aoju.org and other contributors. *
- * *
- * Permission is hereby granted, free of charge, to any person obtaining a copy *
- * of this software and associated documentation files (the "Software"), to deal *
- * in the Software without restriction, including without limitation the rights *
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
- * copies of the Software, and to permit persons to whom the Software is *
- * furnished to do so, subject to the following conditions: *
- * *
- * The above copyright notice and this permission notice shall be included in *
- * all copies or substantial portions of the Software. *
- * *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
- * THE SOFTWARE. *
- * *
- ********************************************************************************/
-package org.aoju.bus.logger.dialect.commons;
-
-import org.aoju.bus.logger.dialect.log4j.Log4jLog;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.impl.Log4JLogger;
-
-/**
- * Apache Commons Logging for Log4j
- *
- * @author Kimi Liu
- * @since Java 17+
- */
-public class ApacheCommonsLog4JLog extends Log4jLog {
-
- public ApacheCommonsLog4JLog(Log logger) {
- super(((Log4JLogger) logger).getLogger());
- }
-
- public ApacheCommonsLog4JLog(Class> clazz) {
- super(clazz);
- }
-
- public ApacheCommonsLog4JLog(String name) {
- super(name);
- }
-
-}
diff --git a/bus-logger/src/main/java/org/aoju/bus/logger/dialect/commons/ApacheCommonsLogFactory.java b/bus-logger/src/main/java/org/aoju/bus/logger/dialect/commons/ApacheCommonsLogFactory.java
index 6e4e3f94f3..6f841490b6 100755
--- a/bus-logger/src/main/java/org/aoju/bus/logger/dialect/commons/ApacheCommonsLogFactory.java
+++ b/bus-logger/src/main/java/org/aoju/bus/logger/dialect/commons/ApacheCommonsLogFactory.java
@@ -43,20 +43,12 @@ public ApacheCommonsLogFactory() {
@Override
public Log createLog(String name) {
- try {
- return new ApacheCommonsLog4JLog(name);
- } catch (Exception e) {
- return new ApacheCommonsLog(name);
- }
+ return new ApacheCommonsLog(name);
}
@Override
public Log createLog(Class> clazz) {
- try {
- return new ApacheCommonsLog4JLog(clazz);
- } catch (Exception e) {
- return new ApacheCommonsLog(clazz);
- }
+ return new ApacheCommonsLog(clazz);
}
@Override
From dc1f3464ccb5d1f06f5ae9c9c1c39d541cdee128 Mon Sep 17 00:00:00 2001
From: Kimi Liu <839536@qq.com>
Date: Wed, 22 Jun 2022 11:22:45 +0800
Subject: [PATCH 8/9] v6.5.2
---
.../aoju/bus/limiter/support/rate/redis/RedisRatelimiter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bus-limiter/src/main/java/org/aoju/bus/limiter/support/rate/redis/RedisRatelimiter.java b/bus-limiter/src/main/java/org/aoju/bus/limiter/support/rate/redis/RedisRatelimiter.java
index a7acbcc22f..81db1b1743 100755
--- a/bus-limiter/src/main/java/org/aoju/bus/limiter/support/rate/redis/RedisRatelimiter.java
+++ b/bus-limiter/src/main/java/org/aoju/bus/limiter/support/rate/redis/RedisRatelimiter.java
@@ -73,7 +73,7 @@ public RateLimiterRedission(Config config) {
}
public RedisRatelimiterObject getRedisRatelimiterObject(String name) {
- return new RedisRatelimiterObject(connectionManager.getCommandExecutor(), name);
+ return new RedisRatelimiterObject(commandExecutor, name);
}
}
From 43a07873200e8d3283f71c99024e46ab34652820 Mon Sep 17 00:00:00 2001
From: Kimi Liu <839536@qq.com>
Date: Wed, 22 Jun 2022 11:54:37 +0800
Subject: [PATCH 9/9] v6.5.2
---
bus-starter/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bus-starter/pom.xml b/bus-starter/pom.xml
index a2f345f61e..75ff47598c 100755
--- a/bus-starter/pom.xml
+++ b/bus-starter/pom.xml
@@ -56,7 +56,7 @@
8.0.29
3.0.8
4.0.4
- 8.2.3
+ 7.17.4