Skip to content

Feature2.4.10 #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e0bbad1
enable configurable TimeZone for JSON parser in Nio and Http config
SummerBootFramework Jul 3, 2024
015e252
updated log4j2.xml
SummerBootFramework Jul 5, 2024
834c115
updated log4j2.xml
SummerBootFramework Jul 5, 2024
f0a0527
wip
SummerBootFramework Jul 8, 2024
1256a52
wip
SummerBootFramework Jul 8, 2024
c4b5434
afterProcess only get triggered when beforeProcess success
SummerBootFramework Jul 8, 2024
0ac314c
release2.4.9
SummerBootFramework Jul 9, 2024
b5cd448
fixed: rename config file will pause/resume service
SummerBootFramework Jul 11, 2024
8cdd21e
added CLI: -psv <envId>
SummerBootFramework Jul 17, 2024
be99f24
wip: config namespace
SummerBootFramework Jul 18, 2024
86e24a4
wip
SummerBootFramework Jul 24, 2024
18f8c23
refactoring
SummerBootFramework Jul 25, 2024
27316be
refactoring file upload handler
SummerBootFramework Jul 27, 2024
7203108
HttpClient: remotet Http response status will not be set to the respo…
SummerBootFramework Jul 27, 2024
907f07e
refactoring
SummerBootFramework Jul 31, 2024
0b30b18
support ISO9601 offset with no colon
SummerBootFramework Aug 2, 2024
16e6b2c
PingHandler returns status reason; NioServer only log status on change
SummerBootFramework Aug 3, 2024
162723a
refactoring
SummerBootFramework Aug 3, 2024
cdc80ef
PingHandler returns 502 Bad Gateway when service paused; 503 Service …
SummerBootFramework Aug 3, 2024
8500e28
refactoring: HealthInspector can set log level and status of pause/he…
SummerBootFramework Aug 3, 2024
e901d12
java doc plugin to 17
SummerBootFramework Aug 3, 2024
d7bbb48
service pause by multiple reasons via password, and can only be resum…
SummerBootFramework Aug 5, 2024
7c31d34
service pause by multiple reasons via password, and can only be resum…
SummerBootFramework Aug 5, 2024
cbbda7f
refactoring
SummerBootFramework Aug 5, 2024
e3050e4
refactoring
SummerBootFramework Aug 6, 2024
87c02c2
refactoring
SummerBootFramework Aug 6, 2024
69c3d94
refactoring
SummerBootFramework Aug 6, 2024
c414477
refactoring
SummerBootFramework Aug 6, 2024
6dbe1d3
refactoring
SummerBootFramework Aug 6, 2024
29ce735
refactoring
SummerBootFramework Aug 6, 2024
ffb12af
refactoring
SummerBootFramework Aug 7, 2024
d187e62
refactoring
SummerBootFramework Aug 7, 2024
7bc6cee
refactoring
SummerBootFramework Aug 7, 2024
c10370e
release2.4.10
SummerBootFramework Aug 7, 2024
705129d
Merge branch 'main' into feature2.4.10
SummerBootFramework Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.summerboot</groupId>
<artifactId>jexpress</artifactId>
<version>2.4.8</version>
<version>2.4.10</version>
<packaging>jar</packaging>
<name>Summer Boot jExpress</name>
<description>Summer Boot jExpress focuses on solving non-functional and operational maintainability requirements,
Expand Down Expand Up @@ -92,7 +92,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<configuration>
<source>11</source>
<source>17</source>
<!-- <aggregate>true</aggregate>-->
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
Expand Down Expand Up @@ -151,6 +151,16 @@
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>

<!-- <plugin>-->
<!-- <groupId>org.sonatype.central</groupId>-->
<!-- <artifactId>central-publishing-maven-plugin</artifactId>-->
<!-- <version>0.5.0</version>-->
<!-- <extensions>true</extensions>-->
<!-- <configuration>-->
<!-- <publishingServerId>central</publishingServerId>-->
<!-- </configuration>-->
<!-- </plugin>-->
</plugins>
</build>
<!-- Central Repository info -->
Expand All @@ -171,16 +181,16 @@
<properties>
<!-- common properties and dependencies -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.clean.version>3.3.2</maven.clean.version>
<maven.compiler.version>3.12.1</maven.compiler.version>
<maven.dependency.version>3.6.1</maven.dependency.version>
<maven.jar.version>3.3.0</maven.jar.version>
<maven.resources.version>3.3.1</maven.resources.version>
<maven-surefire.version>3.2.5</maven-surefire.version>
<!-- Commons -->
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-lang3.version>3.15.0</commons-lang3.version>
<commons-cli.version>1.8.0</commons-cli.version>
<commons-io.version>2.16.1</commons-io.version>
<!-- <commons-text.version>1.11.0</commons-text.version>-->
Expand All @@ -196,12 +206,12 @@
<jwt.version>0.11.5</jwt.version>

