Commit Graph
210 Commits
Author SHA1 Message Date
Daniel Watford 7830328bb4 Improved: Removed deprecated ExpectedException.none from tests
(OFBIZ-12137)

Prevents logging of deprecation warnings during the build.
2021-01-14 17:07:40 +00:00
Akash Jain 66a76ffd5a Improved: Fix Literals comparisons with variable to avoid NPE (OFBIZ-11929)
Thanks, Devanshu Vyas for your contribution.
2020-08-30 17:20:23 +05:30
Suraj Khurana 9689201b84 Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in framework component.
(OFBIZ-11963)
Also made some related checkstyle code enhancements.
Thanks jacques for finalizing Javadoc pattern during this effort.
2020-08-22 13:20:39 +05:30
Jacques Le Roux b80fc9075c Improved: Mark as deprecated ofbiz.locale.default and locale.properties.fallback properties (OFBIZ-11962)
It follows this dev thread: https://markmail.org/message/fzg7qrxgnxgbn65o

Also removes deprecation for EntityUtilProperties::getFallbackLocale
It was copied from UtilProperties::getFallbackLocale I guess
UtilProperties::getFallbackLocale is not deprecated and used in some place
2020-08-18 11:49:01 +02:00
Suraj Khurana 8c10d4ae72 Improved: Added missing Javadocs for some methods, this is required for all classes which looks like designed for extension (can be subclassed).
(OFBIZ-11947)
This is done for framework component. Also corrected some variables as per naming convention best practices.
Thanks Jacques for review.
2020-08-17 12:30:26 +05:30
Suraj Khurana 33f05c1684 Improved: Corrected all redundant modifiers occurences in framework component. Also, fixed some other checkstyle line formatting and spacing issues.
(OFBIZ-11925)
2020-08-06 18:53:13 +05:30
Suraj Khurana 7d82b17c72 Improved: Corrected some line is longer than 150 characters checkstyle issues in framework component. Also fixed some extra spaces and naming conventions related checkstyle issues.
(OFBIZ-11921)
2020-08-03 10:11:40 +05:30
Jacques Le Roux be498295a5 Improved: Update build.gradle to the latest dependencies (OFBIZ-11603)
Fixes some new warnings coming from JUnit 4.13, a step ahead to JUnit 5.

I left 2 complicated ExpectedException  warnings. Change will be needed for JUnit 5.
https://www.luxoft-training.com/news/migrating-from-junit-4-to-junit-5-replacing-rules-with-the-extension-model-part-1/
2020-07-27 16:14:51 +02:00
Suraj Khurana d374019465 Improved: Corrected all incorrect indentation level issues in framework component, also fixed some case indentation checkstyle issues.
(OFBIZ-11922)
2020-07-26 21:04:41 +05:30
Suraj Khurana 7b251e43d9 Improved: Corrected some single line statements to fix checkstyle issues, also removed some remaining extra spaces from code to avoid checkstyle erros in framework component.
(OFBIZ-11886)
2020-07-21 12:25:20 +05:30
Suraj Khurana dd4da77d76 Improved: Corrected checkstyle formatting issues, 'is preceded/not preceded with whitespace' for framework component.
(OFBIZ-11874)
This fixes following checkstyle issues:
'{' is not preceded with whitespace.
'{' is not followed by whitespace.
'}' is not followed by whitespace.
'}' is not preceded with whitespace.
'typecast' is not followed by whitespace.
'try' is not followed by whitespace.
';' is preceded with whitespace.
2020-07-11 14:33:47 +05:30
Suraj Khurana 3bb22302c7 Improved: Corrected all checkstyle issues related to succeeding space for comma in framework directory.
(OFBIZ-11805)
Thanks Jacques and Ritesh Kumar for review.
2020-07-09 12:07:29 +05:30
Suraj Khurana 4f53828bea Improved: Corrected all 'if is not followed by whitespace' checkstyle errors. Also corrected few ', is not followed by whitespace' checkstyle errors in framework component.
(OFBIZ-11805)
Thanks Jacques Le Roux and Ritesh Kumar for review.
2020-07-06 15:29:58 +05:30
Suraj Khurana abc7836dde Improved: Made MODULE as private data member of class instead of public in all framework components.
(OFBIZ-11739)
This will reduce checkstlye issues. Thanks Jacques for review.
2020-05-29 13:20:46 +05:30
Jacques Le Roux ddb8f4273a Improved: replaces module by MODULE everywhere 2020-04-05 19:46:34 +02:00
Mathieu Lirzin d4c59c3bde Improved: Inline ‘StartupControlPanel#createLogDirectoryIfMissing’.
Use a lambda instead of an anonymous class to implement a thread.
2019-12-08 00:33:11 +01:00
Mathieu Lirzin c982df72c2 Improved: Rewrite ‘Classpath’ class
(OFBIZ-11237)

