01: /*********************************************************************************
02: * The contents of this file are subject to the OpenI Public License Version 1.0
03: * ("License"); You may not use this file except in compliance with the
04: * License. You may obtain a copy of the License at
05: * http://www.openi.org/docs/LICENSE.txt
06: *
07: * Software distributed under the License is distributed on an "AS IS" basis,
08: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
09: * the specific language governing rights and limitations under the License.
10: *
11: * The Original Code is: OpenI Open Source
12: *
13: * The Initial Developer of the Original Code is Loyalty Matrix, Inc.
14: * Portions created by Loyalty Matrix, Inc. are
15: * Copyright (C) 2005 Loyalty Matrix, Inc.; All Rights Reserved.
16: *
17: * Contributor(s): ______________________________________.
18: *
19: ********************************************************************************/package org.openi.jms.helper;
20:
21: import org.springframework.beans.factory.DisposableBean;
22:
23: /**
24: * @author Dipendra Pokhrel <br>
25: * @version $Revision$ $Date$ <br>
26: *
27: * Manager class used to initialize release JMS Listener Connection.
28: *
29: */
30:
31: public class JmsManager implements DisposableBean {
32:
33: private CustomMessageListenerContainer drillthroughListenerContainer;
34: private CustomMessageListenerContainer listPullListenerContainer;
35:
36: private boolean initialized;
37:
38: public void destroy() throws Exception {
39:
40: }
41:
42: public CustomMessageListenerContainer getDrillthroughListenerContainer() {
43: return drillthroughListenerContainer;
44: }
45:
46: public void setDrillthroughListenerContainer(
47: CustomMessageListenerContainer drillthroughListenerContainer) {
48: this .drillthroughListenerContainer = drillthroughListenerContainer;
49: }
50:
51: public CustomMessageListenerContainer getListPullListenerContainer() {
52: return listPullListenerContainer;
53: }
54:
55: public void setListPullListenerContainer(
56: CustomMessageListenerContainer listPullListenerContainer) {
57: this .listPullListenerContainer = listPullListenerContainer;
58: }
59:
60: public void connectListeners() {
61: if (!initialized) {
62: drillthroughListenerContainer.doInitialize();
63: listPullListenerContainer.doInitialize();
64: initialized = true;
65: }
66: }
67:
68: public void disconnectListeners() {
69: if (initialized) {
70: drillthroughListenerContainer.doRelease();
71: listPullListenerContainer.doRelease();
72: initialized = false;
73: }
74: }
75:
76: public boolean isInitialized() {
77: return this.initialized;
78: }
79: }
|