Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java Sat Oct 20 21:08:17 2007 @@ -74,18 +74,18 @@ this.persist = "true".equals(action.getAttribute("persist")); } - public boolean runAction(String selfService, DispatchContext dctx, Map context, Map result) throws GenericServiceException { + public boolean runAction(String selfService, DispatchContext dctx, Map<String, Object> context, Map<String, Object> result) throws GenericServiceException { if (serviceName.equals(selfService)) { throw new GenericServiceException("Cannot invoke self on ECA."); } // pull out context parameters needed for this service. - Map actionContext = dctx.getModelService(serviceName).makeValid(context, ModelService.IN_PARAM); + Map<String, Object> actionContext = dctx.getModelService(serviceName).makeValid(context, ModelService.IN_PARAM); // set the userLogin object in the context actionContext.put("userLogin", ServiceUtil.getUserLogin(dctx, actionContext, runAsUser)); - Map actionResult = null; + Map<String, Object> actionResult = null; LocalDispatcher dispatcher = dctx.getDispatcher(); if (eventName.startsWith("global-")) { @@ -118,7 +118,7 @@ // put the results in to the defined map if (resultMapName != null && resultMapName.length() > 0) { - Map resultMap = (Map) context.get(resultMapName); + Map<String, Object> resultMap = UtilGenerics.checkMap(context.get(resultMapName)); if (resultMap == null) { resultMap = FastMap.newInstance(); } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java Sat Oct 20 21:08:17 2007 @@ -94,8 +94,8 @@ // condition-service; run the service and return the reply result if (isService) { LocalDispatcher dispatcher = dctx.getDispatcher(); - Map conditionServiceResult = dispatcher.runSync(conditionService, - UtilMisc.toMap("serviceContext", context, "serviceName", serviceName, + Map<String, Object> conditionServiceResult = dispatcher.runSync(conditionService, + UtilMisc.<String, Object>toMap("serviceContext", context, "serviceName", serviceName, "userLogin", context.get("userLogin"))); Boolean conditionReply = Boolean.FALSE; @@ -113,7 +113,7 @@ if (lhsMapName != null && lhsMapName.length() > 0) { try { if (context.containsKey(lhsMapName)) { - Map envMap = (Map) context.get(lhsMapName); + Map<String, ? extends Object> envMap = UtilGenerics.checkMap(context.get(lhsMapName)); lhsValue = envMap.get(lhsValueName); } else { Debug.logWarning("From Map (" + lhsMapName + ") not found in context, defaulting to null.", module); @@ -134,7 +134,7 @@ } else if (rhsMapName != null && rhsMapName.length() > 0) { try { if (context.containsKey(rhsMapName)) { - Map envMap = (Map) context.get(rhsMapName); + Map<String, ? extends Object> envMap = UtilGenerics.checkMap(context.get(rhsMapName)); rhsValue = envMap.get(rhsValueName); } else { Debug.logWarning("To Map (" + rhsMapName + ") not found in context for " + serviceName + ", defaulting to null.", module); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java Sat Oct 20 21:08:17 2007 @@ -83,7 +83,7 @@ if (Debug.verboseOn()) Debug.logVerbose("actions and sets (intermixed): " + actionsAndSets, module); } - public void eval(String serviceName, DispatchContext dctx, Map context, Map result, boolean isError, boolean isFailure, Set actionsRun) throws GenericServiceException { + public void eval(String serviceName, DispatchContext dctx, Map<String, Object> context, Map<String, Object> result, boolean isError, boolean isFailure, Set<String> actionsRun) throws GenericServiceException { if (!enabled) { Debug.logInfo("Service ECA [" + this.serviceName + "] on [" + this.eventName + "] is disabled; not running.", module); return; Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java Sat Oct 20 21:08:17 2007 @@ -46,7 +46,7 @@ this.format = set.getAttribute("format"); } - public void eval(Map context) { + public void eval(Map<String, Object> context) { if (fieldName != null) { // try to expand the envName if (UtilValidate.isEmpty(value)) { @@ -69,7 +69,7 @@ } } - protected Object format(String s, Map c) { + protected Object format(String s, Map<String, ? extends Object> c) { if (UtilValidate.isEmpty(s) || UtilValidate.isEmpty(format)) { return s; } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java Sat Oct 20 21:08:17 2007 @@ -140,7 +140,7 @@ return null; } - public static void evalRules(String serviceName, Map<String, Collection<ServiceEcaRule>> eventMap, String event, DispatchContext dctx, Map context, Map result, boolean isError, boolean isFailure) throws GenericServiceException { + public static void evalRules(String serviceName, Map<String, Collection<ServiceEcaRule>> eventMap, String event, DispatchContext dctx, Map<String, Object> context, Map<String, Object> result, boolean isError, boolean isFailure) throws GenericServiceException { // if the eventMap is passed we save a Map lookup, but if not that's okay we'll just look it up now if (eventMap == null) eventMap = getServiceEventMap(serviceName); if (eventMap == null || eventMap.size() == 0) { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/AbstractEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/AbstractEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/AbstractEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/AbstractEngine.java Sat Oct 20 21:08:17 2007 @@ -86,7 +86,7 @@ /** * @see org.ofbiz.service.engine.GenericEngine#sendCallbacks(org.ofbiz.service.ModelService, java.util.Map, java.lang.Object, int) */ - public void sendCallbacks(ModelService model, Map context, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService model, Map<String, Object> context, int mode) throws GenericServiceException { if (!allowCallbacks(model, context, mode)) return; List<GenericServiceCallback> callbacks = dispatcher.getCallbacks(model.name); if (callbacks != null) { @@ -102,7 +102,7 @@ } } - public void sendCallbacks(ModelService model, Map context, Throwable t, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService model, Map<String, Object> context, Throwable t, int mode) throws GenericServiceException { if (!allowCallbacks(model, context, mode)) return; List<GenericServiceCallback> callbacks = dispatcher.getCallbacks(model.name); if (callbacks != null) { @@ -118,7 +118,7 @@ } } - public void sendCallbacks(ModelService model, Map context, Map result, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService model, Map<String, Object> context, Map<String, Object> result, int mode) throws GenericServiceException { if (!allowCallbacks(model, context, mode)) return; List<GenericServiceCallback> callbacks = dispatcher.getCallbacks(model.name); if (callbacks != null) { @@ -134,7 +134,7 @@ } } - protected boolean allowCallbacks(ModelService model, Map context, int mode) throws GenericServiceException { + protected boolean allowCallbacks(ModelService model, Map<String, Object> context, int mode) throws GenericServiceException { return true; } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BSFEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BSFEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BSFEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BSFEngine.java Sat Oct 20 21:08:17 2007 @@ -24,6 +24,7 @@ import org.ofbiz.base.util.HttpClient; import org.ofbiz.base.util.HttpClientException; import org.ofbiz.base.util.cache.UtilCache; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilURL; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; @@ -48,23 +49,23 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { - Map result = runSync(localName, modelService, context); + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { + runSync(localName, modelService, context); } /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { Object result = serviceInvoker(localName, modelService, context); if (result == null || !(result instanceof Map)) throw new GenericServiceException("Service did not return expected result"); - return (Map) result; + return UtilGenerics.checkMap(result); } // Invoke the BSF Script. - private Object serviceInvoker(String localName, ModelService modelService, Map context) throws GenericServiceException { + private Object serviceInvoker(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { if (modelService.location == null || modelService.invoke == null) throw new GenericServiceException("Cannot locate service to invoke"); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java Sat Oct 20 21:08:17 2007 @@ -23,6 +23,7 @@ import org.ofbiz.base.util.HttpClient; import org.ofbiz.base.util.HttpClientException; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilURL; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.service.DispatchContext; @@ -47,19 +48,19 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { - Map result = runSync(localName, modelService, context); + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { + runSync(localName, modelService, context); } /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { return serviceInvoker(localName, modelService, context); } // Invoke the BeanShell Script. - private Map serviceInvoker(String localName, ModelService modelService, Map context) throws GenericServiceException { + private Map<String, Object> serviceInvoker(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { if (modelService.location == null || modelService.invoke == null) throw new GenericServiceException("Cannot locate service to invoke"); @@ -106,7 +107,7 @@ Interpreter bsh = new Interpreter(); - Map result = null; + Map<String, Object> result = null; try { bsh.set("dctx", dctx); // set the dispatch context @@ -114,8 +115,10 @@ bsh.eval(script); Object bshResult = bsh.get("result"); - if ((bshResult != null) && (bshResult instanceof Map)) - context.putAll((Map) bshResult); + if ((bshResult != null) && (bshResult instanceof Map)) { + Map<String, Object> bshMapResult = UtilGenerics.checkMap(bshResult); + context.putAll(bshMapResult); + } result = modelService.makeValid(context, ModelService.OUT_PARAM); } catch (EvalError e) { throw new GenericServiceException("BeanShell script threw an exception", e); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericAsyncEngine.java Sat Oct 20 21:08:17 2007 @@ -58,24 +58,24 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public abstract Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException; + public abstract Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException; /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public abstract void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException; + public abstract void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException; /** * @see org.ofbiz.service.engine.GenericEngine#runAsync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map, boolean) */ - public void runAsync(String localName, ModelService modelService, Map context, boolean persist) throws GenericServiceException { + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, boolean persist) throws GenericServiceException { runAsync(localName, modelService, context, null, persist); } /** * @see org.ofbiz.service.engine.GenericEngine#runAsync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map, org.ofbiz.service.GenericRequester, boolean) */ - public void runAsync(String localName, ModelService modelService, Map context, GenericRequester requester, boolean persist) throws GenericServiceException { + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, GenericRequester requester, boolean persist) throws GenericServiceException { DispatchContext dctx = dispatcher.getLocalContext(localName); Job job = null; @@ -107,7 +107,7 @@ String jobId = dispatcher.getDelegator().getNextSeqId("JobSandbox"); String jobName = Long.toString((new Date().getTime())); - Map jFields = UtilMisc.toMap("jobId", jobId, "jobName", jobName, "runTime", UtilDateTime.nowTimestamp()); + Map<String, Object> jFields = UtilMisc.toMap("jobId", jobId, "jobName", jobName, "runTime", UtilDateTime.nowTimestamp()); jFields.put("poolId", ServiceConfigUtil.getSendPool()); jFields.put("statusId", "SERVICE_PENDING"); jFields.put("serviceName", modelService.name); @@ -153,7 +153,7 @@ } } - protected boolean allowCallbacks(ModelService model, Map context, int mode) throws GenericServiceException { + protected boolean allowCallbacks(ModelService model, Map<String, Object> context, int mode) throws GenericServiceException { return mode == GenericEngine.SYNC_MODE; } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GenericEngine.java Sat Oct 20 21:08:17 2007 @@ -41,7 +41,7 @@ * @return Map of name, value pairs composing the result. * @throws GenericServiceException */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException; + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException; /** * Run the service synchronously and IGNORE the result. @@ -51,7 +51,7 @@ * @param context Map of name, value pairs composing the context. * @throws GenericServiceException */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException; + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException; /** * Run the service asynchronously, passing an instance of GenericRequester that will receive the result. @@ -63,7 +63,7 @@ * @param persist True for store/run; False for run. * @throws GenericServiceException */ - public void runAsync(String localName, ModelService modelService, Map context, GenericRequester requester, boolean persist) + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, GenericRequester requester, boolean persist) throws GenericServiceException; /** @@ -75,7 +75,7 @@ * @param persist True for store/run; False for run. * @throws GenericServiceException */ - public void runAsync(String localName, ModelService modelService, Map context, boolean persist) throws GenericServiceException; + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, boolean persist) throws GenericServiceException; /** * Send the service callbacks @@ -85,8 +85,8 @@ * @param mode Service mode (sync or async) * @throws GenericServiceException */ - public void sendCallbacks(ModelService modelService, Map context, int mode) throws GenericServiceException; - public void sendCallbacks(ModelService modelService, Map context, Map result, int mode) throws GenericServiceException; - public void sendCallbacks(ModelService modelService, Map context, Throwable t, int mode) throws GenericServiceException; + public void sendCallbacks(ModelService modelService, Map<String, Object> context, int mode) throws GenericServiceException; + public void sendCallbacks(ModelService modelService, Map<String, Object> context, Map<String, Object> result, int mode) throws GenericServiceException; + public void sendCallbacks(ModelService modelService, Map<String, Object> context, Throwable t, int mode) throws GenericServiceException; } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/HttpEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/HttpEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/HttpEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/HttpEngine.java Sat Oct 20 21:08:17 2007 @@ -30,6 +30,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.HttpClient; import org.ofbiz.base.util.HttpClientException; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.serialize.XmlSerializer; import org.ofbiz.service.DispatchContext; @@ -53,7 +54,7 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { DispatchContext dctx = dispatcher.getLocalContext(localName); String xmlContext = null; @@ -64,7 +65,7 @@ throw new GenericServiceException("Cannot serialize context.", e); } - Map parameters = FastMap.newInstance(); + Map<String, Object> parameters = FastMap.newInstance(); parameters.put("serviceName", modelService.invoke); if (xmlContext != null) parameters.put("serviceContext", xmlContext); @@ -77,11 +78,11 @@ throw new GenericServiceException("Problems invoking HTTP request", e); } - Map result = null; + Map<String, Object> result = null; try { Object res = XmlSerializer.deserialize(postResult, dctx.getDelegator()); if (res instanceof Map) - result = (Map) res; + result = UtilGenerics.checkMap(res); else throw new GenericServiceException("Result not an instance of Map."); } catch (Exception e) { @@ -94,8 +95,8 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { - Map result = runSync(localName, modelService, context); + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { + Map<String, Object> result = runSync(localName, modelService, context); } /** @@ -112,8 +113,8 @@ String serviceMode = request.getParameter("serviceMode"); String xmlContext = request.getParameter("serviceContext"); - Map result = FastMap.newInstance(); - Map context = null; + Map<String, Object> result = FastMap.newInstance(); + Map<String, Object> context = null; if (serviceName == null) result.put(ModelService.ERROR_MESSAGE, "Cannot have null service name"); @@ -127,7 +128,7 @@ try { Object o = XmlSerializer.deserialize(xmlContext, delegator); if (o instanceof Map) - context = (Map) o; + context = UtilGenerics.checkMap(o); else { Debug.logError("Context not an instance of Map error", module); result.put(ModelService.ERROR_MESSAGE, "Context not an instance of Map"); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/InterfaceEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/InterfaceEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/InterfaceEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/InterfaceEngine.java Sat Oct 20 21:08:17 2007 @@ -35,37 +35,37 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { throw new GenericServiceException("Interface services cannot be invoked; try invoking an implementing service."); } /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { throw new GenericServiceException("Interface services cannot be invoked; try invoking an implementing service."); } /** * @see org.ofbiz.service.engine.GenericEngine#runAsync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map, org.ofbiz.service.GenericRequester, boolean) */ - public void runAsync(String localName, ModelService modelService, Map context, GenericRequester requester, boolean persist) throws GenericServiceException { + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, GenericRequester requester, boolean persist) throws GenericServiceException { throw new GenericServiceException("Interface services cannot be invoked; try invoking an implementing service."); } /** * @see org.ofbiz.service.engine.GenericEngine#runAsync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map, boolean) */ - public void runAsync(String localName, ModelService modelService, Map context, boolean persist) throws GenericServiceException { + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, boolean persist) throws GenericServiceException { throw new GenericServiceException("Interface services cannot be invoked; try invoking an implementing service."); } - public void sendCallbacks(ModelService modelService, Map context, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService modelService, Map<String, Object> context, int mode) throws GenericServiceException { } - public void sendCallbacks(ModelService modelService, Map context, Map result, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService modelService, Map<String, Object> context, Map<String, Object> result, int mode) throws GenericServiceException { } - public void sendCallbacks(ModelService modelService, Map context, Throwable t, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService modelService, Map<String, Object> context, Throwable t, int mode) throws GenericServiceException { } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/RouteEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/RouteEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/RouteEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/RouteEngine.java Sat Oct 20 21:08:17 2007 @@ -37,37 +37,37 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { return modelService.makeValid(context, ModelService.OUT_PARAM); } /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { return; } /** * @see org.ofbiz.service.engine.GenericEngine#runAsync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map, org.ofbiz.service.GenericRequester, boolean) */ - public void runAsync(String localName, ModelService modelService, Map context, GenericRequester requester, boolean persist) throws GenericServiceException { - requester.receiveResult(FastMap.newInstance()); + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, GenericRequester requester, boolean persist) throws GenericServiceException { + requester.receiveResult(FastMap.<String, Object>newInstance()); } /** * @see org.ofbiz.service.engine.GenericEngine#runAsync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map, boolean) */ - public void runAsync(String localName, ModelService modelService, Map context, boolean persist) throws GenericServiceException { + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, boolean persist) throws GenericServiceException { return; } - public void sendCallbacks(ModelService modelService, Map context, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService modelService, Map<String, Object> context, int mode) throws GenericServiceException { } - public void sendCallbacks(ModelService modelService, Map context, Map result, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService modelService, Map<String, Object> context, Map<String, Object> result, int mode) throws GenericServiceException { } - public void sendCallbacks(ModelService modelService, Map context, Throwable t, int mode) throws GenericServiceException { + public void sendCallbacks(ModelService modelService, Map<String, Object> context, Throwable t, int mode) throws GenericServiceException { } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java Sat Oct 20 21:08:17 2007 @@ -59,15 +59,15 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { runSync(localName, modelService, context); } /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { - Map result = serviceInvoker(modelService, context); + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { + Map<String, Object> result = serviceInvoker(modelService, context); if (result == null) throw new GenericServiceException("Service did not return expected result"); @@ -75,7 +75,7 @@ } // Invoke the remote SOAP service - private Map serviceInvoker(ModelService modelService, Map context) throws GenericServiceException { + private Map<String, Object> serviceInvoker(ModelService modelService, Map<String, Object> context) throws GenericServiceException { if (modelService.location == null || modelService.invoke == null) throw new GenericServiceException("Cannot locate service to invoke"); @@ -145,8 +145,8 @@ return getResponseParams(call.getMessageContext().getResponseMessage()); } - private Map getResponseParams(Message respMessage) { - Map mRet = FastMap.newInstance(); + private Map<String, Object> getResponseParams(Message respMessage) { + Map<String, Object> mRet = FastMap.newInstance(); try { SOAPEnvelope resEnv = respMessage.getSOAPEnvelope(); List bodies = resEnv.getBodyElements(); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java Sat Oct 20 21:08:17 2007 @@ -27,6 +27,7 @@ import org.ofbiz.service.ModelService; import org.ofbiz.service.ServiceDispatcher; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilGenerics; /** * Standard Java Static Method Service Engine @@ -42,25 +43,25 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { Map result = runSync(localName, modelService, context); } /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { Object result = serviceInvoker(localName, modelService, context); if (result == null || !(result instanceof Map)) { throw new GenericServiceException("Service did not return expected result"); } - return (Map) result; + return UtilGenerics.checkMap(result); } // Invoke the static java method service. - private Object serviceInvoker(String localName, ModelService modelService, Map context) throws GenericServiceException { - // static java service methods should be: public Map methodName(DispatchContext dctx, Map context) + private Object serviceInvoker(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { + // static java service methods should be: public Map<String, Object> methodName(DispatchContext dctx, Map<String, Object> context) DispatchContext dctx = dispatcher.getLocalContext(localName); if (modelService == null) { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupModel.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupModel.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupModel.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupModel.java Sat Oct 20 21:08:17 2007 @@ -120,7 +120,7 @@ * @return Map Result Map * @throws GenericServiceException */ - public Map run(ServiceDispatcher dispatcher, String localName, Map context) throws GenericServiceException { + public Map<String, Object> run(ServiceDispatcher dispatcher, String localName, Map<String, Object> context) throws GenericServiceException { if (this.getSendMode().equals("all")) { return runAll(dispatcher, localName, context); } else if (this.getSendMode().equals("round-robin")) { @@ -150,12 +150,12 @@ return str.toString(); } - private Map runAll(ServiceDispatcher dispatcher, String localName, Map context) throws GenericServiceException { - Map runContext = UtilMisc.makeMapWritable(context); - Map result = FastMap.newInstance(); + private Map<String, Object> runAll(ServiceDispatcher dispatcher, String localName, Map<String, Object> context) throws GenericServiceException { + Map<String, Object> runContext = UtilMisc.makeMapWritable(context); + Map<String, Object> result = FastMap.newInstance(); for (GroupServiceModel model: services) { if (Debug.verboseOn()) Debug.logVerbose("Using Context: " + runContext, module); - Map thisResult = model.invoke(dispatcher, localName, runContext); + Map<String, Object> thisResult = model.invoke(dispatcher, localName, runContext); if (Debug.verboseOn()) Debug.logVerbose("Result: " + thisResult, module); // make sure we didn't fail @@ -173,13 +173,13 @@ return result; } - private Map runIndex(ServiceDispatcher dispatcher, String localName, Map context, int index) throws GenericServiceException { + private Map<String, Object> runIndex(ServiceDispatcher dispatcher, String localName, Map<String, Object> context, int index) throws GenericServiceException { GroupServiceModel model = services.get(index); return model.invoke(dispatcher, localName, context); } - private Map runOne(ServiceDispatcher dispatcher, String localName, Map context) throws GenericServiceException { - Map result = null; + private Map<String, Object> runOne(ServiceDispatcher dispatcher, String localName, Map<String, Object> context) throws GenericServiceException { + Map<String, Object> result = null; for (GroupServiceModel model: services) { try { result = model.invoke(dispatcher, localName, context); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java Sat Oct 20 21:08:17 2007 @@ -102,13 +102,13 @@ * @return Map result Map * @throws GenericServiceException */ - public Map invoke(ServiceDispatcher dispatcher, String localName, Map context) throws GenericServiceException { + public Map<String, Object> invoke(ServiceDispatcher dispatcher, String localName, Map<String, Object> context) throws GenericServiceException { DispatchContext dctx = dispatcher.getLocalContext(localName); ModelService model = dctx.getModelService(getName()); if (model == null) throw new GenericServiceException("Group defined service (" + getName() + ") is not a defined service."); - Map thisContext = model.makeValid(context, ModelService.IN_PARAM); + Map<String, Object> thisContext = model.makeValid(context, ModelService.IN_PARAM); Debug.logInfo("Running grouped service [" + serviceName + "]", module); if (getMode().equals("async")) { List<String> requiredOut = model.getParameterNames(ModelService.OUT_PARAM, false); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupEngine.java Sat Oct 20 21:08:17 2007 @@ -41,7 +41,7 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { GroupModel groupModel = modelService.internalGroup; if (groupModel == null) { groupModel = ServiceGroupReader.getGroupModel(this.getLocation(modelService)); @@ -55,7 +55,7 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { runSync(localName, modelService, context); } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/AbstractJmsListener.java Sat Oct 20 21:08:17 2007 @@ -27,6 +27,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.ObjectType; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.entity.serialize.XmlSerializer; import org.ofbiz.service.*; @@ -53,8 +54,8 @@ * @param message * @return Map */ - protected Map runService(MapMessage message) { - Map context = null; + protected Map<String, Object> runService(MapMessage message) { + Map<String, ? extends Object> context = null; String serviceName = null; String xmlContext = null; @@ -70,7 +71,7 @@ if (Debug.verboseOn()) Debug.logVerbose("De-Serialized Context --> " + o, module); if (ObjectType.instanceOf(o, "java.util.Map")) - context = (Map) o; + context = UtilGenerics.checkMap(o); } catch (JMSException je) { Debug.logError(je, "Problems reading message.", module); } catch (Exception e) { @@ -89,7 +90,7 @@ if (Debug.verboseOn()) Debug.logVerbose("Running service: " + serviceName, module); - Map result = null; + Map<String, Object> result = null; if (context != null) { try { result = dispatcher.runSync(serviceName, context); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java Sat Oct 20 21:08:17 2007 @@ -93,7 +93,7 @@ return serviceElement; } - protected Message makeMessage(Session session, ModelService modelService, Map context) + protected Message makeMessage(Session session, ModelService modelService, Map<String, Object> context) throws GenericServiceException, JMSException { List<String> outParams = modelService.getParameterNames(ModelService.OUT_PARAM, false); @@ -127,7 +127,7 @@ } } - protected Map runTopic(ModelService modelService, Map context, Element server) throws GenericServiceException { + protected Map<String, Object> runTopic(ModelService modelService, Map<String, Object> context, Element server) throws GenericServiceException { String serverName = server.getAttribute("jndi-server-name"); String jndiName = server.getAttribute("jndi-name"); String topicName = server.getAttribute("topic-queue"); @@ -186,7 +186,7 @@ } - protected Map runQueue(ModelService modelService, Map context, Element server) throws GenericServiceException { + protected Map<String, Object> runQueue(ModelService modelService, Map<String, Object> context, Element server) throws GenericServiceException { String serverName = server.getAttribute("jndi-server-name"); String jndiName = server.getAttribute("jndi-name"); String queueName = server.getAttribute("topic-queue"); @@ -244,7 +244,7 @@ return ServiceUtil.returnSuccess(); } - protected Map runXaQueue(ModelService modelService, Map context, Element server) throws GenericServiceException { + protected Map<String, Object> runXaQueue(ModelService modelService, Map<String, Object> context, Element server) throws GenericServiceException { String serverName = server.getAttribute("jndi-server-name"); String jndiName = server.getAttribute("jndi-name"); String queueName = server.getAttribute("topic-queue"); @@ -315,11 +315,11 @@ return ServiceUtil.returnSuccess(); } - protected Map run(ModelService modelService, Map context) throws GenericServiceException { + protected Map<String, Object> run(ModelService modelService, Map<String, Object> context) throws GenericServiceException { Element serviceElement = getServiceElement(modelService); List<? extends Element> serverList = serverList(serviceElement); - Map result = FastMap.newInstance(); + Map<String, Object> result = FastMap.newInstance(); for (Element server: serverList) { String serverType = server.getAttribute("type"); @@ -336,22 +336,22 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { return run(modelService, context); } /** * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { run(modelService, context); } /** * @see org.ofbiz.service.engine.GenericEngine#runAsync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map, org.ofbiz.service.GenericRequester, boolean) */ - public void runAsync(String localName, ModelService modelService, Map context, GenericRequester requester, boolean persist) throws GenericServiceException { - Map result = run(modelService, context); + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, GenericRequester requester, boolean persist) throws GenericServiceException { + Map<String, Object> result = run(modelService, context); requester.receiveResult(result); } @@ -359,7 +359,7 @@ /** * @see org.ofbiz.service.engine.GenericEngine#runAsync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map, boolean) */ - public void runAsync(String localName, ModelService modelService, Map context, boolean persist) throws GenericServiceException { + public void runAsync(String localName, ModelService modelService, Map<String, Object> context, boolean persist) throws GenericServiceException { run(modelService, context); } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/GenericServiceJob.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/GenericServiceJob.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/GenericServiceJob.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/GenericServiceJob.java Sat Oct 20 21:08:17 2007 @@ -37,9 +37,9 @@ protected transient DispatchContext dctx = null; private String service = null; - private Map context = null; + private Map<String, Object> context = null; - public GenericServiceJob(DispatchContext dctx, String jobId, String jobName, String service, Map context, GenericRequester req) { + public GenericServiceJob(DispatchContext dctx, String jobId, String jobName, String service, Map<String, Object> context, GenericRequester req) { super(jobId, jobName); this.dctx = dctx; this.service = service; @@ -66,7 +66,7 @@ try { // get the dispatcher and invoke the service via runSync -- will run all ECAs LocalDispatcher dispatcher = dctx.getDispatcher(); - Map result = dispatcher.runSync(getServiceName(), getContext()); + Map<String, Object> result = dispatcher.runSync(getServiceName(), getContext()); // check for a failure boolean isError = ModelService.RESPOND_ERROR.equals(result.get(ModelService.RESPONSE_MESSAGE)); @@ -121,7 +121,7 @@ * Gets the context for the service invocation. * @return Map of name value pairs making up the service context. */ - protected Map getContext() throws InvalidJobException { + protected Map<String, Object> getContext() throws InvalidJobException { return context; } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java Sat Oct 20 21:08:17 2007 @@ -266,7 +266,7 @@ *@param interval The interval of the frequency recurrence *@param count The number of times to repeat */ - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count) throws JobManagerException { + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count) throws JobManagerException { schedule(serviceName, context, startTime, frequency, interval, count, 0); } @@ -279,7 +279,7 @@ *@param interval The interval of the frequency recurrence *@param endTime The time in milliseconds the service should expire */ - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, long endTime) throws JobManagerException { + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, long endTime) throws JobManagerException { schedule(serviceName, context, startTime, frequency, interval, -1, endTime); } @@ -293,7 +293,7 @@ *@param count The number of times to repeat *@param endTime The time in milliseconds the service should expire */ - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime) throws JobManagerException { + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime) throws JobManagerException { schedule(null, serviceName, context, startTime, frequency, interval, count, endTime); } @@ -308,7 +308,7 @@ *@param count The number of times to repeat *@param endTime The time in milliseconds the service should expire */ - public void schedule(String poolName, String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime) throws JobManagerException { + public void schedule(String poolName, String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime) throws JobManagerException { schedule(null, null, serviceName, context, startTime, frequency, interval, count, endTime, -1); } @@ -325,7 +325,7 @@ *@param endTime The time in milliseconds the service should expire *@param maxRetry The max number of retries on failure (-1 for no max) */ - public void schedule(String jobName, String poolName, String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime, int maxRetry) throws JobManagerException { + 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 JobManagerException { if (delegator == null) { Debug.logWarning("No delegator referenced; cannot schedule job.", module); return; Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java Sat Oct 20 21:08:17 2007 @@ -30,6 +30,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; @@ -228,14 +229,14 @@ /** * @see org.ofbiz.service.job.GenericServiceJob#getContext() */ - protected Map getContext() throws InvalidJobException { - Map context = null; + protected Map<String, Object> getContext() throws InvalidJobException { + Map<String, Object> context = null; try { GenericValue jobObj = getJob(); if (!UtilValidate.isEmpty(jobObj.getString("runtimeDataId"))) { GenericValue contextObj = jobObj.getRelatedOne("RuntimeData"); if (contextObj != null) { - context = (Map) XmlSerializer.deserialize(contextObj.getString("runtimeInfo"), delegator); + context = UtilGenerics.checkMap(XmlSerializer.deserialize(contextObj.getString("runtimeInfo"), delegator), String.class, Object.class); } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java Sat Oct 20 21:08:17 2007 @@ -20,6 +20,8 @@ import java.util.Map; +import javolution.util.FastMap; + import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; @@ -51,11 +53,12 @@ } public boolean runAction(LocalDispatcher dispatcher, MimeMessageWrapper messageWrapper, GenericValue userLogin) throws GenericServiceException { - Map serviceContext = UtilMisc.toMap("messageWrapper", messageWrapper, "userLogin", userLogin); + Map<String, Object> serviceContext = FastMap.newInstance(); + serviceContext.putAll(UtilMisc.toMap("messageWrapper", messageWrapper, "userLogin", userLogin)); serviceContext.put("userLogin", ServiceUtil.getUserLogin(dispatcher.getDispatchContext(), serviceContext, runAsUser)); if (serviceMode.equals("sync")) { - Map result = dispatcher.runSync(serviceName, serviceContext); + Map<String, Object> result = dispatcher.runSync(serviceName, serviceContext); if (ServiceUtil.isError(result)) { Debug.logError(ServiceUtil.getErrorMessage(result), module); return false; Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java Sat Oct 20 21:08:17 2007 @@ -79,9 +79,9 @@ public boolean eval(LocalDispatcher dispatcher, MimeMessageWrapper messageWrapper, GenericValue userLogin) { boolean passedCondition = false; if (serviceName != null) { - Map result = null; + Map<String, Object> result = null; try { - result = dispatcher.runSync(serviceName, UtilMisc.toMap("messageWrapper", messageWrapper, "userLogin", userLogin)); + result = dispatcher.runSync(serviceName, UtilMisc.<String, Object>toMap("messageWrapper", messageWrapper, "userLogin", userLogin)); } catch (GenericServiceException e) { Debug.logError(e, module); return false; Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java Sat Oct 20 21:08:17 2007 @@ -76,7 +76,6 @@ } int numDefs = 0; - for (Element e: UtilXml.childElementList(rootElement, "mca")) { String ruleName = e.getAttribute("mail-rule-name"); mcaCache.put(ruleName, new ServiceMcaRule(e)); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java Sat Oct 20 21:08:17 2007 @@ -61,15 +61,15 @@ } } - public Map runTestService() throws RemoteException, GenericServiceException { - Map context = FastMap.newInstance(); + public Map<String, Object> runTestService() throws RemoteException, GenericServiceException { + Map<String, Object> context = FastMap.newInstance(); context.put("message", "Remote Service Test"); return rd.runSync("testScv", context); } public static void main(String[] args) throws Exception { ExampleRemoteClient rm = new ExampleRemoteClient(); - Map result = rm.runTestService(); + Map<String, Object> result = rm.runTestService(); System.out.println("Service Result Map: " + result); } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcher.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcher.java Sat Oct 20 21:08:17 2007 @@ -39,7 +39,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public Map runSync(String serviceName, Map context) throws GenericServiceException, RemoteException; + public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteException; /** * Run the service synchronously with a specified timeout and return the result. @@ -50,7 +50,7 @@ * @return Map of name, value pairs composing the result. * @throws GenericServiceException */ - public Map runSync(String serviceName, Map context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException; + public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException; /** * Run the service synchronously and IGNORE the result. @@ -59,7 +59,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void runSyncIgnore(String serviceName, Map context) throws GenericServiceException, RemoteException; + public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteException; /** * Run the service synchronously with a specified timeout and IGNORE the result. @@ -69,7 +69,7 @@ * @param requireNewTransaction if true we will suspend and create a new transaction so we are sure to start. * @throws GenericServiceException */ - public void runSyncIgnore(String serviceName, Map context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException; + public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException; /** * Run the service asynchronously, passing an instance of GenericRequester that will receive the result. @@ -81,7 +81,7 @@ * @param requireNewTransaction if true we will suspend and create a new transaction so we are sure to start. * @throws GenericServiceException */ - public void runAsync(String serviceName, Map context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException; + public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException; /** * Run the service asynchronously, passing an instance of GenericRequester that will receive the result. @@ -92,7 +92,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void runAsync(String serviceName, Map context, GenericRequester requester, boolean persist) throws GenericServiceException, RemoteException; + public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist) throws GenericServiceException, RemoteException; /** * Run the service asynchronously, passing an instance of GenericRequester that will receive the result. @@ -103,7 +103,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void runAsync(String serviceName, Map context, GenericRequester requester) throws GenericServiceException, RemoteException; + public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester) throws GenericServiceException, RemoteException; /** * Run the service asynchronously and IGNORE the result. @@ -113,7 +113,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void runAsync(String serviceName, Map context, boolean persist) throws GenericServiceException, RemoteException; + public void runAsync(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException, RemoteException; /** * Run the service asynchronously and IGNORE the result. This method WILL persist the job. @@ -122,7 +122,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void runAsync(String serviceName, Map context) throws GenericServiceException, RemoteException; + public void runAsync(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteException; /** * Run the service asynchronously. @@ -133,7 +133,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public GenericResultWaiter runAsyncWait(String serviceName, Map context, boolean persist) throws GenericServiceException, RemoteException; + public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException, RemoteException; /** * Run the service asynchronously. This method WILL persist the job. @@ -143,7 +143,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public GenericResultWaiter runAsyncWait(String serviceName, Map context) throws GenericServiceException, RemoteException; + public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteException; /** * Schedule a service to run asynchronously at a specific start time. @@ -157,7 +157,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException, RemoteException; + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException, RemoteException; /** * Schedule a service to run asynchronously at a specific start time. @@ -170,7 +170,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count) throws GenericServiceException, RemoteException; + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count) throws GenericServiceException, RemoteException; /** * Schedule a service to run asynchronously at a specific start time. @@ -183,7 +183,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException, RemoteException; + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException, RemoteException; /** * Schedule a service to run asynchronously at a specific start time. @@ -193,7 +193,7 @@ * @throws GenericServiceException * @throws RemoteException */ - public void schedule(String serviceName, Map context, long startTime) throws GenericServiceException, RemoteException; + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime) throws GenericServiceException, RemoteException; } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcherImpl.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcherImpl.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcherImpl.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RemoteDispatcherImpl.java Sat Oct 20 21:08:17 2007 @@ -47,77 +47,77 @@ // RemoteDispatcher methods - public Map runSync(String serviceName, Map context) throws GenericServiceException, RemoteException { + public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); return dispatcher.runSync(serviceName, context); } - public Map runSync(String serviceName, Map context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException { + public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); return dispatcher.runSync(serviceName, context, transactionTimeout, requireNewTransaction); } - public void runSyncIgnore(String serviceName, Map context) throws GenericServiceException, RemoteException { + public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.runSyncIgnore(serviceName, context); } - public void runSyncIgnore(String serviceName, Map context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException { + public void runSyncIgnore(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.runSyncIgnore(serviceName, context, transactionTimeout, requireNewTransaction); } - public void runAsync(String serviceName, Map context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException { + public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist, int transactionTimeout, boolean requireNewTransaction) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.runAsync(serviceName, context, requester, persist, transactionTimeout, requireNewTransaction); } - public void runAsync(String serviceName, Map context, GenericRequester requester, boolean persist) throws GenericServiceException, RemoteException { + public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester, boolean persist) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.runAsync(serviceName, context, requester, persist); } - public void runAsync(String serviceName, Map context, GenericRequester requester) throws GenericServiceException, RemoteException { + public void runAsync(String serviceName, Map<String, ? extends Object> context, GenericRequester requester) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.runAsync(serviceName, context, requester); } - public void runAsync(String serviceName, Map context, boolean persist) throws GenericServiceException, RemoteException { + public void runAsync(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.runAsync(serviceName, context, persist); } - public void runAsync(String serviceName, Map context) throws GenericServiceException, RemoteException { + public void runAsync(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.runAsync(serviceName, context); } - public GenericResultWaiter runAsyncWait(String serviceName, Map context, boolean persist) throws GenericServiceException, RemoteException { + public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context, boolean persist) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); return dispatcher.runAsyncWait(serviceName, context, persist); } - public GenericResultWaiter runAsyncWait(String serviceName, Map context) throws GenericServiceException, RemoteException { + public GenericResultWaiter runAsyncWait(String serviceName, Map<String, ? extends Object> context) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); return dispatcher.runAsyncWait(serviceName, context); } - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException, RemoteException { + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count, long endTime) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.schedule(serviceName, context, startTime, frequency, interval, count, endTime); } - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, int count) throws GenericServiceException, RemoteException { + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, int count) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.schedule(serviceName, context, startTime, frequency, interval, count); } - public void schedule(String serviceName, Map context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException, RemoteException { + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime, int frequency, int interval, long endTime) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.schedule(serviceName, context, startTime, frequency, interval, endTime); } - public void schedule(String serviceName, Map context, long startTime) throws GenericServiceException, RemoteException { + public void schedule(String serviceName, Map<String, ? extends Object> context, long startTime) throws GenericServiceException, RemoteException { this.checkExportFlag(serviceName); dispatcher.schedule(serviceName, context, startTime); } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceEngine.java?rev=586856&r1=586855&r2=586856&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceEngine.java Sat Oct 20 21:08:17 2007 @@ -37,15 +37,15 @@ super(dispatcher); } - public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { + public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { return run(modelService, context); } - public void runSyncIgnore(String localName, ModelService modelService, Map context) throws GenericServiceException { + public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException { run(modelService, context); } - protected Map run(ModelService service, Map context) throws GenericServiceException { + protected Map<String, Object> run(ModelService service, Map<String, Object> context) throws GenericServiceException { // locate the remote dispatcher RemoteDispatcher rd = null; try { @@ -58,7 +58,7 @@ throw new GenericServiceException("RMI Error", e); } - Map result = null; + Map<String, Object> result = null; if (rd != null) { try { result = rd.runSync(service.invoke, context); |
Free forum by Nabble | Edit this page |