<!-- NIO Netty -->
<netty.version>4.1.111.Final</netty.version>
<netty.version>4.1.112.Final</netty.version>
<netty-tcnative.version>2.0.65.Final</netty-tcnative.version>
<!-- gRPC and protobuf -->
<grpc.version>1.64.0</grpc.version>
<grpc.version>1.65.1</grpc.version>
<guava.version>33.2.1-jre</guava.version>
<protobuf.version>4.27.1</protobuf.version>
<protobuf.version>4.27.3</protobuf.version>
<!-- Web JAX-RS -->
<swagger.core.version>2.2.22</swagger.core.version>
<!--<elastic-apm.version>1.36.0</elastic-apm.version>-->
Expand All @@ -215,10 +225,10 @@
<reflections.version>0.10.2</reflections.version>

<!-- JSON/XML/Bean Validation -->
<jackson.version>2.17.1</jackson.version>
<jackson.version>2.17.2</jackson.version>
<!-- Bean Validation -->
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<jakarta.el.version>6.0.0</jakarta.el.version>
<jakarta.el.version>6.0.1</jakarta.el.version>

<!-- IOC Injection -->
<guice.version>7.0.0</guice.version>
Expand All @@ -228,7 +238,7 @@
<hikari-cp.version>5.1.0</hikari-cp.version>

<!-- Cache -->
<jedis.version>5.1.3</jedis.version>
<jedis.version>5.1.4</jedis.version>

<quartz.version>2.5.0-rc1</quartz.version>
<mqtt.version>1.2.5</mqtt.version>
Expand All @@ -243,12 +253,12 @@
<openhtml.version>1.0.10</openhtml.version>
<batik-transcoder.version>1.17</batik-transcoder.version>
<!-- PDF - iText -->
<itext7-core.version>8.0.4</itext7-core.version>
<itext7-html2pdf.version>5.0.4</itext7-html2pdf.version>
<itext7-core.version>8.0.5</itext7-core.version>
<itext7-html2pdf.version>5.0.5</itext7-html2pdf.version>

<!-- Testing -->
<testng.version>7.10.2</testng.version>
<jdbc.version>8.4.0</jdbc.version>
<jdbc.version>9.0.0</jdbc.version>
</properties>

<dependencies>
Expand Down
42 changes: 27 additions & 15 deletions src/main/java/org/summerboot/jexpress/boot/BackOffice.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TimeZone;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -188,15 +187,15 @@ public Map<Integer, Integer> getBootErrorCodeMapping() {
private String portInUseAlertMessage = ALERT_MSG_PORT_IN_USE;

@Config(key = "backoffice.executor.core", defaultValue = "3",
desc = "MaxSize 0 = current computer/VM's available processors + 1")
desc = "0 = current computer/VM's available processors + 1")
private int tpeCore = 3;

@Config(key = "backoffice.executor.max", defaultValue = "" + Integer.MAX_VALUE,
desc = "MaxSize 0 = current computer/VM's available processors + 1")
private int tpeMax = Integer.MAX_VALUE;
@Config(key = "backoffice.executor.max", defaultValue = "3",
desc = "0 = current computer/VM's available processors + 1")
private int tpeMax = 3;

@Config(key = "backoffice.executor.queue", defaultValue = "0")
private int tpeQueue = 0;
@Config(key = "backoffice.executor.queue", defaultValue = "" + Integer.MAX_VALUE)
private int tpeQueue = Integer.MAX_VALUE;

