01: /*
02: * Copyright 2007 The Kuali Foundation
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package edu.iu.uis.eden.messaging;
17:
18: import org.kuali.rice.lifecycle.BaseLifecycle;
19:
20: import edu.iu.uis.eden.messaging.callforwarding.ForwardedCallHandlerImpl;
21: import edu.iu.uis.eden.messaging.config.ServiceBasedServiceDefinitionRegisterer;
22:
23: /**
24: * Implementation of the Bus Admin service.
25: *
26: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
27: */
28: public class BusAdminServiceImpl extends BaseLifecycle implements
29: BusAdminService {
30:
31: private ServiceBasedServiceDefinitionRegisterer defRegisterer;
32:
33: public void forward(PersistedMessage message) throws Exception {
34: // this is just weird...
35: AsynchronousCall methodCall = message.getPayload()
36: .getMethodCall();
37: message.setMethodCall(methodCall);
38: // TODO there's probably a better way to servisize or refactor this
39: new ForwardedCallHandlerImpl().handleCall(message);
40: }
41:
42: public void ping() {
43: }
44:
45: public void start() throws Exception {
46: this .defRegisterer = new ServiceBasedServiceDefinitionRegisterer(
47: "ksb.busAdminServiceDefinition");
48: this .defRegisterer.registerServiceDefinition(false);
49: setStarted(true);
50: }
51:
52: public void stop() throws Exception {
53: this .defRegisterer.unregisterServiceDefinition();
54: setStarted(false);
55: }
56:
57: }
|