KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > client > JBossBrowser


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.client;
8
9 import java.util.Enumeration JavaDoc;
10
11 import javax.jms.JMSException JavaDoc;
12 import javax.jms.Queue JavaDoc;
13 import javax.jms.QueueBrowser JavaDoc;
14
15 /**
16  * A browser
17  *
18  * @author <a HREF="mailto:adrian@jboss.org>Adrian Brock</a>
19  * @version $Revision: 1.2 $
20  */

21 public class JBossBrowser
22    implements QueueBrowser JavaDoc
23 {
24    // Constants -----------------------------------------------------
25

26    // Attributes ----------------------------------------------------
27

28    /** The delegate */
29    private BrowserDelegate delegate;
30    
31    /** The queue */
32    private Queue JavaDoc queue;
33    
34    /** The message selector */
35    private String JavaDoc selector;
36
37     // Static --------------------------------------------------------
38

39    // Constructors --------------------------------------------------
40

41    // Public --------------------------------------------------------
42

43    /**
44     * Create a new JBossBrowser
45     *
46     * @param delegate the delegate
47     * @param queue the queue
48     * @param selector the selector
49     * @throws JMSException for any error
50     */

51    public JBossBrowser(BrowserDelegate delegate, Queue JavaDoc queue, String JavaDoc selector)
52       throws JMSException JavaDoc
53    {
54       this.delegate = delegate;
55       this.queue = queue;
56       this.selector = selector;
57    }
58
59    // QueueBrowser implementation -----------------------------------
60

61    public void close() throws JMSException JavaDoc
62    {
63       delegate.closing();
64       delegate.close();
65    }
66
67    public Enumeration JavaDoc getEnumeration() throws JMSException JavaDoc
68    {
69       return new BrowserEnumeration(delegate.browse());
70    }
71
72    public String JavaDoc getMessageSelector() throws JMSException JavaDoc
73    {
74       return selector;
75    }
76
77    public Queue JavaDoc getQueue() throws JMSException JavaDoc
78    {
79       return queue;
80    }
81
82    // Protected ------------------------------------------------------
83

84    // Package Private ------------------------------------------------
85

86    // Private --------------------------------------------------------
87

88    // Inner Classes --------------------------------------------------
89

90 }
91
Popular Tags