juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jamesbognar closed pull request #4: [JUNEAU-72] Offer an option to disable console IO from
Date Sat, 13 Oct 2018 14:17:20 GMT
jamesbognar closed pull request #4: [JUNEAU-72] Offer an option to disable console IO from
URL: https://github.com/apache/juneau/pull/4
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Microservice.java
b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Microservice.java
index f31b8af0e..920b4fdda 100755
--- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Microservice.java
+++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Microservice.java
@@ -582,23 +582,25 @@ public void onChange(ConfigFile cf, Set<String> changes) {
 		// --------------------------------------------------------------------------------
 		// Add exit listeners.
 		// --------------------------------------------------------------------------------
-		new Thread() {
-			@Override /* Thread */
-			public void run() {
-				Console c = System.console();
-				if (c == null)
-					System.out.println("No available console.");
-				else {
-					while (true) {
-						String l = c.readLine("\nEnter 'exit' to exit.\n");
-						if (l == null || l.equals("exit")) {
-							Microservice.this.stop();
-							break;
+		if (cf.getBoolean("Console/enableIO", true)) {
+			new Thread() {
+				@Override /* Thread */
+				public void run() {
+					Console c = System.console();
+					if (c == null)
+						System.out.println("No available console.");
+					else {
+						while (true) {
+							String l = c.readLine("\nEnter 'exit' to exit.\n");
+							if (l == null || l.equals("exit")) {
+								Microservice.this.stop();
+								break;
+							}
 						}
 					}
 				}
-			}
-		}.start();
+			}.start();
+		}
 		Runtime.getRuntime().addShutdownHook(
 			new Thread() {
 				@Override /* Thread */


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message