01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.messaging;
18:
19: import javax.jms.ConnectionFactory;
20:
21: import org.kuali.rice.config.ConfigurationException;
22:
23: /**
24: *
25: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
26: */
27: public class JmsServiceDefinition extends ServiceDefinition {
28:
29: /**
30: *
31: */
32: private static final long serialVersionUID = 4406697016217436247L;
33:
34: private ConnectionFactory connectionFactory;
35: private String serviceInterface;
36:
37: @Override
38: public void validate() {
39: super .validate();
40: //if interface is null grab the first one and use it
41: if (getServiceInterface() == null) {
42: if (this .getService().getClass().getInterfaces().length == 0) {
43: throw new ConfigurationException(
44: "Service needs to implement interface to be exported as SOAP service");
45: }
46: setServiceInterface(this .getService().getClass()
47: .getInterfaces()[0].getName());
48: }
49: if (getBusSecurity() == null) {
50: setBusSecurity(false);
51: }
52: }
53:
54: public ConnectionFactory getConnectionFactory() {
55: return this .connectionFactory;
56: }
57:
58: public void setConnectionFactory(ConnectionFactory connectionFactory) {
59: this .connectionFactory = connectionFactory;
60: }
61:
62: public String getServiceInterface() {
63: return this .serviceInterface;
64: }
65:
66: public void setServiceInterface(String interfaceName) {
67: this .serviceInterface = interfaceName;
68: }
69:
70: @Override
71: public boolean isSame(ServiceDefinition serviceDefinition) {
72: boolean same = super .isSame(serviceDefinition)
73: && serviceDefinition instanceof JavaServiceDefinition;
74: if (!same) {
75: return same;
76: }
77: return ((JavaServiceDefinition) serviceDefinition)
78: .getServiceInterface().equals(
79: this.getServiceInterface());
80: }
81:
82: }
|