01: /*******************************************************************************
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: *******************************************************************************/package org.ofbiz.service.group;
19:
20: import java.util.Map;
21:
22: import org.ofbiz.service.GenericServiceException;
23: import org.ofbiz.service.ModelService;
24: import org.ofbiz.service.ServiceDispatcher;
25: import org.ofbiz.service.engine.GenericAsyncEngine;
26:
27: /**
28: * ServiceGroupEngine.java
29: */
30: public class ServiceGroupEngine extends GenericAsyncEngine {
31:
32: /**
33: * Constructor for ServiceGroupEngine.
34: * @param dispatcher
35: */
36: public ServiceGroupEngine(ServiceDispatcher dispatcher) {
37: super (dispatcher);
38: }
39:
40: /**
41: * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map)
42: */
43: public Map runSync(String localName, ModelService modelService,
44: Map context) throws GenericServiceException {
45: GroupModel groupModel = modelService.internalGroup;
46: if (groupModel == null) {
47: groupModel = ServiceGroupReader.getGroupModel(this
48: .getLocation(modelService));
49: }
50: if (groupModel == null)
51: throw new GenericServiceException(
52: "GroupModel was null; not a valid ServiceGroup!");
53:
54: return groupModel.run(dispatcher, localName, context);
55: }
56:
57: /**
58: * @see org.ofbiz.service.engine.GenericEngine#runSyncIgnore(java.lang.String, org.ofbiz.service.ModelService, java.util.Map)
59: */
60: public void runSyncIgnore(String localName,
61: ModelService modelService, Map context)
62: throws GenericServiceException {
63: runSync(localName, modelService, context);
64: }
65: }
|