This class has been moved to ‘org.apache.ofbiz.base.container’ to be
able to reduce its visibility to the “package” level.

The API has been change to avoid unnecessary checks and simpler dataflow.

There was no need to provide thread safety so the ‘synchronized’
blocks have been removed.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868027 13f79535-47bb-0310-9956-ffa450edef68
2019-10-05 15:44:21 +00:00
Mathieu Lirzin 6f54d35c91 Improved: Convert ‘Config#ofbizHome’ and ‘Config#logDir’ to a path
(OFBIZ-11192)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1867399 13f79535-47bb-0310-9956-ffa450edef68
2019-09-23 20:04:43 +00:00
Mathieu Lirzin 1fd1b030d9 Improved: Allow updating the ‘Config’ object of the server instance
(OFBIZ-11203)

When doing some informal tests, it is useful to be able to create
small programs using the OFBiz delegator without requiring every
components to be loaded as done by the ‘Start#main’ static method.

To achieve that with the current singleton based implementation, we
need to instantiate a custom ‘Config’ object and use it as the global
configuration.

Thanks: Samuel Trégouët for your contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1867343 13f79535-47bb-0310-9956-ffa450edef68
2019-09-22 12:56:08 +00:00
Mathieu Lirzin 4c70084b76 Improved: Separate resources from Java source files
(OFBIZ-11161)

This moves the resource files in a dedicated "src/main/resources"
directory.  This convention follows the Maven standard directory
layout which is the convention used by default in Gradle.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865717 13f79535-47bb-0310-9956-ffa450edef68
2019-08-22 20:38:01 +00:00
Mathieu Lirzin aa67827feb Improved: Move ‘AdminServer’ inside a container
(OFBIZ-11136)

‘AdminServer’ provides a portable way to manage life-cycle of the OFBiz
process remotely by allowing administrator to check its running status
or shutting it down.

Previously the ‘AdminServer’ class was a special thread opening a
socket and launched at startup.  However since this class is about
managing some run-time resources with a life-cycle, it matches perfectly
the container abstraction.

A benefit of making ‘AdminServer’ a container is that the startup
process is now simpler and more uniform.

Administrators can now prevent remote shutdown of OFBiz for security
reasons by removing the container declaration.  Additionally They can
delegate the process management job to the init process (PID 0) of the
hosting system like Systemd [1] by replacing this container with
another one.

[1] https://www.freedesktop.org/software/systemd/man/systemd-notify.html


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863024 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 22:27:04 +00:00
Mathieu Lirzin 72aba3778c Improved: Remove support for “ofbiz-containers.xml”
(OFBIZ-11100)

To extend the containers loaded on startup, it was possible too both
edit the “ofbiz-containers.xml” file or alternatively to define a
container in a component.

This redundancy adds extra complexity in the startup process for no
good extensibility reason. The component container loader is more
flexible since it allows developper to add new containers without
touching the framework so it is better to only rely on this option.

The component loader is now hard-coded directly in code.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863019 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 21:37:40 +00:00
Mathieu Lirzin 1e73b051b0 Improved: Avoid confusing indirections in ‘StartupControlPanel#start’
(OFBIZ-11137)

The ‘StartupControlPanel#start’ method is delegating its job to
smaller private methods to improve readability.  However the
conditionnals were previously hidden inside those methods with the
unfortunate consequence of making case analysis hard.

