01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id: ConsumerProcessor.java 6901 2007-04-18 18:54:24Z tvolle $
23: */
24: package com.bostechcorp.cbesb.runtime.component.tcpip.processors;
25:
26: import java.util.concurrent.atomic.AtomicBoolean;
27:
28: import javax.jbi.messaging.MessageExchange;
29: import javax.jbi.messaging.NormalizedMessage;
30:
31: import org.apache.commons.logging.Log;
32: import org.apache.commons.logging.LogFactory;
33:
34: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.CbConsumerProcessor;
35: import com.bostechcorp.cbesb.common.util.ErrorUtil;
36: import com.bostechcorp.cbesb.runtime.component.tcpip.TcpipEndpoint;
37:
38: public class ConsumerProcessor extends CbConsumerProcessor {
39:
40: protected final transient Log logger = LogFactory
41: .getLog(getClass());
42: protected AtomicBoolean running = new AtomicBoolean(false);
43:
44: public ConsumerProcessor(TcpipEndpoint endpoint) {
45: super (endpoint);
46: }
47:
48: protected void doStart() throws Exception {
49:
50: try {
51: } catch (Exception e) {
52:
53: ErrorUtil.printError("Exception in doStart(): ", e);
54: throw new Exception(e.getMessage());
55: }
56:
57: synchronized (running) {
58: running.wait();
59: }
60:
61: }
62:
63: protected void doStop() throws Exception {
64: synchronized (running) {
65: running.set(false);
66: running.notify();
67: }
68: }
69:
70: @Override
71: protected void doProcessFault(NormalizedMessage nm, String fault)
72: throws Exception {
73:
74: }
75:
76: /*
77: * Process out situation
78: * @see com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.BaseConsumerProcessor#doProcessOut(javax.jbi.messaging.NormalizedMessage, java.lang.String)
79: */
80: @Override
81: protected void doProcessOut(NormalizedMessage nm, String s,
82: MessageExchange exchange) throws Exception {
83:
84: }
85: }
|