Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/activemq/broker/BrokerConnector.java


1   /** 
2    * 
3    * Copyright 2004 Protique Ltd
4    * 
5    * Licensed under the Apache License, Version 2.0 (the "License"); 
6    * you may not use this file except in compliance with the License. 
7    * You may obtain a copy of the License at 
8    * 
9    * http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, 
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
14   * See the License for the specific language governing permissions and 
15   * limitations under the License. 
16   * 
17   **/
18  
19  package org.activemq.broker;
20  
21  import org.activemq.message.ActiveMQMessage;
22  import org.activemq.message.ActiveMQXid;
23  import org.activemq.message.BrokerInfo;
24  import org.activemq.message.ConnectionInfo;
25  import org.activemq.message.ConsumerInfo;
26  import org.activemq.message.DurableUnsubscribe;
27  import org.activemq.message.MessageAck;
28  import org.activemq.message.ProducerInfo;
29  import org.activemq.message.SessionInfo;
30  import org.activemq.service.Service;
31  import org.activemq.transport.TransportServerChannel;
32  
33  import javax.jms.JMSException;
34  import javax.jms.JMSSecurityException;
35  import javax.transaction.xa.XAException;
36  
37  /**
38   * The Broker is the client side interface to the JMS server
39   *
40   * @version $Revision: 1.1.1.1 $
41   */
42  public interface BrokerConnector extends Service {
43  
44      /**
45       * @return infomation about the Broker
46       */
47      public BrokerInfo getBrokerInfo();
48  
49      /**
50       * @return the transport channel this broker is using
51       */
52      public TransportServerChannel getServerChannel();
53  
54      /**
55       * Get a hint about the broker capacity for more messages
56       *
57       * @return percentage value (0-100) about how much capacity the
58       *         broker has
59       */
60      public int getBrokerCapacity();
61  
62      /**
63       * Register a Broker Client
64       *
65       * @param client
66       * @param info   contains infomation about the Connection this Client
67       *               represents
68       * @throws JMSException
69       * @throws javax.jms.InvalidClientIDException
70       *                              if the JMS client specifies an invalid or duplicate client
71       *                              ID.
72       * @throws JMSSecurityException if client authentication fails due to an invalid user name or
73       *                              password.
74       */
75      public void registerClient(BrokerClient client, ConnectionInfo info) throws JMSException;
76  
77      /**
78       * Deregister a Broker Client
79       *
80       * @param client
81       * @param info
82       * @throws JMSException if some internal error occurs
83       */
84  
85      public void deregisterClient(BrokerClient client, ConnectionInfo info) throws JMSException;
86  
87      /**
88       * Registers a MessageConsumer
89       *
90       * @param client
91       * @param info
92       * @throws JMSException
93       * @throws JMSSecurityException if client authentication fails for the Destination the
94       *                              Consumer applies for
95       */
96      public void registerMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException;
97  
98      /**
99       * De-register a MessageConsumer from the Broker
100      *
101      * @param client
102      * @param info
103      * @throws JMSException
104      */
105     public void deregisterMessageConsumer(BrokerClient client, ConsumerInfo info) throws JMSException;
106 
107     /**
108      * Registers a MessageProducer
109      *
110      * @param client
111      * @param info
112      * @throws JMSException
113      * @throws JMSSecurityException if client authentication fails for the Destination the
114      *                              Consumer applies for
115      */
116 
117     public void registerMessageProducer(BrokerClient client, ProducerInfo info) throws JMSException;
118 
119     /**
120      * De-register a MessageProducer from the Broker
121      *
122      * @param client
123      * @param info
124      * @throws JMSException
125      */
126     public void deregisterMessageProducer(BrokerClient client, ProducerInfo info) throws JMSException;
127 
128     /**
129      * Register a client-side Session (used for Monitoring)
130      *
131      * @param client
132      * @param info
133      * @throws JMSException
134      */
135 
136     public void registerSession(BrokerClient client, SessionInfo info) throws JMSException;
137 
138     /**
139      * De-register a client-side Session from the Broker (used for monitoring)
140      *
141      * @param client
142      * @param info
143      * @throws JMSException
144      */
145     public void deregisterSession(BrokerClient client, SessionInfo info) throws JMSException;
146 
147     /**
148      * Start a transaction from the Client session
149      *
150      * @param client
151      * @param transactionId
152      * @throws JMSException
153      */
154     public void startTransaction(BrokerClient client, String transactionId) throws JMSException;
155 
156     /**
157      * Rollback a transacton
158      *
159      * @param client
160      * @param transactionId
161      * @throws JMSException
162      */
163     public void rollbackTransaction(BrokerClient client, String transactionId) throws JMSException;
164 
165     /**
166      * Commit a transaction
167      *
168      * @param client
169      * @param transactionId
170      * @throws JMSException
171      */
172     public void commitTransaction(BrokerClient client, String transactionId) throws JMSException;
173 
174 
175     /**
176      * Start an XA transaction
177      *
178      * @param client
179      * @param xid
180      * @throws XAException
181      */
182     public void startTransaction(BrokerClient client, ActiveMQXid xid) throws XAException;
183 
184     /**
185      * Get all the Xids of the prepared XA transactions.
186      *
187      * @param client
188      * @return
189      * @throws XAException
190      */
191     public ActiveMQXid[] getPreparedTransactions(BrokerClient client) throws XAException;
192 
193     /**
194      * Prepare an XA transaction.
195      *
196      * @param client
197      * @param xid
198      * @return
199      * @throws XAException
200      */
201     public int prepareTransaction(BrokerClient client, ActiveMQXid xid) throws XAException;
202 
203     /**
204      * Rollback an XA transaction.
205      *
206      * @param client
207      * @param xid
208      * @throws XAException
209      */
210     public void rollbackTransaction(BrokerClient client, ActiveMQXid xid) throws XAException;
211 
212     /**
213      * Commit an XA transaction.
214      *
215      * @param client
216      * @param xid
217      * @param onePhase
218      * @throws XAException
219      */
220     public void commitTransaction(BrokerClient client, ActiveMQXid xid, boolean onePhase) throws XAException;
221 
222     /**
223      * Send a non-transacted message to the Broker
224      *
225      * @param client
226      * @param message
227      * @throws JMSException
228      */
229 
230     public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException;
231 
232     /**
233      * Acknowledge reciept of a message
234      *
235      * @param client
236      * @param ack
237      * @throws JMSException
238      */
239     public void acknowledgeMessage(BrokerClient client, MessageAck ack) throws JMSException;
240 
241     /**
242      * Command to delete a durable topic subscription
243      *
244      * @param client
245      * @param ds
246      * @throws JMSException
247      */
248 
249     public void durableUnsubscribe(BrokerClient client, DurableUnsubscribe ds) throws JMSException;
250 
251     /**
252      * Gets the unique id of the resource manager used for managing xa
253      * transactions.
254      *
255      * @param client
256      * @return the id
257      */
258     public String getResourceManagerId(BrokerClient client);
259 
260     /**
261      * @return the BrokerContainer for this Connector
262      */
263     public BrokerContainer getBrokerContainer();
264 
265 
266 }