@Config(key = "backoffice.executor.keepAliveTimeSec", defaultValue = "60")
private int tpeKeepAliveSeconds = 60;
Expand All @@ -207,10 +206,6 @@ public Map<Integer, Integer> getBootErrorCodeMapping() {
@Config(key = "backoffice.executor.allowCoreThreadTimeOut", defaultValue = "false")
private boolean allowCoreThreadTimeOut = false;

@Config(key = "backoffice.jsonParser.TimeZone", desc = "The ID for a TimeZone, either an abbreviation such as \"PST\", a full name such as \"America/Los_Angeles\", or a custom ID such as \"GMT-8:00\", or \"default\" as system default timezone.", defaultValue = "UTC")
private TimeZone timeZone = TimeZone.getTimeZone("UTC");//TimeZone.getDefault();


@ConfigHeader(title = "4.1 Default Path/File Naming")
@Config(key = "naming.folder.domainPrefix", defaultValue = "standalone")
private String domainFolderPrefix = "standalone";
Expand All @@ -236,6 +231,12 @@ public Map<Integer, Integer> getBootErrorCodeMapping() {
@Config(key = "naming.file.gRPCConfig", defaultValue = "cfg_grpc.properties")
private String gRPCConfigFileName = "cfg_grpc.properties";

@Config(key = "HealthMonitor.PauseLockCode.viaFile", defaultValue = "PauseLockCode.file")
private String pauseLockCodeViaFile = "PauseLockCode.file";

@Config(key = "HealthMonitor.PauseLockCode.viaWeb", defaultValue = "PauseLockCode.web")
private String pauseLockCodeViaWeb = "PauseLockCode.web";

@ConfigHeader(title = "4.2 Default Log4j2.xml Variables Naming")
@Config(key = "naming.log4j2.xml.var.logId", defaultValue = "logId")
private String log4j2LogId = "logId";
Expand Down Expand Up @@ -295,6 +296,9 @@ public Map<Integer, Integer> getBootErrorCodeMapping() {
@Config(key = "naming.cli.decrypt", defaultValue = "decrypt")
private String cliName_decrypt = "decrypt";

@Config(key = "naming.cli.psv", defaultValue = "psv")
private String cliName_psv = "psv";

@Config(key = "naming.memo.delimiter", defaultValue = ": ")
private String memoDelimiter = ": ";

Expand Down Expand Up @@ -334,10 +338,6 @@ public String getPortInUseAlertMessage() {
return portInUseAlertMessage;
}

public TimeZone getTimeZone() {
return timeZone;
}

public String getDomainFolderPrefix() {
return domainFolderPrefix;
}
Expand Down Expand Up @@ -370,6 +370,14 @@ public String getgRPCConfigFileName() {
return gRPCConfigFileName;
}

public String getPauseLockCodeViaFile() {
return pauseLockCodeViaFile;
}

public String getPauseLockCodeViaWeb() {
return pauseLockCodeViaWeb;
}

public String getLog4J2LogId() {
return log4j2LogId;
}
Expand Down Expand Up @@ -446,6 +454,10 @@ public String getCliName_decrypt() {
return cliName_decrypt;
}

public String getCliName_psv() {
return cliName_psv;
}

public String getMemoDelimiter() {
return memoDelimiter;
}
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/org/summerboot/jexpress/boot/BootConstant.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface BootConstant {
String APP_ID = String.format("%06d", new Random().nextInt(999999));

//version
String VERSION = "SummerBoot.jExpress 2.4.8";
String VERSION = "SummerBoot.jExpress 2.4.10";
String JEXPRESS_PACKAGE_NAME = "org.summerboot.jexpress";

String DEFAULT_ADMIN_MM = "changeit";
Expand Down Expand Up @@ -59,6 +59,13 @@ public interface BootConstant {
String FILE_CFG_NIO = BackOffice.agent.getNioConfigFileName();
String FILE_CFG_GRPC = BackOffice.agent.getgRPCConfigFileName();

String RESPONSE_HEADER_KEY_REF = "X-Reference";
String RESPONSE_HEADER_KEY_TS = "X-ServerTs";

String PAUSE_LOCK_CODE_VIAFILE = BackOffice.agent.getPauseLockCodeViaFile();
String PAUSE_LOCK_CODE_VIAWEB = BackOffice.agent.getPauseLockCodeViaWeb();


/*
* 4. jExpress Default CLI Name
*/
Expand All @@ -76,6 +83,7 @@ public interface BootConstant {
String CLI_JWT = BackOffice.agent.getCliName_jwt();
String CLI_ENCRYPT = BackOffice.agent.getCliName_encrypt();
String CLI_DECRYPT = BackOffice.agent.getCliName_decrypt();
String CLI_PSV = BackOffice.agent.getCliName_psv();
String MEMO_DELIMITER = BackOffice.agent.getMemoDelimiter();

/*
Expand Down
27 changes: 14 additions & 13 deletions src/main/java/org/summerboot/jexpress/boot/BootGuiceModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
import org.apache.commons.lang3.StringUtils;
import org.quartz.Scheduler;
import org.summerboot.jexpress.boot.annotation.Controller;
import org.summerboot.jexpress.boot.annotation.Inspector;
import org.summerboot.jexpress.boot.event.AppLifecycleHandler;
import org.summerboot.jexpress.boot.event.AppLifecycleListener;
import org.summerboot.jexpress.boot.event.HttpExceptionHandler;
import org.summerboot.jexpress.boot.event.HttpExceptionListener;
import org.summerboot.jexpress.boot.event.HttpLifecycleHandler;
import org.summerboot.jexpress.boot.event.HttpLifecycleListener;
import org.summerboot.jexpress.boot.instrumentation.BootHealthInspectorImpl;
import org.summerboot.jexpress.boot.instrumentation.HTTPClientStatusListener;
import org.summerboot.jexpress.boot.instrumentation.HealthInspector;
import org.summerboot.jexpress.boot.instrumentation.NIOStatusListener;
import org.summerboot.jexpress.boot.instrumentation.jmx.InstrumentationMgr;
import org.summerboot.jexpress.boot.instrumentation.jmx.InstrumentationMgrImpl;
Expand Down Expand Up @@ -107,9 +106,6 @@ public void configure() {
memo.append(INFO).append(ChannelHandler.class.getName()).append(BIND_TO).append(BootHttpPingHandler.class.getSimpleName()).append(", named=").append(BootHttpPingHandler.class.getSimpleName());

// 4. @Services
bind(HealthInspector.class).to(BootHealthInspectorImpl.class);
memo.append(INFO).append(HealthInspector.class.getName()).append(BIND_TO).append(BootHealthInspectorImpl.class.getName());

bind(AuthTokenCache.class).to(AuthTokenCacheLocalImpl.class);
memo.append(INFO).append(AuthTokenCache.class.getName()).append(BIND_TO).append(AuthTokenCacheLocalImpl.class.getName());

Expand All @@ -134,8 +130,9 @@ public void configure() {
bind(ChannelHandler.class).annotatedWith(Names.named(BootHttpRequestHandler.class.getSimpleName())).to(BootHttpRequestHandler.class);
memo.append(INFO).append(ChannelHandler.class.getName()).append(BIND_TO).append(BootHttpRequestHandler.class.getSimpleName()).append(", named=").append(BootHttpRequestHandler.class.getSimpleName());

// 5. Controllers
// 5. get instances
scanAnnotation_BindInstance(binder(), Controller.class, callerRootPackageName);
scanAnnotation_BindInstance(binder(), Inspector.class, callerRootPackageName);

// 6. caller's Main class (App.Main)
if (caller != null) {
Expand All @@ -149,7 +146,8 @@ public void configure() {
/**
* This method will be called by
* <pre>
* Guice.createInjector(...) from SummerBigBang.genesis(...) to trigger SummerBigBang.onGuiceInjectorCreated_ControllersInjected(@Controller {@code Map<String, Object>} controllers)
* Guice.createInjector(...) from SummerBigBang.genesis(...)
* it will trigger SummerBigBang.onGuiceInjectorCreated_ControllersInjected(@Controller {@code Map<String, Object>} controllers)
* </pre>
*
* @param binder
Expand All @@ -167,16 +165,19 @@ protected void scanAnnotation_BindInstance(Binder binder, Class<? extends Annota
Set<Class<?>> classes = ReflectionUtil.getAllImplementationsByAnnotation(annotation, false, rootPackageNames);
//classesAll.addAll(classes);
for (Class c : classes) {
Controller a = (Controller) c.getAnnotation(annotation);
String implTag = a.implTag();
if (StringUtils.isNotBlank(implTag) && !isCliUseImplTag(implTag)) {
continue;
}

//<A extends Annotation>
Annotation a = c.getAnnotation(annotation);
int mod = c.getModifiers();
if (Modifier.isAbstract(mod) || Modifier.isInterface(mod)) {
continue;
}
if (a instanceof Controller) {
Controller ca = (Controller) a;
String implTag = ca.implTag();
if (StringUtils.isNotBlank(implTag) && !isCliUseImplTag(implTag)) {
continue;
}
}
classesAll.add(c);
}
//}
Expand Down
Loading