Commit Graph
921 Commits
Author SHA1 Message Date
Adrian Crum a324ef7bb3 Some JavaDocs to help explain the Job behavior.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369491 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 22:17:02 +00:00
Adrian Crum 5779419ca3 Fixed a costly call to UtilValidate:
UtilValidate.isEmpty(Object) calls ObjectType.isEmpty(Object) - which performs a series of instanceof checks. Calling UtilValidate.isEmpty(String) avoids the expensive instanceof checks.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369486 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 22:07:18 +00:00
Adrian Crum 55f2c7de7e Fixed a bug in GenericServiceJob where the failed method would get called twice.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369485 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 22:06:24 +00:00
Adrian Crum 541679a972 Removed unnecessary Date object creation from GenericAsyncEngine.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369469 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 21:25:21 +00:00
Adrian Crum 6fdee332f5 Refactored Job implementations so they implement a state machine. This approach makes the code much simpler.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369467 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 21:24:27 +00:00
Erwan de Ferrieres 51c8310aae Fix javadoc for PersistedServiceJob.java
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369409 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 18:54:05 +00:00
Erwan de Ferrieres 7901b55e95 Fixing the javadoc for ServiceDispatcher.java
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369401 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 18:41:50 +00:00
Erwan de Ferrieres a41366e95f as suggested by Adrian, replacing @see by @Override in commit 1367751
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369357 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 16:15:36 +00:00
Adrian Crum 58aaab37cc A bunch of fixes for JobManager and JobPoller:
1. Fixed some concurrency issues during object construction.
2. Cleaned up some feature-envy code.
3. Added code for orderly startup and shutdown.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369298 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 12:00:07 +00:00
Adrian Crum f89887fe40 JobManager.java and JobPoller.java code formatting - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1369291 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 08:57:19 +00:00
Erwan de Ferrieres 6f363f4480 updating javadoc for Container#init
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1367751 13f79535-47bb-0310-9956-ffa450edef68
2012-07-31 20:25:26 +00:00
Jacopo Cappellato 12a1c7dbae Improved an old comment based on feedback from Jacques Le Roux
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1366294 13f79535-47bb-0310-9956-ffa450edef68
2012-07-27 06:31:36 +00:00
Jacopo Cappellato ea6cbf8ba9 Made locationMap thread safe using static initialization and immutability.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1365895 13f79535-47bb-0310-9956-ffa450edef68
2012-07-26 07:03:46 +00:00
Jacopo Cappellato 0abd7c2f6d Moved some (commented out) container definitions to the components they belong to.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1365889 13f79535-47bb-0310-9956-ffa450edef68
2012-07-26 05:51:54 +00:00
Jacopo Cappellato ec8a3624a7 Small change to skip the annoying thread sleep when no JMS configuration is found.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1365038 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 13:27:30 +00:00
Jacopo Cappellato 7a45106e87 Some minor cleanups
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364998 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 12:10:09 +00:00
Jacopo Cappellato fdacdb49c4 Refactored all JMS service related code to not depend on the ServiceDispatcher.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364990 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 11:47:12 +00:00
Adrian Crum bdc878b98e Now that client code no longer references the GenericDispatcher class, we can hide it in the factory.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364982 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 11:30:12 +00:00
Jacopo Cappellato bf7606987c changed some comments/docs to refer to LocalDispatcher instead of ServiceDispatcher
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364980 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 11:25:08 +00:00
Adrian Crum c1c4af837a Code cleanups/fixups and JavaDocs for the new service component classes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364972 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 10:46:08 +00:00
Jacopo Cappellato 955ae9eee1 A rather important refactoring of service related code:
* new factory interface for LocalDispatcher objects
* new factory implementation of GenericDispatcher
* new ServiceContainer container that initializes the factory (based on a configuration parameter)
* moved the getLocalDispatcher method out of GenericDispatcher and refactored (in a thread safe way) into ServiceContainer/GenericDispatcherFactory
* ServiceContainer also maintains the cache of LocalDispatchers that was managed by GenericDispatcher
* added code to ServiceContainer to deregister LocalDispatchers at shutdown: this finally fix the current code that was broken because the thread pool maintained by the JobPoller was never closed because of an issue with LocalDispatchers not being deregistered when not started by the ContextFilter
* change all code to call the ServiceContainer rather than GenericContainer to get a LocalDispatcher: now the implementation is no more directly referenced by calling code


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364952 13f79535-47bb-0310-9956-ffa450edef68
2012-07-24 09:16:26 +00:00
David E. Jones 3ec005ae79 Changed so that cus-obj element value is not in a CDATA block; it is already hex encoded so does not need to be in a CDATA block, and in entity exports of the RuntimeData entity it ends up being causing a nested CDATA block, which is not allowed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364822 13f79535-47bb-0310-9956-ffa450edef68
2012-07-23 22:10:29 +00:00
Jacopo Cappellato 7dcbf47605 Refactored DispatchContext class to be thread safe thru immutability; resorted its methods to improve the readability; added some comments to better describe it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364564 13f79535-47bb-0310-9956-ffa450edef68
2012-07-23 10:15:13 +00:00
Jacopo Cappellato 788647f571 Further cleanups to the DispatchContext class:
* service definitions are created automatically by the setDispatcher method in order to guarantee the validity of the object status
* removed get/setAttributes (and supporting field) that were an old and not used feature
* made the "name" field final (small step in the direction of improving the thread safety of the class, there is still some work to do here)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364512 13f79535-47bb-0310-9956-ffa450edef68
2012-07-23 06:35:03 +00:00
Jacopo Cappellato 85ee9e142b Small change to javadoc: it is not a good practice to refer to a specific implementation class in an interface method description
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364511 13f79535-47bb-0310-9956-ffa450edef68
2012-07-23 06:30:11 +00:00
Jacopo Cappellato e3ad85e49f First pass of a rather relevant cleanup of service related code:
* removed the support for serviceReaderUrls for local services specified in the WEB-INF folder; this feature was not used in years and OFBiz has better mechanisms to define services in components;
* as a consequence of the previous point, a lot of code has been cleaned in the DispatchContext class; in this refactoring, I have fixed some non thread safe code (but this is only a first step and this class needs to be enhanced under this aspect)
* greatly simplified the static instance creator and constructors of ServiceDispatcher and  GenericDispatcher to reflect the changes in DispatchContext but also removed old unused code, simplified code for readability, added some comments to better document it


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364222 13f79535-47bb-0310-9956-ffa450edef68
2012-07-22 07:33:48 +00:00
Jacopo Cappellato 6d0ba853f5 removed unused field
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1364044 13f79535-47bb-0310-9956-ffa450edef68
2012-07-21 08:34:17 +00:00
Jacopo Cappellato 0ab73e004f Fixed a comment.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1363701 13f79535-47bb-0310-9956-ffa450edef68
2012-07-20 09:58:57 +00:00
Jacopo Cappellato 0b2643c740 Small improvement: better log messages during system shutdown.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1363655 13f79535-47bb-0310-9956-ffa450edef68
2012-07-20 05:33:35 +00:00
Jacopo Cappellato 32165e83a7 Trivial cleanup: removed an unnecessary private field.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362492 13f79535-47bb-0310-9956-ffa450edef68
2012-07-17 13:41:27 +00:00
Jacopo Cappellato 2176d521e2 Removed an unnecessary synchronized block (because it was using as a lock the "this" instance and it was already inside of a synchronized method).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362485 13f79535-47bb-0310-9956-ffa450edef68
2012-07-17 13:32:16 +00:00
Jacopo Cappellato eed72271fb Changes to fix some thread unsafe code in the JobManager constructors.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362469 13f79535-47bb-0310-9956-ffa450edef68
2012-07-17 12:28:24 +00:00
Jacopo Cappellato 8693969ac4 Refactored the very old code in the org.ofbiz.service.job package to leverage the Executor framework of java.util.concurrent rather than relying on ad-hoc synchronization and thread management: the new code is simpler, smaller and it is now easier to review and change the execution policy; two attributes of service-config.xsd have been deprecated as they are not used in the new version ("jobs" and "wait-millis").
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362422 13f79535-47bb-0310-9956-ffa450edef68
2012-07-17 09:20:42 +00:00
Adrian Crum 60c0ab03d6 Bug fix in ServiceDispatcher.java: restore GenericDelegator state before throwing exception. https://issues.apache.org/jira/browse/OFBIZ-4967
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361958 13f79535-47bb-0310-9956-ffa450edef68
2012-07-16 09:58:58 +00:00
Adrian Crum 7c5c1aa4a8 Fixed semaphore handling issues in ServiceDispatcher.java. https://issues.apache.org/jira/browse/OFBIZ-4967
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361944 13f79535-47bb-0310-9956-ffa450edef68
2012-07-16 09:05:14 +00:00
Adrian Crum b6fb21c822 Removed ugly checkDebug method from ServiceDispatcher.java. https://issues.apache.org/jira/browse/OFBIZ-4967
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361931 13f79535-47bb-0310-9956-ffa450edef68
2012-07-16 08:12:16 +00:00
Adrian Crum 43a9cbef12 New feature - performance metrics. Service engine integration.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361725 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 16:10:50 +00:00
Jacopo Cappellato d743e3853b Replaced usage of java.util.Timer with the more modern and reliable ScheduledThreadPool executor.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1360691 13f79535-47bb-0310-9956-ffa450edef68
2012-07-12 14:16:43 +00:00
Adrian Crum a17298a06e Removed unused "authz" security code - https://issues.apache.org/jira/browse/OFBIZ-4839.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1360283 13f79535-47bb-0310-9956-ffa450edef68
2012-07-11 16:34:26 +00:00
Jacopo Cappellato 0b16982849 Moved rmi-dispatcher container definition to the service component.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1356074 13f79535-47bb-0310-9956-ffa450edef68
2012-07-02 05:55:25 +00:00
Jacopo Cappellato ea54b4ff18 Added new getName method to the Container interface and to all the implementations; added info messages to inform when containers are started/stopped.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1355854 13f79535-47bb-0310-9956-ffa450edef68
2012-07-01 07:32:07 +00:00
Jacopo Cappellato c386b7fc9a Added new "name" argument to the "init" method of the Component interface: now the name of the container (set by the xml attribute container.name) is passed to the init method and it is used to retrieve the container's configuration; before of this the container's name was hardcoded preventing the ability to define (and load) two containers (with different settings) of the same type.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1355652 13f79535-47bb-0310-9956-ffa450edef68
2012-06-30 06:32:00 +00:00
Jacopo Cappellato 259bc681d6 Added new field "Current Retry Count" and logic to keep track of failed job executions; before this enhancement the check against maxRetry was done querying failed records and the approach had performance issues and could be unreliable because failed records can be purged. However the old mechanism is still used when the new field is not set for backward compatibility.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1354041 13f79535-47bb-0310-9956-ffa450edef68
2012-06-26 14:52:06 +00:00
Jacopo Cappellato bdf7a4702c Enhancement for JobSandbox: the job execution result message (success/error/exception messages) is now stored in the new field JobSandbox.jobResult
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353905 13f79535-47bb-0310-9956-ffa450edef68
2012-06-26 09:53:07 +00:00
Jacopo Cappellato cecbe18a5c Reverting a local unwanted change that I committed in rev. 1353686; thanks to Jacques for the review.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353736 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 20:49:01 +00:00
Jacopo Cappellato d7d999966c Fixed a few wrong attribute names: authorization --> authz
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353686 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 18:00:01 +00:00
Hans Bakker 26be6e9d7c Give ACCOUNTING_ADMIN the same access as PAY_INFO_ADMIN because part of accounting component
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353381 13f79535-47bb-0310-9956-ffa450edef68
2012-06-25 02:22:58 +00:00
Jacopo Cappellato 15fe323128 Removed some junk and unused code left over after the commit:
Author: jleroux
Date: Fri Jun  3 19:05:07 2011
New Revision: 1131144

was "reverted" as part of:
 
 Author: jleroux
 Date: Fri Sep 23 19:22:40 2011
 New Revision: 1174964
 
 The code is still broken.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1353094 13f79535-47bb-0310-9956-ffa450edef68
2012-06-23 08:33:01 +00:00
Hans Bakker bd16dfb598 split up securitypermissions as seed data and securitygroups as demo data with a single exception: the creation of a super security group which has general access to the system and which is used with the 'ant create-admin-user-login' command.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1352431 13f79535-47bb-0310-9956-ffa450edef68
2012-06-21 07:21:49 +00:00
Hans Bakker 14f4e5a292 reverted recent security file changes revisions: 1350847,1350843,1350840,1348534,1347908,1347213,1346264, need more investigation
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1351206 13f79535-47bb-0310-9956-ffa450edef68
2012-06-18 04:36:20 +00:00