To avoid this undesirable effect, the conditionals has been moved
inside the ‘StartupControlPanel#start’ method and some delegate
methods has been inlined when their implementation was trivial.  The
parameters of the remaining delegate methods has be refined to avoid
passing around unneeded things.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862665 13f79535-47bb-0310-9956-ffa450edef68
2019-07-06 14:39:25 +00:00
Mathieu Lirzin 6925f7961b Improved: Rewrite ‘Start#determineCommandType’
(OFBIZ-11137)

Rename it to ‘Start.CommandType#valueOf’ and use a set to determine
the type of command instead of repetitive stream iterations.

Assuming ‘Set#contains’ is a constant operation, The algorithmic
complexity in worth case has dropped from O(n*m) to O(n+m) where n is
the number of command types and m is the number of startup commands.
In this particular case where n and m are small, the theorical gain
is not significative in term of actual performance.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862664 13f79535-47bb-0310-9956-ffa450edef68
2019-07-06 14:33:19 +00:00
Mathieu Lirzin ffe2e7ffdf Improved: Add missing ‘static’ modifier for private methods
(OFBIZ-11098)

In order to make it clear when a method is not depending on the
internal state of an object, it is a good practice to declare it as
static.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860937 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 12:27:40 +00:00
Mathieu Lirzin 3acf261b7f Fixed: Fix javadoc build for OpenJDK 11
(OFBIZ-10757)

This removes HTML5 deprecated stuff such as ‘<tt>’ elements, and
‘cellpadding’ table attributes which were breaking the ‘:javadoc’
Gradle task when using OpenJDK 11.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859123 13f79535-47bb-0310-9956-ffa450edef68
2019-05-11 20:36:45 +00:00
Mathieu Lirzin e34434000b Fixed: Remove unnecessary semicolons in Java code (OFBIZ-10936)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857904 13f79535-47bb-0310-9956-ffa450edef68
2019-04-21 10:55:18 +00:00
Taher A. Alkhateeb 61b35b92d0 Improved: Refactor the startup API to completely remove the startup loaders collection
This commit refactors the startup bootstrapping logic to remove any references to the
StartupLoader API and any related files. This is due to the fact that any loaders
including the old POS is completely removed from the system. Thus this improvement
simplifies the startup logic and makes it easier to maintain.

Thank you: Mathieu Lirzin for the patch, careful review and patience


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1852847 13f79535-47bb-0310-9956-ffa450edef68
2019-02-03 19:47:27 +00:00
Jacques Le Roux 3169855d36 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.base.start.
(OFBIZ-9573)

For r1815119  I wrote:
	No functional change, while reviewing r1811413
	I noticed we can use a try-with-ress here 
	Fixes a possible not closed 

As reported by Michael on dev ML:

	if I see it right, you have not implemented a try-with-resources block but 
	simply moved the stream declaration inside the try block and removed the 
	finally block. Please check.

Michael was right, here is the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818514 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 21:33:27 +00:00
Michael Brohl 795478841b Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.start.
(OFBIZ-9937)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818509 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 19:14:33 +00:00
Jacques Le Roux 34dbb04abd Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.base.start.
(OFBIZ-9573)

No functional change, while reviewing r1811413
I noticed we can use a try-with-ress here

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1815119 13f79535-47bb-0310-9956-ffa450edef68
2017-11-13 17:06:24 +00:00
Deepak Dixit 1620e4e0ca Improved: No functional change, Only added license header
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812309 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 18:43:14 +00:00
Taher A. Alkhateeb f3c80f7de3 Improved: removed dependency from start component on base
Debug class should not be used directly from the start component, hence replaced
it with standard System.out.println


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811566 13f79535-47bb-0310-9956-ffa450edef68
2017-10-09 12:45:20 +00:00
Michael Brohl bfa9e5adf6 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.base.start.
(OFBIZ-9573)

I slighly modified the patch because of a conflicting change.

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811413 13f79535-47bb-0310-9956-ffa450edef68
2017-10-07 12:07:16 +00:00
Taher A. Alkhateeb 3806cad490 Refactor OFBiz containers and remove StartupCommandToArgsAdapter
(OFBIZ-9441)

A major refactoring patch that applies the following changes:

