01: /*
02: * $Id: SingleJmsMessageReceiver.java 10961 2008-02-22 19:01:02Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.transport.jms;
12:
13: import org.mule.api.endpoint.InboundEndpoint;
14: import org.mule.api.lifecycle.CreateException;
15: import org.mule.api.service.Service;
16: import org.mule.api.transport.Connector;
17:
18: import javax.jms.Message;
19: import javax.jms.MessageListener;
20:
21: /**
22: * Registers a single Jms MessageListener for an endpoint
23: */
24: public class SingleJmsMessageReceiver extends JmsMessageReceiver
25: implements MessageListener {
26:
27: public SingleJmsMessageReceiver(Connector connector,
28: Service service, InboundEndpoint endpoint)
29: throws CreateException {
30: super (connector, service, endpoint);
31: }
32:
33: public void onMessage(Message message) {
34: try {
35: JmsWorker worker = new JmsWorker(message, this );
36: worker.run();
37: } catch (Exception e) {
38: handleException(e);
39: }
40: }
41: }
|