From 568b4e92244a0491e1761bfa42baeed9d8a99431 Mon Sep 17 00:00:00 2001 From: Arnaud Simon Date: Wed, 28 May 2008 12:47:57 +0000 Subject: QPID-1097: Those changes have been suggested by Lana git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@660922 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpidity/nclient/Connection.java | 36 +-- .../org/apache/qpidity/nclient/DtxSession.java | 31 ++- .../qpidity/nclient/MessagePartListener.java | 11 +- .../java/org/apache/qpidity/nclient/Session.java | 258 ++++++++++----------- 4 files changed, 155 insertions(+), 181 deletions(-) (limited to 'java/client') diff --git a/java/client/src/main/java/org/apache/qpidity/nclient/Connection.java b/java/client/src/main/java/org/apache/qpidity/nclient/Connection.java index 95d2b07f31..49167750d1 100644 --- a/java/client/src/main/java/org/apache/qpidity/nclient/Connection.java +++ b/java/client/src/main/java/org/apache/qpidity/nclient/Connection.java @@ -28,20 +28,20 @@ public interface Connection /** * Establish the connection using the given parameters * - * @param host - * @param port - * @param username - * @param password - * @throws QpidException + * @param host host name + * @param port port number + * @param virtualHost the virtual host name + * @param username user name + * @param password password + * @throws QpidException If the communication layer fails to establish the connection. */ public void connect(String host, int port,String virtualHost,String username, String password) throws QpidException; - /** * Establish the connection with the broker identified by the URL. * - * @param url The URL of the broker. - * @throws QpidException If the communication layer fails to connect with the broker. + * @param url Specifies the URL of the broker. + * @throws QpidException If the communication layer fails to connect with the broker, an exception is thrown. */ public void connect(String url) throws QpidException; @@ -52,14 +52,14 @@ public interface Connection */ public void close() throws QpidException; - /** * Create a session for this connection. - *

The retuned session is suspended - * (i.e. this session is not attached with an underlying channel) + *

The returned session is suspended + * (i.e. this session is not attached to an underlying channel) * - * @param expiryInSeconds Expiry time expressed in seconds, if the value is <= 0 then the session does not expire. - * @return A Newly created (suspended) session. + * @param expiryInSeconds Expiry time expressed in seconds, if the value is less than + * or equal to 0 then the session does not expire. + * @return A newly created (suspended) session. */ public Session createSession(long expiryInSeconds); @@ -70,17 +70,17 @@ public interface Connection *

The retuned DtxSession is suspended * (i.e. this session is not attached with an underlying channel) * - * @param expiryInSeconds Expiry time expressed in seconds, if the value is <= 0 then the session does not expire. - * @return A Newly created (suspended) DtxSession. + * @param expiryInSeconds Expiry time expressed in seconds, if the value is less than or equal + * to 0 then the session does not expire. + * @return A newly created (suspended) DtxSession. */ public DtxSession createDTXSession(int expiryInSeconds); /** * If the communication layer detects a serious problem with a connection, it - * informs the connection's ExceptionListener + * informs the connection's ClosedListener * - * @param exceptionListner The execptionListener + * @param exceptionListner The ClosedListener */ - public void setClosedListener(ClosedListener exceptionListner); } diff --git a/java/client/src/main/java/org/apache/qpidity/nclient/DtxSession.java b/java/client/src/main/java/org/apache/qpidity/nclient/DtxSession.java index 6bf351a014..6f15f16470 100644 --- a/java/client/src/main/java/org/apache/qpidity/nclient/DtxSession.java +++ b/java/client/src/main/java/org/apache/qpidity/nclient/DtxSession.java @@ -26,7 +26,7 @@ import org.apache.qpidity.transport.XaResult; import org.apache.qpidity.transport.Xid; /** - * This session�s resources are control under the scope of a distributed transaction. + * The resources for this session are controlled under the scope of a distributed transaction. */ public interface DtxSession extends Session { @@ -47,7 +47,7 @@ public interface DtxSession extends Session public Future dtxStart(Xid xid, Option... options); /** - * This method is called when the work done on behalf a transaction branch finishes or needs to + * This method is called when the work done on behalf of a transaction branch finishes or needs to * be suspended. * possible options are: *

- * This is up to the implementation to assembled the message when the different parts + * It is up to the implementation to assemble the message once the different parts * are transferred. */ public interface MessagePartListener @@ -37,22 +37,21 @@ public interface MessagePartListener /** * Indicates the Message transfer has started. * - * @param transferId + * @param transferId The message transfer ID. */ public void messageTransfer(int transferId); /** - * Add the following headers ( {@link org.apache.qpidity.DeliveryProperties} - * or {@link org.apache.qpidity.ApplicationProperties} ) to the message being received. + * Add the following a header to the message being received. * - * @param headers Either DeliveryProperties or ApplicationProperties + * @param header Either DeliveryProperties or ApplicationProperties */ public void messageHeader(Header header); /** * Add the following byte array to the content of the message being received * - * @param data Data to be added or streamed. + * @param src Data to be added or streamed. */ public void data(ByteBuffer src); diff --git a/java/client/src/main/java/org/apache/qpidity/nclient/Session.java b/java/client/src/main/java/org/apache/qpidity/nclient/Session.java index e2dcd53854..65b3685f86 100644 --- a/java/client/src/main/java/org/apache/qpidity/nclient/Session.java +++ b/java/client/src/main/java/org/apache/qpidity/nclient/Session.java @@ -27,11 +27,11 @@ import org.apache.qpidity.api.Message; /** *

A session is associated with a connection. - * When created a Session is not attached with an underlying channel. - * Session is single threaded

+ * When it is created, a session is not associated with an underlying channel. + * The session is single threaded.

*

- * All the Session commands are asynchronous, synchronous invocation is achieved through invoking the sync method. - * That is to say that command1 will be synchronously invoked using the following sequence: + * All the Session commands are asynchronous. Synchronous behavior is achieved through invoking the sync method. + * For example, command1 will be synchronously invoked by using the following sequence: *