- Fully refactor the EntityDataLoadContainer
- Fully refactor the TestRunContainer
- In both above mentioned containers the logic is broken up into smaller
  methods to enhance code readability. It also changes the signature of
  the method calls to rely on StartupCommand instead of String[] arrays
- Remove most old documentation and commented out code where applicable
- Delete the StratupCommandToArgsAdapter as it is no longer needed
- Create a new feature in which OFBiz by default fails if any data file
  fails to load. This can be overridden by passing a flag called
  "continue-on-failure" e.g. ./gradlew "ofbiz --load-data continue-on-failure"
- Add a new property to --test called "loglevel" (old code but working properly)
- Add many new properties to the --load-data command including repair-columns,
  try-inserts, maintain-txs, etc ... These properties are old, but somehow
  did not make it into the command line arguments. This code is now exposed
  through the command line to set a direction in the future of whether to
  keep or delete these extra commands
- Update the documentation output of ./gradlew "ofbiz --help" to incorporate
  the new mentioned properties
- Refactor README.md to incorporate the changes to the gradle commands for both
  "-load-data" and "-test" properties. Also remove the gradle GUI
  documentation as it is now deprecated.
- Also refactor README.md in other locations to cleanup and make it more
  consistent. This icludes moving long notes into new sections and reducing
  the verbosity of the security header. Furthermore, created a new header
  called Miscellaneous documentation to house the newly created sections
- lots of small changes to remove EOL white space

Thanks: Jacques Le Roux for reviewing and testing


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805947 13f79535-47bb-0310-9956-ffa450edef68
2017-08-23 18:56:15 +00:00
Jacques Le Roux bfd533ccc3 Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571)

No functional change.

We read at http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html : 
<<Using the integer fields in this class (such as ROUND_HALF_UP) to represent 
rounding mode is largely obsolete; the enumeration values of the RoundingMode 
enum, (such as RoundingMode.HALF_UP) should be used instead.>>

That's an easy global replacement. But it also needs to import the RoundingMode 
class. It was 26 files so I decided to rather clean all the imports in all files
 with the help of Eclipse.

This is a 1st step. I will need to closely look at 2 special class: UtilNumber
and Calculate.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804953 13f79535-47bb-0310-9956-ffa450edef68
2017-08-14 08:32:21 +00:00
Jacques Le Roux 98e89f33ff No functional trivial changes
When reviewing code, Eclipse complains: "Javadoc: Invalid param tag name"
when a param tag name "contains" a colon at end

Weirdly it does not complain about @return. Go figure! But I'll apply the same!

This removes all cases found in trunk. Another way could be to add a space 
between the tag and the colon. But that's not how it's recommended to write

http://www.oracle.com/technetwork/articles/java/index-137868.html

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804637 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 07:21:22 +00:00
Jacques Le Roux 75c40fef71 No functional trivial changes
When reviewing code, Eclipse complains: "Javadoc: Invalid param tag name"
when a param tag name "contains" a colon at end

This removes all cases found in trunk. Another way could be to add a space 
between the tag and the colon. But that's not how it's recommended to write

http://www.oracle.com/technetwork/articles/java/index-137868.html

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804635 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 06:31:38 +00:00
Taher A. Alkhateeb 707e8e86f5 Improved: Refactor Config.java and properties files
(OFBIZ-9435)

Another round of refactoring in the start component with the following changes:

- Change the default adminKey to "NA" since it is only used in the "start"
  context. Other contexts do not require an admin server (test, load-data)
- Simplify and cleanup the locale creation logic in the constructor and move
  things out to the method with a return value
- Simplify the Timezone creation logic by moving it outside the constructor into
  a small method
- Substantially simplify the determineOfbizPropertiesFileName(..) method by
  reversing the order of condition evaluation (first, load-data, then test, then
  anything else is start)
- Change default locale to be 'en' as the system crashes if not provided.
- Remove all comments from properties files except for start.properties and
  refer to it from the other properties files
- Update the properties files accordingly

Thanks: Jacques Le Roux for review and suggestion to remove the comments from
        properties files


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1800368 13f79535-47bb-0310-9956-ffa450edef68
2017-06-30 10:19:50 +00:00
James Yong e4a7a0ef72 Implemented: OFBiz Startup Message
(OFBIZ-9285)

