You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/11/11 12:23:49 UTC

[GitHub] [james-project] ottoka opened a new pull request #744: JAMES-3668 Extra system properties from configuration file

ottoka opened a new pull request #744:
URL: https://github.com/apache/james-project/pull/744


   Many aspects of JVM execution for James can be tweaked by system properties. However, a lot of them will clutter the command line and can become difficult to manage.
   
   The solution is to read a properties file and set the contents as system properties. Since this can affect various class initializations, it should be done as soon as possible, e.g. immediately as first line of the server main() method.
   
   This proposal adds a small utility class for this purpose. It will read a configuration file "conf/jvm.properties" if present, otherwise do nothing. The location of the file may be overridden by a system property "extra.props" for quick testing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa merged pull request #744: JAMES-3668 Extra system properties from configuration file

Posted by GitBox <gi...@apache.org>.
chibenwa merged pull request #744:
URL: https://github.com/apache/james-project/pull/744


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] ottoka commented on pull request #744: JAMES-3668 Extra system properties from configuration file

Posted by GitBox <gi...@apache.org>.
ottoka commented on pull request #744:
URL: https://github.com/apache/james-project/pull/744#issuecomment-966280480


   I am not sure what to put into the sample files, the stuff we have in there are highly project specific and likely won't help anybody else. I could put a mostly empty one with a comment saying "put any system properties here that you don't want on the command line". Any thoughts?
   
   I don't think the JIB jvmFlags are a good fit, as they are a critical part of system setup that people should not override. 
   
   I do agree that there should be documentation for this feature though, I will write some and deliver it in the next push.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] ottoka commented on pull request #744: JAMES-3668 Extra system properties from configuration file

Posted by GitBox <gi...@apache.org>.
ottoka commented on pull request #744:
URL: https://github.com/apache/james-project/pull/744#issuecomment-966478671


   Now with documentation (TM)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on a change in pull request #744: JAMES-3668 Extra system properties from configuration file

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #744:
URL: https://github.com/apache/james-project/pull/744#discussion_r747929644



##########
File path: server/container/guice/common/src/main/java/org/apache/james/ExtraProperties.java
##########
@@ -0,0 +1,47 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+public class ExtraProperties {
+
+    public static final String OVERRIDE_PROPERTY = "extra.props";
+    public static final String DEFAULT_PATH = "conf/jvm.properties";
+
+    private ExtraProperties() {
+    }

Review comment:
       We tend not to write such private constructor to prevent instanciation of the class.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] ottoka commented on a change in pull request #744: JAMES-3668 Extra system properties from configuration file

Posted by GitBox <gi...@apache.org>.
ottoka commented on a change in pull request #744:
URL: https://github.com/apache/james-project/pull/744#discussion_r748026935



##########
File path: server/container/guice/common/src/main/java/org/apache/james/ExtraProperties.java
##########
@@ -0,0 +1,47 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+public class ExtraProperties {
+
+    public static final String OVERRIDE_PROPERTY = "extra.props";
+    public static final String DEFAULT_PATH = "conf/jvm.properties";
+
+    private ExtraProperties() {
+    }

Review comment:
       OK, some do some don't. I removed it to keep things James style.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org