KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > server > standard > QueueDeliveryEndpointFactory


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.jms.server.standard;
8
9 import org.jboss.jms.message.JBossMessage;
10 import org.jboss.jms.server.DeliveryEndpoint;
11 import org.jboss.jms.server.DeliveryEndpointFactory;
12 import org.jboss.jms.server.MessageBroker;
13 import org.jboss.jms.server.MessageReference;
14 import org.jboss.jms.server.list.MessageList;
15
16 /**
17  * A queue delivery endpoint factory
18  *
19  * @author <a HREF="mailto:adrian@jboss.org>Adrian Brock</a>
20  * @version $Revision: 1.1 $
21  */

22 public class QueueDeliveryEndpointFactory
23    implements DeliveryEndpointFactory
24 {
25    // Constants -----------------------------------------------------
26

27    // Attributes ----------------------------------------------------
28

29    /** The message broker */
30    private MessageBroker broker;
31
32    /** The message list */
33    private MessageList list;
34
35    // Static --------------------------------------------------------
36

37    // Constructors --------------------------------------------------
38

39    public QueueDeliveryEndpointFactory(MessageBroker broker, MessageList list)
40    {
41       this.broker = broker;
42       this.list = list;
43    }
44
45    // Public --------------------------------------------------------
46

47    // DeliveryEndpointFactory implementation ------------------------
48

49    public DeliveryEndpoint getDeliveryEndpoint(MessageReference message)
50    {
51       return new QueueDeliveryEndpoint(list);
52    }
53
54    public MessageReference getMessageReference(JBossMessage message)
55    {
56       return broker.getMessageReference(message);
57    }
58
59    // Protected ------------------------------------------------------
60

61    // Package Private ------------------------------------------------
62

63    // Private --------------------------------------------------------
64

65    // Inner Classes --------------------------------------------------
66
}
67
Popular Tags