You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2007/10/21 06:08:19 UTC
svn commit: r586856 [1/3] - in
/ofbiz/trunk/framework/service/src/org/ofbiz/service: ./ eca/ engine/
group/ jms/ job/ mail/ rmi/ test/
Author: doogie
Date: Sat Oct 20 21:08:17 2007
New Revision: 586856
URL: http://svn.apache.org/viewvc?rev=586856&view=rev
Log:
The last of the java 1.5 markup.
Modified:
ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/GeneralServiceException.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericRequester.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericResultWaiter.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericServiceCallback.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelNotification.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/WebAppDispatcher.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/AbstractEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BSFEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/HttpEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/InterfaceEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/RouteEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupModel.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/job/GenericServiceJob.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcher.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcherImpl.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceEngine.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceEngineTests.java
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java Sat Oct 20 21:08:17 2007
@@ -132,7 +132,7 @@
* @return Map contains any valid values
* @throws GenericServiceException
*/
- public Map makeValidContext(String serviceName, String mode, Map context) throws GenericServiceException {
+ public Map<String, Object> makeValidContext(String serviceName, String mode, Map<String, Object> context) throws GenericServiceException {
ModelService model = this.getModelService(serviceName);
return makeValidContext(model, mode, context);
@@ -147,8 +147,8 @@
* @return Map contains any valid values
* @throws GenericServiceException
*/
- public Map makeValidContext(ModelService model, String mode, Map context) throws GenericServiceException {
- Map newContext;
+ public Map<String, Object> makeValidContext(ModelService model, String mode, Map<String, Object> context) throws GenericServiceException {
+ Map<String, Object> newContext;
int modeInt = 0;
if (mode.equalsIgnoreCase("in")) {
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GeneralServiceException.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GeneralServiceException.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/GeneralServiceException.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GeneralServiceException.java Sat Oct 20 21:08:17 2007
@@ -32,7 +32,7 @@
protected List<Object> errorMsgList = null;
protected Map<String, ? extends Object> errorMsgMap = null;
- protected Map nestedServiceResult = null;
+ protected Map<String, ? extends Object> nestedServiceResult = null;
public GeneralServiceException() {
super();
@@ -50,14 +50,14 @@
super(nested);
}
- public GeneralServiceException(String str, List<? extends Object> errorMsgList, Map<String, ? extends Object> errorMsgMap, Map nestedServiceResult, Throwable nested) {
+ public GeneralServiceException(String str, List<? extends Object> errorMsgList, Map<String, ? extends Object> errorMsgMap, Map<String, ? extends Object> nestedServiceResult, Throwable nested) {
super(str, nested);
this.errorMsgList = UtilMisc.makeListWritable(errorMsgList);
this.errorMsgMap = errorMsgMap;
this.nestedServiceResult = nestedServiceResult;
}
- public Map returnError(String module) {
+ public Map<String, Object> returnError(String module) {
String errMsg = this.getMessage() == null ? "Error in Service" : this.getMessage();
if (this.getNested() != null) {
Debug.logError(this.getNested(), errMsg, module);
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java Sat Oct 20 21:08:17 2007
@@ -47,7 +47,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#schedule(java.lang.String, java.lang.String, java.util.Map, long, int, int, int, long, int)
*/
- public void schedule(String poolName, String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException {
+ public void schedule(String poolName, String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException {
schedule(null, poolName, serviceName, context, startTime, frequency, interval, count, endTime, maxRetry);
}
@@ -58,7 +58,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#schedule(java.lang.String, java.lang.String, java.lang.String, java.util.Map, long, int, int, int, long, int)
*/
- public void schedule(String jobName, String poolName, String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException {
+ public void schedule(String jobName, String poolName, String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException {
try {
getJobManager().schedule(jobName, poolName, serviceName, context, startTime, frequency, interval, count, endTime, maxRetry);
@@ -84,7 +84,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#setRollbackService(java.lang.String, java.util.Map, boolean)
*/
- public void addRollbackService(String serviceName, Map context, boolean persist) throws GenericServiceException {
+ public void addRollbackService(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException {
ServiceXaWrapper xa = new ServiceXaWrapper(this.getDispatchContext());
xa.setRollbackService(serviceName, context, true, persist);
try {
@@ -102,7 +102,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#setCommitService(java.lang.String, java.util.Map, boolean)
*/
- public void addCommitService(String serviceName, Map context, boolean persist) throws GenericServiceException {
+ public void addCommitService(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException {
ServiceXaWrapper xa = new ServiceXaWrapper(this.getDispatchContext());
xa.setCommitService(serviceName, context, true, persist);
try {
@@ -120,7 +120,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#schedule(java.lang.String, java.util.Map, long, int, int, int, long)
*/
- public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException {
+ public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException {
ModelService model = ctx.getModelService(serviceName);
schedule(null, serviceName, context, startTime, frequency, interval, count, endTime, model.maxRetry);
}
@@ -132,7 +132,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#schedule(java.lang.String, java.util.Map, long, int, int, int)
*/
- public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count) throws GenericServiceException {
+ public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count) throws GenericServiceException {
schedule(serviceName, context, startTime, frequency, interval, count, 0);
}
@@ -143,7 +143,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#schedule(java.lang.String, java.util.Map, long, int, int, long)
*/
- public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException {
+ public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException {
schedule(serviceName, context, startTime, frequency, interval, -1, endTime);
}
@@ -154,7 +154,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#schedule(java.lang.String, java.util.Map, long)
*/
- public void schedule(String serviceName, Map context, long startTime) throws GenericServiceException {
+ public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime) throws GenericServiceException {
schedule(serviceName, context, startTime, RecurrenceRule.DAILY, 1, 1);
}
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java Sat Oct 20 21:08:17 2007
@@ -131,7 +131,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runSync(java.lang.String, java.util.Map)
*/
- public Map runSync(String serviceName, Map context) throws ServiceValidationException, GenericServiceException {
+ public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context) throws ServiceValidationException, GenericServiceException {
ModelService service = ctx.getModelService(serviceName);
return dispatcher.runSync(this.name, service, context);
}
@@ -143,7 +143,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runSync(java.lang.String, java.util.Map, int, boolean)
*/
- public Map runSync(String serviceName, Map context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
ModelService service = ctx.getModelService(serviceName);
// clone the model service for updates
ModelService cloned = new ModelService(service);
@@ -161,7 +161,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runSyncIgnore(java.lang.String, java.util.Map)
*/
- public void runSyncIgnore(String serviceName, Map context) throws GenericServiceException {
+ public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException {
ModelService service = ctx.getModelService(serviceName);
dispatcher.runSyncIgnore(this.name, service, context);
}
@@ -173,7 +173,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runSyncIgnore(java.lang.String, java.util.Map)
*/
- public void runSyncIgnore(String serviceName, Map context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
ModelService service = ctx.getModelService(serviceName);
// clone the model service for updates
ModelService cloned = new ModelService(service);
@@ -191,7 +191,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runAsync(java.lang.String, java.util.Map, org.ofbiz.service.GenericRequester, boolean, int, boolean)
*/
- public void runAsync(String serviceName, Map context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
ModelService service = ctx.getModelService(serviceName);
// clone the model service for updates
ModelService cloned = new ModelService(service);
@@ -209,7 +209,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runAsync(java.lang.String, java.util.Map, org.ofbiz.service.GenericRequester, boolean)
*/
- public void runAsync(String serviceName, Map context, GenericRequester requester, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
ModelService service = ctx.getModelService(serviceName);
dispatcher.runAsync(this.name, service, context, requester, persist);
}
@@ -221,7 +221,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runAsync(java.lang.String, java.util.Map, org.ofbiz.service.GenericRequester)
*/
- public void runAsync(String serviceName, Map context, GenericRequester requester) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
runAsync(serviceName, context, requester, true);
}
@@ -232,7 +232,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runAsync(java.lang.String, java.util.Map, boolean)
*/
- public void runAsync(String serviceName, Map context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runAsync(String serviceName, Map<String, ? extends Object> context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
ModelService service = ctx.getModelService(serviceName);
dispatcher.runAsync(this.name, service, context, persist);
}
@@ -244,7 +244,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runAsync(java.lang.String, java.util.Map)
*/
- public void runAsync(String serviceName, Map context) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runAsync(String serviceName, Map<String, ? extends Object> context) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
runAsync(serviceName, context, true);
}
@@ -255,7 +255,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runAsyncWait(java.lang.String, java.util.Map, boolean)
*/
- public GenericResultWaiter runAsyncWait(String serviceName, Map context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
GenericResultWaiter waiter = new GenericResultWaiter();
this.runAsync(serviceName, context, waiter, persist);
return waiter;
@@ -268,7 +268,7 @@
/**
* @see org.ofbiz.service.LocalDispatcher#runAsyncWait(java.lang.String, java.util.Map)
*/
- public GenericResultWaiter runAsyncWait(String serviceName, Map context) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
return runAsyncWait(serviceName, context, true);
}
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericRequester.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericRequester.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericRequester.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericRequester.java Sat Oct 20 21:08:17 2007
@@ -30,7 +30,7 @@
* Receive the result of an asynchronous service call
* @param result Map of name, value pairs composing the result
*/
- public void receiveResult(Map result);
+ public void receiveResult(Map<String, Object> result);
/**
* Receive an exception (Throwable) from an asynchronous service cell
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericResultWaiter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericResultWaiter.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericResultWaiter.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericResultWaiter.java Sat Oct 20 21:08:17 2007
@@ -38,13 +38,13 @@
private boolean completed = false;
private int status = -1;
- private Map result = null;
+ private Map<String, Object> result = null;
private Throwable t = null;
/**
* @see org.ofbiz.service.GenericRequester#receiveResult(java.util.Map)
*/
- public synchronized void receiveResult(Map result) {
+ public synchronized void receiveResult(Map<String, Object> result) {
this.result = result;
completed = true;
status = SERVICE_FINISHED;
@@ -93,7 +93,7 @@
* Gets the results of the service or null if none
* @return Map
*/
- public synchronized Map getResult() {
+ public synchronized Map<String, Object> getResult() {
if (!isCompleted())
throw new java.lang.IllegalStateException("Cannot return result, asynchronous call has not completed.");
return result;
@@ -103,7 +103,7 @@
* Waits for the service to complete
* @return Map
*/
- public synchronized Map waitForResult() {
+ public synchronized Map<String, Object> waitForResult() {
return this.waitForResult(10);
}
@@ -112,7 +112,7 @@
* @param milliseconds
* @return Map
*/
- public synchronized Map waitForResult(long milliseconds) {
+ public synchronized Map<String, Object> waitForResult(long milliseconds) {
if (Debug.verboseOn()) Debug.logVerbose("Waiting for results...", module);
while (!isCompleted()) {
try {
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericServiceCallback.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericServiceCallback.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericServiceCallback.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericServiceCallback.java Sat Oct 20 21:08:17 2007
@@ -23,7 +23,7 @@
public interface GenericServiceCallback {
public boolean isEnabled();
- public void receiveEvent(Map context);
- public void receiveEvent(Map context, Map result);
- public void receiveEvent(Map context, Throwable error);
+ public void receiveEvent(Map<String, Object> context);
+ public void receiveEvent(Map<String, Object> context, Map<String, Object> result);
+ public void receiveEvent(Map<String, Object> context, Throwable error);
}
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java Sat Oct 20 21:08:17 2007
@@ -39,8 +39,8 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public Map runSync(String serviceName, Map context) throws GenericServiceException;
- public Map runSync(String serviceName, Object... context) throws GenericServiceException;
+ public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException;
+ public Map<String, Object> runSync(String serviceName, Object... context) throws GenericServiceException;
/**
* Run the service synchronously with a specified timeout and return the result.
@@ -53,8 +53,8 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public Map runSync(String serviceName, Map context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
- public Map runSync(String serviceName, int transactionTimeout, boolean requireNewTransaction, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public Map<String, Object> runSync(String serviceName, int transactionTimeout, boolean requireNewTransaction, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
* Run the service synchronously and IGNORE the result.
@@ -64,7 +64,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runSyncIgnore(String serviceName, Map context) throws GenericServiceException;
+ public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException;
public void runSyncIgnore(String serviceName, Object... context) throws GenericServiceException;
/**
@@ -77,7 +77,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runSyncIgnore(String serviceName, Map context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
public void runSyncIgnore(String serviceName, int transactionTimeout, boolean requireNewTransaction, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
@@ -92,7 +92,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runAsync(String serviceName, Map context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
public void runAsync(String serviceName, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
@@ -105,7 +105,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runAsync(String serviceName, Map context, GenericRequester requester, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
public void runAsync(String serviceName, GenericRequester requester, boolean persist, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
@@ -118,7 +118,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runAsync(String serviceName, Map context, GenericRequester requester) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
public void runAsync(String serviceName, GenericRequester requester, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
@@ -130,7 +130,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runAsync(String serviceName, Map context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public void runAsync(String serviceName, Map<String, ? extends Object> context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
public void runAsync(String serviceName, boolean persist, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
@@ -141,7 +141,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runAsync(String serviceName, Map context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public void runAsync(String serviceName, Map<String, ? extends Object> context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
public void runAsync(String serviceName, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
@@ -154,7 +154,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public GenericResultWaiter runAsyncWait(String serviceName, Map context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
public GenericResultWaiter runAsyncWait(String serviceName, boolean persist, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
@@ -166,7 +166,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public GenericResultWaiter runAsyncWait(String serviceName, Map context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
+ public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
public GenericResultWaiter runAsyncWait(String serviceName, Object... context) throws ServiceAuthException, ServiceValidationException, GenericServiceException;
/**
@@ -191,7 +191,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void schedule(String poolName, String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException;
+ public void schedule(String poolName, String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException;
public void schedule(String poolName, String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, Object... context) throws GenericServiceException;
/**
@@ -210,7 +210,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void schedule(String jobName, String poolName, String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException;
+ public void schedule(String jobName, String poolName, String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws GenericServiceException;
public void schedule(String jobName, String poolName, String serviceName, long startTime, int frequency, int interval, int count, long endTime, int maxRetry, Object... context) throws GenericServiceException;
@@ -225,7 +225,7 @@
* @param endTime The time in milliseconds the service should expire
* @throws GenericServiceException
*/
- public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException;
+ public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException;
public void schedule(String serviceName, long startTime, int frequency, int interval, int count, long endTime, Object... context) throws GenericServiceException;
/**
@@ -238,7 +238,7 @@
* @param count The number of times to repeat.
* @throws GenericServiceException
*/
- public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count) throws GenericServiceException;
+ public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count) throws GenericServiceException;
public void schedule(String serviceName, long startTime, int frequency, int interval, int count, Object... context) throws GenericServiceException;
/**
@@ -251,7 +251,7 @@
* @param endTime The time in milliseconds the service should expire
* @throws GenericServiceException
*/
- public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException;
+ public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException;
public void schedule(String serviceName, long startTime, int frequency, int interval, long endTime, Object... context) throws GenericServiceException;
/**
@@ -261,7 +261,7 @@
* @param startTime The time to run this service.
* @throws GenericServiceException
*/
- public void schedule(String serviceName, Map context, long startTime) throws GenericServiceException;
+ public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime) throws GenericServiceException;
public void schedule(String serviceName, long startTime, Object... context) throws GenericServiceException;
@@ -272,7 +272,7 @@
* @param persist
* @throws GenericServiceException
*/
- public void addRollbackService(String serviceName, Map context, boolean persist) throws GenericServiceException;
+ public void addRollbackService(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException;
public void addRollbackService(String serviceName, boolean persist, Object... context) throws GenericServiceException;
/**
@@ -282,7 +282,7 @@
* @param persist
* @throws GenericServiceException
*/
- public void addCommitService(String serviceName, Map context, boolean persist) throws GenericServiceException;
+ public void addCommitService(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException;
public void addCommitService(String serviceName, boolean persist, Object... context) throws GenericServiceException;
/**
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelNotification.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelNotification.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelNotification.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelNotification.java Sat Oct 20 21:08:17 2007
@@ -40,13 +40,13 @@
public String notificationEvent;
public String notificationMode;
- public void callNotify(DispatchContext dctx, ModelService model, Map context, Map result) {
+ public void callNotify(DispatchContext dctx, ModelService model, Map<String, ? extends Object> context, Map<String, Object> result) {
String thisEvent = (String) result.get(ModelService.RESPONSE_MESSAGE);
if (notificationEvent.equals(thisEvent)) {
String notificationService = this.getService();
if (notificationService != null) {
try {
- Map notifyContext = this.buildContext(context, result, model);
+ Map<String, Object> notifyContext = this.buildContext(context, result, model);
dctx.getDispatcher().runSync(getService(), notifyContext, 90, true);
} catch (GenericServiceException e) {
Debug.logError(e, module);
@@ -55,7 +55,7 @@
}
}
- public Map buildContext(Map context, Map result, ModelService model) throws GenericServiceException {
+ public Map<String, Object> buildContext(Map<String, ? extends Object> context, Map<String, Object> result, ModelService model) throws GenericServiceException {
Map<String, Object> userLogin = UtilGenerics.checkMap(context.get("userLogin"));
String partyId = null;
if (userLogin != null) {
@@ -77,8 +77,8 @@
}
// template context
- Map notifyContext = FastMap.newInstance();
- Map bodyParams = FastMap.newInstance();
+ Map<String, Object> notifyContext = FastMap.newInstance();
+ Map<String, Object> bodyParams = FastMap.newInstance();
bodyParams.put("serviceContext", context);
bodyParams.put("serviceResult", result);
bodyParams.put("service", model);
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermGroup.java Sat Oct 20 21:08:17 2007
@@ -37,7 +37,7 @@
public List<ModelPermission> permissions = new LinkedList<ModelPermission>();
public String joinType;
- public boolean evalPermissions(DispatchContext dctx, Map context) {
+ public boolean evalPermissions(DispatchContext dctx, Map<String, ? extends Object> context) {
if (permissions != null && permissions.size() > 0) {
boolean foundOne = false;
for (ModelPermission perm: permissions) {
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelPermission.java Sat Oct 20 21:08:17 2007
@@ -47,7 +47,7 @@
public String action = null;
public String clazz = null;
- public boolean evalPermission(DispatchContext dctx, Map context) {
+ public boolean evalPermission(DispatchContext dctx, Map<String, ? extends Object> context) {
GenericValue userLogin = (GenericValue) context.get("userLogin");
Security security = dctx.getSecurity();
if (userLogin == null) {
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java Sat Oct 20 21:08:17 2007
@@ -355,7 +355,7 @@
return count;
}
- public void updateDefaultValues(Map context, String mode) {
+ public void updateDefaultValues(Map<String, Object> context, String mode) {
List<ModelParam> params = this.getModelParamList();
if (params != null) {
for (ModelParam param: params) {
@@ -375,9 +375,9 @@
* @param test The Map object to test
* @param mode Test either mode IN or mode OUT
*/
- public void validate(Map test, String mode, Locale locale) throws ServiceValidationException {
- Map requiredInfo = FastMap.newInstance();
- Map optionalInfo = FastMap.newInstance();
+ public void validate(Map<String, ? extends Object> test, String mode, Locale locale) throws ServiceValidationException {
+ Map<String, String> requiredInfo = FastMap.newInstance();
+ Map<String, String> optionalInfo = FastMap.newInstance();
boolean verboseOn = Debug.verboseOn();
if (verboseOn) Debug.logVerbose("[ModelService.validate] : {" + this.name + "} : Validating context - " + test, module);
@@ -403,19 +403,16 @@
}
// get the test values
- Map requiredTest = FastMap.newInstance();
- Map optionalTest = FastMap.newInstance();
+ Map<String, Object> requiredTest = FastMap.newInstance();
+ Map<String, Object> optionalTest = FastMap.newInstance();
if (test == null) test = FastMap.newInstance();
requiredTest.putAll(test);
- List requiredButNull = FastList.newInstance();
- List keyList = FastList.newInstance();
+ List<String> requiredButNull = FastList.newInstance();
+ List<String> keyList = FastList.newInstance();
keyList.addAll(requiredTest.keySet());
- Iterator t = keyList.iterator();
-
- while (t.hasNext()) {
- Object key = t.next();
+ for (String key: keyList) {
Object value = requiredTest.get(key);
if (!requiredInfo.containsKey(key)) {
@@ -428,10 +425,8 @@
// check for requiredButNull fields and return an error since null values are not allowed for required fields
if (requiredButNull.size() > 0) {
- List missingMsg = FastList.newInstance();
- Iterator rbni = requiredButNull.iterator();
- while (rbni.hasNext()) {
- String missingKey = (String) rbni.next();
+ List<String> missingMsg = FastList.newInstance();
+ for (String missingKey: requiredButNull) {
String message = this.getParam(missingKey).getPrimaryFailMessage(locale);
if (message == null) {
String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "ModelService.following_required_parameter_missing", locale);
@@ -444,12 +439,12 @@
if (verboseOn) {
StringBuilder requiredNames = new StringBuilder();
- Iterator requiredIter = requiredInfo.keySet().iterator();
- while (requiredIter.hasNext()) {
+
+ for (String key: requiredInfo.keySet()) {
if (requiredNames.length() > 0) {
requiredNames.append(", ");
}
- requiredNames.append(requiredIter.next());
+ requiredNames.append(key);
}
Debug.logVerbose("[ModelService.validate] : required fields - " + requiredNames, module);
@@ -474,27 +469,24 @@
* @param test The map to test its value types.
* @param reverse Test the maps in reverse.
*/
- public static void validate(Map info, Map test, boolean reverse, ModelService model, String mode, Locale locale) throws ServiceValidationException {
+ public static void validate(Map<String, String> info, Map<String, ? extends Object> test, boolean reverse, ModelService model, String mode, Locale locale) throws ServiceValidationException {
if (info == null || test == null) {
throw new ServiceValidationException("Cannot validate NULL maps", model);
}
// * Validate keys first
- Set testSet = test.keySet();
- Set keySet = info.keySet();
+ Set<String> testSet = test.keySet();
+ Set<String> keySet = info.keySet();
// Quick check for sizes
if (info.size() == 0 && test.size() == 0) return;
// This is to see if the test set contains all from the info set (reverse)
if (reverse && !testSet.containsAll(keySet)) {
- Set missing = new TreeSet(keySet);
+ Set<String> missing = new TreeSet<String>(keySet);
missing.removeAll(testSet);
- List missingMsgs = FastList.newInstance();
-
- Iterator iter = missing.iterator();
- while (iter.hasNext()) {
- String key = (String) iter.next();
+ List<String> missingMsgs = FastList.newInstance();
+ for (String key: missing) {
String msg = model.getParam(key).getPrimaryFailMessage(locale);
if (msg == null) {
String errMsg = UtilProperties.getMessage(ServiceUtil.resource, "ModelService.following_required_parameter_missing", locale) ;
@@ -503,21 +495,18 @@
missingMsgs.add(msg);
}
- List missingCopy = FastList.newInstance();
+ List<String> missingCopy = FastList.newInstance();
missingCopy.addAll(missing);
throw new ServiceValidationException(missingMsgs, model, missingCopy, null, mode);
}
// This is to see if the info set contains all from the test set
if (!keySet.containsAll(testSet)) {
- Set extra = new TreeSet(testSet);
+ Set<String> extra = new TreeSet<String>(testSet);
extra.removeAll(keySet);
- List extraMsgs = FastList.newInstance();
-
- Iterator iter = extra.iterator();
- while (iter.hasNext()) {
- String key = (String) iter.next();
+ List<String> extraMsgs = FastList.newInstance();
+ for (String key: extra) {
ModelParam param = model.getParam(key);
String msg = null;
if (param != null) {
@@ -529,20 +518,18 @@
extraMsgs.add(msg);
}
- List extraCopy = FastList.newInstance();
+ List<String> extraCopy = FastList.newInstance();
extraCopy.addAll(extra);
throw new ServiceValidationException(extraMsgs, model, null, extraCopy, mode);
}
// * Validate types next
List<String> typeFailMsgs = FastList.newInstance();
- Iterator i = testSet.iterator();
- while (i.hasNext()) {
- String key = (String) i.next();
+ for (String key: testSet) {
ModelParam param = model.getParam(key);
Object testObject = test.get(key);
- String infoType = (String) info.get(key);
+ String infoType = info.get(key);
if (param.validators != null && param.validators.size() > 0) {
for (ModelParam.ModelParamValidator val: param.validators) {
@@ -688,7 +675,7 @@
* @param source The source map
* @param mode The mode which to build the new map
*/
- public Map makeValid(Map source, String mode) {
+ public Map<String, Object> makeValid(Map<String, ? extends Object> source, String mode) {
return makeValid(source, mode, true, null);
}
@@ -699,7 +686,7 @@
* @param mode The mode which to build the new map
* @param includeInternal When false will exclude internal fields
*/
- public Map makeValid(Map source, String mode, boolean includeInternal, List<Object> errorMessages) {
+ public Map<String, Object> makeValid(Map<String, ? extends Object> source, String mode, boolean includeInternal, List<Object> errorMessages) {
return makeValid(source, mode, includeInternal, errorMessages, null);
}
@@ -711,7 +698,7 @@
* @param includeInternal When false will exclude internal fields
* @param locale Locale to use to do some type conversion
*/
- public Map makeValid(Map source, String mode, boolean includeInternal, List<Object> errorMessages, Locale locale) {
+ public Map<String, Object> makeValid(Map<String, ? extends Object> source, String mode, boolean includeInternal, List<Object> errorMessages, Locale locale) {
return makeValid(source, mode, includeInternal, errorMessages, null, locale);
}
@@ -724,8 +711,8 @@
* @param tz TimeZone to use to do some type conversion
* @param locale Locale to use to do some type conversion
*/
- public Map makeValid(Map source, String mode, boolean includeInternal, List<Object> errorMessages, TimeZone timeZone, Locale locale) {
- Map target = FastMap.newInstance();
+ public Map<String, Object> makeValid(Map<String, ? extends Object> source, String mode, boolean includeInternal, List<Object> errorMessages, TimeZone timeZone, Locale locale) {
+ Map<String, Object> target = FastMap.newInstance();
if (source == null) {
return target;
@@ -765,13 +752,13 @@
// internal map of strings
if (param.stringMapPrefix != null && param.stringMapPrefix.length() > 0 && !source.containsKey(key)) {
- Map paramMap = this.makePrefixMap(source, param);
+ Map<String, Object> paramMap = this.makePrefixMap(source, param);
if (paramMap != null && paramMap.size() > 0) {
target.put(key, paramMap);
}
// internal list of strings
} else if (param.stringListSuffix != null && param.stringListSuffix.length() > 0 && !source.containsKey(key)) {
- List paramList = this.makeSuffixList(source, param);
+ List<Object> paramList = this.makeSuffixList(source, param);
if (paramList != null && paramList.size() > 0) {
target.put(key, paramList);
}
@@ -800,27 +787,23 @@
return target;
}
- private Map makePrefixMap(Map source, ModelParam param) {
- Map paramMap = FastMap.newInstance();
- Set sourceSet = source.keySet();
- Iterator i = sourceSet.iterator();
- while (i.hasNext()) {
- String key = (String) i.next();
+ private Map<String, Object> makePrefixMap(Map<String, ? extends Object> source, ModelParam param) {
+ Map<String, Object> paramMap = FastMap.newInstance();
+ for (Map.Entry<String, ? extends Object> entry: source.entrySet()) {
+ String key = entry.getKey();
if (key.startsWith(param.stringMapPrefix)) {
- paramMap.put(key, source.get(key));
+ paramMap.put(key, entry.getValue());
}
}
return paramMap;
}
- private List makeSuffixList(Map source, ModelParam param) {
- List paramList = FastList.newInstance();
- Set sourceSet = source.keySet();
- Iterator i = sourceSet.iterator();
- while (i.hasNext()) {
- String key = (String) i.next();
+ private List<Object> makeSuffixList(Map<String, ? extends Object> source, ModelParam param) {
+ List<Object> paramList = FastList.newInstance();
+ for (Map.Entry<String, ? extends Object> entry: source.entrySet()) {
+ String key = entry.getKey();
if (key.endsWith(param.stringListSuffix)) {
- paramList.add(source.get(key));
+ paramList.add(entry.getValue());
}
}
return paramList;
@@ -836,7 +819,7 @@
* @param context Map containing userLogin and context infromation
* @return result of permission service invocation
*/
- public Map evalPermission(DispatchContext dctx, Map context) {
+ public Map<String, Object> evalPermission(DispatchContext dctx, Map<String, ? extends Object> context) {
if (UtilValidate.isNotEmpty(this.permissionServiceName)) {
ModelService thisService;
ModelService permission;
@@ -845,13 +828,13 @@
permission = dctx.getModelService(this.permissionServiceName);
} catch (GenericServiceException e) {
Debug.logError(e, "Failed to get ModelService: " + e.toString(), module);
- Map result = ServiceUtil.returnSuccess();
+ Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("hasPermission", Boolean.FALSE);
result.put("failMessage", e.getMessage());
return result;
}
if (permission != null) {
- Map ctx = permission.makeValid(context, ModelService.IN_PARAM);
+ Map<String, Object> ctx = permission.makeValid(context, ModelService.IN_PARAM);
if (UtilValidate.isNotEmpty(this.permissionMainAction)) {
ctx.put("mainAction", this.permissionMainAction);
}
@@ -862,31 +845,31 @@
}
LocalDispatcher dispatcher = dctx.getDispatcher();
- Map resp;
+ Map<String, Object> resp;
try {
resp = dispatcher.runSync(permission.name, ctx, 300, true);
} catch (GenericServiceException e) {
Debug.logError(e, module);
- Map result = ServiceUtil.returnSuccess();
+ Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("hasPermission", Boolean.FALSE);
result.put("failMessage", e.getMessage());
return result;
}
if (ServiceUtil.isError(resp) || ServiceUtil.isFailure(resp)) {
- Map result = ServiceUtil.returnSuccess();
+ Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("hasPermission", Boolean.FALSE);
result.put("failMessage", ServiceUtil.getErrorMessage(resp));
return result;
}
return resp;
} else {
- Map result = ServiceUtil.returnSuccess();
+ Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("hasPermission", Boolean.FALSE);
result.put("failMessage", "No ModelService found with the name [" + this.permissionServiceName + "]");
return result;
}
} else {
- Map result = ServiceUtil.returnSuccess();
+ Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("hasPermission", Boolean.FALSE);
result.put("failMessage", "No ModelService found; no service name specified!");
return result;
@@ -896,7 +879,7 @@
/**
* Evaluates notifications
*/
- public void evalNotifications(DispatchContext dctx, Map context, Map result) {
+ public void evalNotifications(DispatchContext dctx, Map<String, ? extends Object> context, Map<String, Object> result) {
for (ModelNotification notify: this.notifications) {
notify.callNotify(dctx, this, context, result);
}
@@ -908,7 +891,7 @@
* @param context Map containing userLogin infromation
* @return true if all permissions evaluate true.
*/
- public boolean evalPermissions(DispatchContext dctx, Map context) {
+ public boolean evalPermissions(DispatchContext dctx, Map<String, ? extends Object> context) {
// old permission checking
if (this.containsPermissions()) {
for (ModelPermGroup group: this.permissionGroups) {
@@ -926,8 +909,8 @@
* Gets a list of required IN parameters in sequence.
* @return A list of required IN parameters in the order which they were defined.
*/
- public List getInParameterSequence(Map source) {
- List target = FastList.newInstance();
+ public List<Object> getInParameterSequence(Map<String, ? extends Object> source) {
+ List<Object> target = FastList.newInstance();
if (source == null) {
return target;
}
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java Sat Oct 20 21:08:17 2007
@@ -204,7 +204,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public Map runSync(String localName, ModelService service, Map context) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public Map<String, Object> runSync(String localName, ModelService service, Map<String, ? extends Object> context) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
return runSync(localName, service, context, true);
}
@@ -217,7 +217,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runSyncIgnore(String localName, ModelService service, Map context) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runSyncIgnore(String localName, ModelService service, Map<String, ? extends Object> context) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
runSync(localName, service, context, false);
}
@@ -232,7 +232,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public Map runSync(String localName, ModelService modelService, Map context, boolean validateOut) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, ? extends Object> params, boolean validateOut) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
// check for semaphore and aquire a lock
ServiceSemaphore lock = null;
if ("wait".equals(modelService.semaphore) || "fail".equals(modelService.semaphore)) {
@@ -247,12 +247,13 @@
"/" + modelService.invoke + "] (" + modelService.engineName + ")", module);
}
- if (context == null) {
- context = FastMap.newInstance();
+ Map<String, Object> context = FastMap.newInstance();
+ if (params != null) {
+ context.putAll(params);
}
// setup the result map and other initial settings
- Map result = FastMap.newInstance();
+ Map<String, Object> result = FastMap.newInstance();
boolean isFailure = false;
boolean isError = false;
@@ -272,7 +273,7 @@
// set IN attributes with default-value as applicable
modelService.updateDefaultValues(context, ModelService.IN_PARAM);
- Map ecaContext = null;
+ Map<String, Object> ecaContext = null;
// for isolated transactions
Transaction parentTransaction = null;
@@ -370,7 +371,7 @@
// ===== invoke the service =====
if (!isError && !isFailure) {
- Map invokeResult = engine.runSync(localName, modelService, context);
+ Map<String, Object> invokeResult = engine.runSync(localName, modelService, context);
engine.sendCallbacks(modelService, context, invokeResult, GenericEngine.SYNC_MODE);
if (invokeResult != null) {
result.putAll(invokeResult);
@@ -581,7 +582,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runAsync(String localName, ModelService service, Map context, GenericRequester requester, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runAsync(String localName, ModelService service, Map<String, ? extends Object> params, GenericRequester requester, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
if (Debug.timingOn()) {
UtilTimer.timerLog(localName + " / " + service.name, "ASync service started...", module);
}
@@ -591,12 +592,12 @@
"] (" + service.engineName + ")", module);
}
- if (context == null) {
- context = FastMap.newInstance();
+ Map<String, Object> context = FastMap.newInstance();
+ if (params != null) {
+ context.putAll(params);
}
-
// setup the result map
- Map result = FastMap.newInstance();
+ Map<String, Object> result = FastMap.newInstance();
boolean isFailure = false;
boolean isError = false;
@@ -740,7 +741,7 @@
* @throws ServiceValidationException
* @throws GenericServiceException
*/
- public void runAsync(String localName, ModelService service, Map context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
+ public void runAsync(String localName, ModelService service, Map<String, ? extends Object> context, boolean persist) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
this.runAsync(localName, service, context, null, persist);
}
@@ -820,7 +821,7 @@
}
// checks if parameters were passed for authentication
- private void checkAuth(String localName, Map context, ModelService origService) throws ServiceAuthException, GenericServiceException {
+ private void checkAuth(String localName, Map<String, Object> context, ModelService origService) throws ServiceAuthException, GenericServiceException {
String service = ServiceConfigUtil.getElementAttr("authorization", "service-name");
if (service == null) {
@@ -876,7 +877,7 @@
// evaluate permissions for the service or throw exception if fail.
DispatchContext dctx = this.getLocalContext(localName);
if (UtilValidate.isNotEmpty(origService.permissionServiceName)) {
- Map permResp = origService.evalPermission(dctx, context);
+ Map<String, Object> permResp = origService.evalPermission(dctx, context);
Boolean hasPermission = (Boolean) permResp.get("hasPermission");
if (hasPermission == null) {
throw new ServiceAuthException("ERROR: the permission-service [" + origService.permissionServiceName + "] did not return a result. Not running the service [" + origService.name + "]");
@@ -902,7 +903,8 @@
// gets a value object from name/password pair
private GenericValue getLoginObject(String service, String localName, String username, String password, Locale locale) throws GenericServiceException {
- Map context = UtilMisc.toMap("login.username", username, "login.password", password, "isServiceAuth", Boolean.TRUE, "locale", locale);
+ Map<String, Object> context = FastMap.newInstance();
+ context.putAll(UtilMisc.toMap("login.username", username, "login.password", password, "isServiceAuth", true, "locale", locale));
if (Debug.verboseOn()) Debug.logVerbose("[ServiceDispathcer.authenticate] : Invoking UserLogin Service", module);
@@ -914,12 +916,12 @@
GenericEngine engine = getGenericEngine(model.engineName);
// invoke the service and get the UserLogin value object
- Map result = engine.runSync(localName, model, context);
+ Map<String, Object> result = engine.runSync(localName, model, context);
return (GenericValue) result.get("userLogin");
}
// checks the locale object in the context
- private Locale checkLocale(Map context) {
+ private Locale checkLocale(Map<String, Object> context) {
Object locale = context.get("locale");
Locale newLocale = null;
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java Sat Oct 20 21:08:17 2007
@@ -50,14 +50,14 @@
public static final String resource = "ServiceErrorUiLabels";
/** A little short-cut method to check to see if a service returned an error */
- public static boolean isError(Map results) {
+ public static boolean isError(Map<String, ? extends Object> results) {
if (results == null || results.get(ModelService.RESPONSE_MESSAGE) == null) {
return false;
}
return ModelService.RESPOND_ERROR.equals(results.get(ModelService.RESPONSE_MESSAGE));
}
- public static boolean isFailure(Map results) {
+ public static boolean isFailure(Map<String, ? extends Object> results) {
if (results == null || results.get(ModelService.RESPONSE_MESSAGE) == null) {
return false;
}
@@ -65,39 +65,39 @@
}
/** A small routine used all over to improve code efficiency, make a result map with the message and the error response code */
- public static Map returnError(String errorMessage) {
+ public static Map<String, Object> returnError(String errorMessage) {
return returnProblem(ModelService.RESPOND_ERROR, errorMessage, null, null, null);
}
/** A small routine used all over to improve code efficiency, make a result map with the message and the error response code */
- public static Map returnError(String errorMessage, List<? extends Object> errorMessageList) {
+ public static Map<String, Object> returnError(String errorMessage, List<? extends Object> errorMessageList) {
return returnProblem(ModelService.RESPOND_ERROR, errorMessage, errorMessageList, null, null);
}
/** A small routine used all over to improve code efficiency, make a result map with the message and the error response code */
- public static Map returnError(List<? extends Object> errorMessageList) {
+ public static Map<String, Object> returnError(List<? extends Object> errorMessageList) {
return returnProblem(ModelService.RESPOND_ERROR, null, errorMessageList, null, null);
}
- public static Map returnFailure(String errorMessage) {
+ public static Map<String, Object> returnFailure(String errorMessage) {
return returnProblem(ModelService.RESPOND_FAIL, errorMessage, null, null, null);
}
- public static Map returnFailure(List<? extends Object> errorMessageList) {
+ public static Map<String, Object> returnFailure(List<? extends Object> errorMessageList) {
return returnProblem(ModelService.RESPOND_FAIL, null, errorMessageList, null, null);
}
- public static Map returnFailure() {
+ public static Map<String, Object> returnFailure() {
return returnProblem(ModelService.RESPOND_FAIL, null, null, null, null);
}
/** A small routine used all over to improve code efficiency, make a result map with the message and the error response code, also forwards any error messages from the nestedResult */
- public static Map returnError(String errorMessage, List<? extends Object> errorMessageList, Map<String, ? extends Object> errorMessageMap, Map nestedResult) {
+ public static Map<String, Object> returnError(String errorMessage, List<? extends Object> errorMessageList, Map<String, ? extends Object> errorMessageMap, Map<String, ? extends Object> nestedResult) {
return returnProblem(ModelService.RESPOND_ERROR, errorMessage, errorMessageList, errorMessageMap, nestedResult);
}
- public static Map returnProblem(String returnType, String errorMessage, List<? extends Object> errorMessageList, Map<String, ? extends Object> errorMessageMap, Map nestedResult) {
- Map result = FastMap.newInstance();
+ public static Map<String, Object> returnProblem(String returnType, String errorMessage, List<? extends Object> errorMessageList, Map<String, ? extends Object> errorMessageMap, Map<String, ? extends Object> nestedResult) {
+ Map<String, Object> result = FastMap.newInstance();
result.put(ModelService.RESPONSE_MESSAGE, returnType);
if (errorMessage != null) {
result.put(ModelService.ERROR_MESSAGE, errorMessage);
@@ -135,12 +135,12 @@
}
/** A small routine used all over to improve code efficiency, make a result map with the message and the success response code */
- public static Map returnSuccess(String successMessage) {
+ public static Map<String, Object> returnSuccess(String successMessage) {
return returnMessage(ModelService.RESPOND_SUCCESS, successMessage);
}
/** A small routine used all over to improve code efficiency, make a result map with the message and the success response code */
- public static Map returnSuccess() {
+ public static Map<String, Object> returnSuccess() {
return returnMessage(ModelService.RESPOND_SUCCESS, null);
}
@@ -148,8 +148,8 @@
* NOTE: This brings out some bad points to our message convention: we should be using a single message or message list
* and what type of message that is should be determined by the RESPONSE_MESSAGE (and there's another annoyance, it should be RESPONSE_CODE)
*/
- public static Map returnMessage(String code, String message) {
- Map result = FastMap.newInstance();
+ public static Map<String, Object> returnMessage(String code, String message) {
+ Map<String, Object> result = FastMap.newInstance();
if (code != null) result.put(ModelService.RESPONSE_MESSAGE, code);
if (message != null) result.put(ModelService.SUCCESS_MESSAGE, message);
return result;
@@ -158,7 +158,7 @@
/** A small routine used all over to improve code efficiency, get the partyId and does a security check
*<b>security check</b>: userLogin partyId must equal partyId, or must have [secEntity][secOperation] permission
*/
- public static String getPartyIdCheckSecurity(GenericValue userLogin, Security security, Map context, Map result, String secEntity, String secOperation) {
+ public static String getPartyIdCheckSecurity(GenericValue userLogin, Security security, Map<String, ? extends Object> context, Map<String, Object> result, String secEntity, String secOperation) {
String partyId = (String) context.get("partyId");
Locale locale = getLocale(context);
if (partyId == null || partyId.length() == 0) {
@@ -197,18 +197,18 @@
}
- public static void getMessages(HttpServletRequest request, Map result, String defaultMessage) {
+ public static void getMessages(HttpServletRequest request, Map<String, ? extends Object> result, String defaultMessage) {
getMessages(request, result, defaultMessage, null, null, null, null, null, null);
}
- public static void getMessages(HttpServletRequest request, Map result, String defaultMessage,
+ public static void getMessages(HttpServletRequest request, Map<String, ? extends Object> result, String defaultMessage,
String msgPrefix, String msgSuffix, String errorPrefix, String errorSuffix, String successPrefix, String successSuffix) {
String errorMessage = ServiceUtil.makeErrorMessage(result, msgPrefix, msgSuffix, errorPrefix, errorSuffix);
String successMessage = ServiceUtil.makeSuccessMessage(result, msgPrefix, msgSuffix, successPrefix, successSuffix);
setMessages(request, errorMessage, successMessage, defaultMessage);
}
- public static String getErrorMessage(Map result) {
+ public static String getErrorMessage(Map<String, ? extends Object> result) {
StringBuilder errorMessage = new StringBuilder();
if (result.get(ModelService.ERROR_MESSAGE) != null) errorMessage.append((String) result.get(ModelService.ERROR_MESSAGE));
@@ -228,7 +228,7 @@
return errorMessage.toString();
}
- public static String makeErrorMessage(Map result, String msgPrefix, String msgSuffix, String errorPrefix, String errorSuffix) {
+ public static String makeErrorMessage(Map<String, ? extends Object> result, String msgPrefix, String msgSuffix, String errorPrefix, String errorSuffix) {
if (result == null) {
Debug.logWarning("A null result map was passed", module);
return null;
@@ -268,12 +268,12 @@
}
}
- public static String makeSuccessMessage(Map result, String msgPrefix, String msgSuffix, String successPrefix, String successSuffix) {
+ public static String makeSuccessMessage(Map<String, ? extends Object> result, String msgPrefix, String msgSuffix, String successPrefix, String successSuffix) {
if (result == null) {
return "";
}
String successMsg = (String) result.get(ModelService.SUCCESS_MESSAGE);
- List successMsgList = (List) result.get(ModelService.SUCCESS_MESSAGE_LIST);
+ List<? extends Object> successMsgList = UtilGenerics.checkList(result.get(ModelService.SUCCESS_MESSAGE_LIST));
StringBuilder outMsg = new StringBuilder();
outMsg.append(makeMessageList(successMsgList, msgPrefix, msgSuffix));
@@ -318,7 +318,7 @@
* @param targetMap The Map to add any Map error messages to
* @param callResult The result from an invocation
*/
- public static void addErrors(List<Object> targetList, Map<String, Object> targetMap, Map callResult) {
+ public static void addErrors(List<Object> targetList, Map<String, Object> targetMap, Map<String, ? extends Object> callResult) {
List<? extends Object> newList;
Map<String, ? extends Object> errorMsgMap;
@@ -340,7 +340,7 @@
}
}
- public static Map purgeOldJobs(DispatchContext dctx, Map context) {
+ public static Map<String, Object> purgeOldJobs(DispatchContext dctx, Map<String, ? extends Object> context) {
String sendPool = ServiceConfigUtil.getSendPool();
int daysToKeep = ServiceConfigUtil.getPurgeJobDays();
GenericDelegator delegator = dctx.getDelegator();
@@ -413,7 +413,7 @@
if (curList != null && curList.size() > 0) {
// list of runtime data IDs to attempt to delete
List<String> runtimeToDelete = FastList.newInstance();
-
+
for (GenericValue job: curList) {
String runtimeId = job.getString("runtimeDataId");
String jobId = job.getString("jobId");
@@ -484,7 +484,7 @@
return ServiceUtil.returnSuccess();
}
- public static Map cancelJob(DispatchContext dctx, Map context) {
+ public static Map<String, Object> cancelJob(DispatchContext dctx, Map<String, ? extends Object> context) {
GenericDelegator delegator = dctx.getDelegator();
Security security = dctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -514,7 +514,7 @@
Timestamp cancelDate = job.getTimestamp("cancelDateTime");
if (cancelDate != null) {
- Map result = ServiceUtil.returnSuccess();
+ Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("cancelDateTime", cancelDate);
return result;
} else {
@@ -523,7 +523,7 @@
}
}
- public static Map cancelJobRetries(DispatchContext dctx, Map context) {
+ public static Map<String, Object> cancelJobRetries(DispatchContext dctx, Map<String, ? extends Object> context) {
GenericDelegator delegator = dctx.getDelegator();
Security security = dctx.getSecurity();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -558,21 +558,21 @@
}
}
- public static Map genericDateCondition(DispatchContext dctx, Map context) {
+ public static Map<String, Object> genericDateCondition(DispatchContext dctx, Map<String, ? extends Object> context) {
Timestamp fromDate = (Timestamp) context.get("fromDate");
Timestamp thruDate = (Timestamp) context.get("thruDate");
Timestamp now = UtilDateTime.nowTimestamp();
- Boolean reply = Boolean.TRUE;
+ boolean reply = true;
- if (fromDate != null && fromDate.after(now)) reply = Boolean.FALSE;
- if (thruDate != null && thruDate.before(now)) reply = Boolean.FALSE;
+ if (fromDate != null && fromDate.after(now)) reply = false;
+ if (thruDate != null && thruDate.before(now)) reply = false;
- Map result = ServiceUtil.returnSuccess();
+ Map<String, Object> result = ServiceUtil.returnSuccess();
result.put("conditionReply", reply);
return result;
}
- public static GenericValue getUserLogin(DispatchContext dctx, Map context, String runAsUser) {
+ public static GenericValue getUserLogin(DispatchContext dctx, Map<String, ? extends Object> context, String runAsUser) {
GenericValue userLogin = (GenericValue) context.get("userLogin");
GenericDelegator delegator = dctx.getDelegator();
if (runAsUser != null) {
@@ -588,7 +588,7 @@
return userLogin;
}
- private static Locale getLocale(Map context) {
+ private static Locale getLocale(Map<String, ? extends Object> context) {
Locale locale = (Locale) context.get("locale");
if (locale == null) {
locale = Locale.getDefault();
@@ -596,12 +596,12 @@
return locale;
}
- public static Map makeContext(Object... args) {
+ public static <T extends Object> Map<String, Object> makeContext(T... args) {
if (args != null) {
for (int i = 0; i < args.length; i += 2) {
if (!(args[i] instanceof String)) throw new IllegalArgumentException("Arg(" + i + "), value(" + args[i] + ") is not a string.");
}
}
- return UtilMisc.toMap(args);
+ return UtilGenerics.checkMap(UtilMisc.toMap(args));
}
}
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java Sat Oct 20 21:08:17 2007
@@ -24,6 +24,8 @@
import javax.transaction.xa.XAException;
import javax.transaction.xa.Xid;
+import javolution.util.FastMap;
+
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.transaction.GenericTransactionException;
@@ -45,8 +47,8 @@
protected String rollbackService = null;
protected String commitService = null;
protected String runAsUser = null;
- protected Map rollbackContext = null;
- protected Map commitContext = null;
+ protected Map<String, ? extends Object> rollbackContext = null;
+ protected Map<String, ? extends Object> commitContext = null;
protected boolean rollbackAsync = true;
protected boolean rollbackAsyncPersist = true;
protected boolean commitAsync = false;
@@ -62,7 +64,7 @@
* @param serviceName Name of service to run
* @param context Context to use when running
*/
- public void setCommitService(String serviceName, Map context) {
+ public void setCommitService(String serviceName, Map<String, ? extends Object> context) {
this.setCommitService(serviceName, null, context, commitAsync, commitAsyncPersist);
}
@@ -72,7 +74,7 @@
* @param context Context to use when running
* @param async override default async behavior
*/
- public void setCommitService(String serviceName, Map context, boolean async, boolean persist) {
+ public void setCommitService(String serviceName, Map<String, ? extends Object> context, boolean async, boolean persist) {
this.setCommitService(serviceName, null, context, async, persist);
}
@@ -83,7 +85,7 @@
* @param context Context to use when running
* @param async override default async behavior
*/
- public void setCommitService(String serviceName, String runAsUser, Map context, boolean async, boolean persist) {
+ public void setCommitService(String serviceName, String runAsUser, Map<String, ? extends Object> context, boolean async, boolean persist) {
this.commitService = serviceName;
this.runAsUser = runAsUser;
this.commitContext = context;
@@ -102,7 +104,7 @@
/**
* @return The context used when running the rollback() service
*/
- public Map getCommitContext() {
+ public Map<String, ? extends Object> getCommitContext() {
return this.commitContext;
}
@@ -111,7 +113,7 @@
* @param serviceName Name of service to run
* @param context Context to use when running
*/
- public void setRollbackService(String serviceName, Map context) {
+ public void setRollbackService(String serviceName, Map<String, ? extends Object> context) {
this.setRollbackService(serviceName, context, rollbackAsync, rollbackAsyncPersist);
}
@@ -121,7 +123,7 @@
* @param context Context to use when running
* @param async override default async behavior
*/
- public void setRollbackService(String serviceName, Map context, boolean async, boolean persist) {
+ public void setRollbackService(String serviceName, Map<String, ? extends Object> context, boolean async, boolean persist) {
this.rollbackService = serviceName;
this.rollbackContext = context;
this.rollbackAsync = async;
@@ -162,7 +164,7 @@
}
final String service = commitService;
- final Map context = commitContext;
+ final Map<String, ? extends Object> context = commitContext;
final boolean persist = commitAsyncPersist;
final boolean async = commitAsync;
@@ -195,7 +197,7 @@
}
final String service = rollbackService;
- final Map context = rollbackContext;
+ final Map<String, ? extends Object> context = rollbackContext;
final boolean persist = rollbackAsyncPersist;
final boolean async = rollbackAsync;
@@ -230,7 +232,7 @@
- protected final void runService(String service, Map context, boolean persist, int mode, int type) throws XAException {
+ protected final void runService(String service, Map<String, ? extends Object> context, boolean persist, int mode, int type) throws XAException {
// set the logging prefix
String msgPrefix = "[XaWrapper] ";
switch (type) {
@@ -269,9 +271,12 @@
try {
// obtain the model and get the valid context
ModelService model = dctx.getModelService(service);
- Map thisContext = context;
+ Map<String, Object> thisContext;
if (model.validate) {
thisContext = model.makeValid(context, ModelService.IN_PARAM);
+ } else {
+ thisContext = FastMap.newInstance();
+ thisContext.putAll(context);
}
// set the userLogin object
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/WebAppDispatcher.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/WebAppDispatcher.java?rev=586856&r1=586855&r2=586856&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/WebAppDispatcher.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/WebAppDispatcher.java Sat Oct 20 21:08:17 2007
@@ -18,6 +18,7 @@
*******************************************************************************/
package org.ofbiz.service;
+import java.net.URL;
import java.util.Collection;
import org.ofbiz.entity.GenericDelegator;
@@ -29,11 +30,11 @@
public static final String module = WebAppDispatcher.class.getName();
- public WebAppDispatcher(String name, GenericDelegator delegator, Collection readerURLs) {
+ public WebAppDispatcher(String name, GenericDelegator delegator, Collection<URL> readerURLs) {
this(name, delegator, readerURLs, null);
}
- public WebAppDispatcher(String name, GenericDelegator delegator, Collection readerURLs, ClassLoader loader) {
+ public WebAppDispatcher(String name, GenericDelegator delegator, Collection<URL> readerURLs, ClassLoader loader) {
if (loader == null) {
try {
loader = Thread.currentThread().getContextClassLoader();