Provide log message after all containers/components are loaded. 
This helps to inform new developer that OFBiz has started.

Thanks: Jacques and Taher for code review and mentoring.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1789533 13f79535-47bb-0310-9956-ffa450edef68
2017-03-30 15:26:37 +00:00
Taher A. Alkhateeb efb6f60510 Fixed: Regression: a commit between R15 and the Gradle switch uses/blocks the ports
(OFBIZ-9196)
Disabled the admin server from starting on contexts other than "start"

This commit has reference to the below discussion thread in which buildbot
is failing in between commits due to blocking the admin server thread.
The commit enables the admin server only for the "start" ofbiz server command.
For all other commands the port is set to value zero and hence the admin server
is never initialized

https://s.apache.org/xfxS

Thanks: Taher for the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1787627 13f79535-47bb-0310-9956-ffa450edef68
2017-03-19 14:55:13 +00:00
Jacques Le Roux 218fa05303 Fixed: JobPoller does not run and hence scheduled/async jobs are never run
(OFBIZ-9155)

Symptom:
* services that are invoked with "dispatcher.runAsync" stay "pending" in the 
job-list and never get executed
* scheduled jobs don't get executed

Steps to Reproduce
* Login to /webtools
* Schedule a Job to run in 5 mins, (for example service "clearAllEntityCaches")
* Wait 7mins

Expected:
* the scheduled service "clearAllEntityCaches" is not "pending" anymore but 
should have status "finished"

Actual:
* scheduled service "clearAllEntityCaches" is still "pending"

Analysis:
The problem can be reproduced with the OFBiz 16.11 branxh as well as 
with the OFBiz 16.11.01 zip file version and the trunk

JobPoller does get started on OFBiz start but does get stuck on line:
org.apache.ofbiz.service.job.JobPoller.java: 213-215 

The reason is that the "Start.ServerState" never reaches "RUNNING"

Doing a full-text scan through the whole source code shows, that there is no 
code at all that sets the ServerState to "RUNNING"

Comparing it to the 15.11-branch. There used to be a line:
serverState.compareAndSet(ServerState.STARTING, ServerState.RUNNING)

no such line exists in 16.11 anymore.

jleroux:  I confirm the behaviour in R16 branch as well as in trunk.

Leonard's "patch" is a good solution and works for the R16 branch which is less 
changed than the trunk when compared to R15. 

