diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2007-08-02 20:47:26 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2007-08-02 20:47:26 +0000 |
| commit | 029c638fd23d3e53a58ca521209ae62057e59689 (patch) | |
| tree | 7a8b88839339d12cf35b85f01abc2ba9fa1d3652 /java | |
| parent | 89aa36d093182e9e191c000504c174663932458f (diff) | |
| download | qpid-python-029c638fd23d3e53a58ca521209ae62057e59689.tar.gz | |
MessageReceiver is removed. It wasn't removed in yesterdays commit.
Session - Added txSelect() method.
ExceptionListener is added.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@562251 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
4 files changed, 56 insertions, 100 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/nclient/api/Connection.java b/java/client/src/main/java/org/apache/qpid/nclient/api/Connection.java index a2609bc6ff..6d5f317feb 100644 --- a/java/client/src/main/java/org/apache/qpid/nclient/api/Connection.java +++ b/java/client/src/main/java/org/apache/qpid/nclient/api/Connection.java @@ -76,4 +76,11 @@ public interface Connection throws QpidException; + /** + * If the communication layer detects a serious problem with a connection, it + * informs the connection's ExceptionListener + * + * @param exceptionListner The execptionListener + */ + public void setExceptionListener(ExceptionListener exceptionListner); } diff --git a/java/client/src/main/java/org/apache/qpid/nclient/api/ExceptionListener.java b/java/client/src/main/java/org/apache/qpid/nclient/api/ExceptionListener.java new file mode 100644 index 0000000000..1818dbfd23 --- /dev/null +++ b/java/client/src/main/java/org/apache/qpid/nclient/api/ExceptionListener.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.qpid.nclient.api; + +import org.apache.qpidity.QpidException; + +/** + * If the communication layer detects a serious problem with a <CODE>connection</CODE>, it + * informs the connection's ExceptionListener + */ +public interface ExceptionListener +{ + /** + * If the communication layer detects a serious problem with a connection, it + * informs the connection's ExceptionListener + * + * @param exception The exception comming from the communication layer. + * @see org.apache.qpid.nclient.api.Connection + */ + public void onException(QpidException exception); +}
\ No newline at end of file diff --git a/java/client/src/main/java/org/apache/qpid/nclient/api/MessageReceiver.java b/java/client/src/main/java/org/apache/qpid/nclient/api/MessageReceiver.java deleted file mode 100644 index 80477dc0a0..0000000000 --- a/java/client/src/main/java/org/apache/qpid/nclient/api/MessageReceiver.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.qpid.nclient.api; - -import java.util.Set; - -import org.apache.qpidity.Option; -import org.apache.qpidity.QpidException; -import org.apache.qpidity.api.Message; - -/** - * Used to receive messages from a queue - */ -public interface MessageReceiver -{ - /** - * Get this receiver options. - * - * @return This receiver set of options. - */ - - public Set<Option> getOptions(); - - /** - * Receive a message form this receiver queue. - * <p> If the timeout is equal to 0 then this operation is blocking. - * <p> If the timeout is less than 0 then this operation retruns immediatly - * <p> Otherwise it blocks until a message arrives, the timeout expires, or this receiver is closed. - * <p> To receive messages, a receiver must be started. - * - * @param timeout The timeout value (in milliseconds). - * @return A message or null if timeout expires or this receiver is concurrently closed. - * @throws QpidException If this receiver fails to receive a message due to some error. - * @throws IllegalStateException If this receiver is closed, not started or a MessageListener is set. - */ - public Message receive(long timeout) - throws - QpidException, - IllegalStateException; - - /** - * Stop the delivery of messages to this receiver. - * <p>For asynchronous receiver, this operation blocks until the message listener - * finishes processing the current message, - * - * @throws QpidException If this receiver fails to be stopped due to some error. - * @throws IllegalStateException If this receiver is closed or already stopped. - */ - public void stop() - throws - QpidException, - IllegalStateException; - - /** - * Start the delivery of messages to this receiver. - * - * @throws QpidException If this receiver fails to be started due to some error. - * @throws IllegalStateException If this receiver is closed or already started. - */ - public void start() - throws - QpidException, - IllegalStateException; - - /** - * Set the receiver�s MessageListener. - * Setting the message listener to null is the equivalent of un-setting the message - * listener for this receiver. - * <p> Once a message listener is set, a receiver cannot receive messages through its - * receive method. - * - * @param listener The message listner. - * @throws QpidException If this receiver fails to set the message listner due to some error. - * @throws IllegalStateException If this receiver is closed. - */ - public void setAsynchronous(MessageListener listener) - throws - QpidException, - IllegalStateException; -} diff --git a/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java b/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java index 6249c91fdb..424910c72c 100644 --- a/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java +++ b/java/client/src/main/java/org/apache/qpid/nclient/api/Session.java @@ -88,7 +88,7 @@ public interface Session * @return msg The Message to be sent * @throws QpidException If the session fails to send the message due to some error */ - public void messageTransfer(String destination,Message msg)throws QpidException; + public void messageTransfer(String destination,Message msg,Option... options)throws QpidException; /** * Transfer the given message. @@ -211,6 +211,7 @@ public interface Session */ public void messageSubscribe(String queue, String destination, Map<String,?> filter, Option ... _options) throws QpidException; + public void messageSubscribe(String queue, String destination, Map<String,?> filter,StreamingMessageListener listener,Option ... _options) throws QpidException; /** * Cancels a subscription @@ -225,7 +226,7 @@ public interface Session * @param destination * @param listener */ - public void addMessageListener(String destination,StreamingMessageListener listener); + public void setMessageListener(String destination,StreamingMessageListener listener); /** * We currently allow one listerner per destination @@ -233,7 +234,7 @@ public interface Session * @param destination * @param listener */ - public void addMessageListener(String destination,MessageListener listener); + public void setMessageListener(String destination,MessageListener listener); // ----------------------------------------------- @@ -255,7 +256,14 @@ public interface Session * @throws IllegalStateException If this session is not transacted. */ public void txRollback() throws QpidException, IllegalStateException; - + + + /** + * Selects the session for transactions + * + * @throws QpidException + */ + public void txSelect() throws QpidException; //--------------------------------------------- // Queue methods |