The same applies to the trunk with the relative block of code which contains
if (serverState.get() == ServerState.STOPPING) {

The line Leonard propose to add was obviously missed during the recent 
refactoring.

Thanks: Leonard Lin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1779596 13f79535-47bb-0310-9956-ffa450edef68
2017-01-20 09:56:56 +00:00
Taher A. Alkhateeb 9cdf1909ee Improved: Refactored Config.java to simplify fields initialization
Improvements remove in total roughly 70 lines of code and includes:

- moving all default values to the constructor to make it clear
- refactor getProperty to use the Optional monad
- remove FileInputStream from getPropertiesFile as it is not used
- properly indent conditions in determineOfbizPropertiesFileName
- simplify locale creation
- remove dependency on base (StringUtil)
- other minor renamings and formatting



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1775340 13f79535-47bb-0310-9956-ffa450edef68
2016-12-20 19:26:11 +00:00
Taher A. Alkhateeb 5953cb9e64 Improved: properly implement the Optional interface for retrieving portoffset
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1775238 13f79535-47bb-0310-9956-ffa450edef68
2016-12-20 09:35:11 +00:00
Taher A. Alkhateeb 8074a9b3c6 Improved: Refactor and simplify the startup sequence in OFBiz
(OFBIZ-8337)

This is another major commit to the refactoring of the startup sequence in
OFBiz with the following highlighted changes:

- Delete the NativeLibClassLoader.java
- Delete the native classpath logic in Classpath.java
- Refactor the ComponentContainer and StartupControlPanel to operate without
  the NativeLibClassLoader. This substantially simplifies the code
- Declare a URLClassLoader in ComponentContainer that is instantiated upon
  building the classpath for all components. This makes the classloader start
  in one shot
- Simplify the Config file and remove fields that are not used. Also
  refactor some messy logic for loading the props file and other code
  improvements
- Refactor all the .properties files for startup to have a consistent
  structure that clearly documents all available properties and the
  default value for each property. This change is also related to the
  changes applied on Config.java
- Remove the declaration of the StartupLoader implementation class
  from all startup .properties files because only one implementation exists
  and it should be the default always.
- Refactor the loaders retrieval code (main, rmi, test, load-data) defined
  in the startup .properties files
- Refactor some switch statements to comply with java coding standards
- Add the DTDs defined in base through Gradle because we removed the
  NativeLibClassLoader and the classpath buildup logic in StartupControlPanel

Thanks: Jacopo Cappellato for reviewing the work


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1772879 13f79535-47bb-0310-9956-ffa450edef68
2016-12-06 12:31:00 +00:00
Taher A. Alkhateeb aadf556625 Reverted: partially reverted r1765127 to fix classpath issue
(OFBIZ-8337)

The above mentioned revision introduced a regression in which starting
OFBiz in debug mode triggers classpath exceptions due to not finding
certain jars. Upon investigation we realized that the new logic
instantiates the loader class before the custom ClassLoader is
instantiated. The fix would take a bit more time, hence reverting now
to quickly resolve the issue and make the code base ready for the next
release. The revert essentially re-introduce a List<StartupLoader> data
set instead of a single StartupLoader.

This is a minimal revert (less than 400 lines) instead of a full revert
going above 2000 lines because we isolated only the parts that trigger the
regression mentioned above. However, we should ideally revisit this code
and clean it up again with careful attention to the class loading sequence.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1767866 13f79535-47bb-0310-9956-ffa450edef68
2016-11-03 11:03:54 +00:00
Taher A. Alkhateeb d44020f0d6 Improved: Refactor and simplify the startup sequence in OFBiz
(OFBIZ-8337)

This is a major refactoring exercise to simplify the startup sequence in
OFBiz. There are no functional changes, however, both the logic and the
API signatures of the core classes in OFBiz are changed to help simplify
the startup sequence. The changes insofar are summarized as:

- Rename ContainerConfig.Container to ContainerConfig.Configuration, the old
  nameing was very confusing as it confuses it with actual containers
- Change the signature of ContainerLoader and Container to accept
  List<StartupCommand> instead of String[]. And also migrate the adapter for
  converting these args into a standalone class called
  StartupCommandsToArgsAdapter
- Remove the LockedBy annotation as it is not used
- Substantially simplify the ContainerLoader load and unload logic and delete
  the start logic (merge it with load). The interface StartupLoader was updated
  accordingly
- Remove old logic to load containers in hot-deploy components
- Remove printThreadDump output from ContainerLoader which used to exist for
  debugging purposes and is no longer necessary
- Cleanup the AdminServer startup logic
- Change the StartupControlPanel logic to use only one StartupLoader instead
  of a list. The only implementation is ContainerLoader
- Remove the synchronized blocks in StartupControlPanel due to having only one
  loader
- Update the startup .properties files to reflect the changes in the startup
  logic
- Update the TestRunContainer to use List<StartupCommand> in its logic

We expect more commits (specifically to the containers) to complete this
refactoring initiative



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1765127 13f79535-47bb-0310-9956-ffa450edef68
2016-10-16 09:07:08 +00:00
Jacopo Cappellato e9ec720bed Improved: removed some unused methods from the Classpath class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761594 13f79535-47bb-0310-9956-ffa450edef68
2016-09-20 15:20:19 +00:00
Jacopo Cappellato f062e9b9e9 Improved: removed the no more required property
ofbiz.start.classpath.addFilesFromPath.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761589 13f79535-47bb-0310-9956-ffa450edef68
2016-09-20 15:03:56 +00:00
Jacques Le Roux d4d91995a5 The portoffset option does not only offset the default network port but all default ports
Better English from Scott (I wrote it right in the comment but not in the class)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758522 13f79535-47bb-0310-9956-ffa450edef68
2016-08-31 06:02:43 +00:00