[jboss-remoting-commits] JBoss Remoting SVN: r5108 - remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Thu Apr 30 21:10:07 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-04-30 21:10:07 -0400 (Thu, 30 Apr 2009)
New Revision: 5108

Modified:
   remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/Endpoint.java
   remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/EndpointImpl.java
Log:
Javadoc fixes, slight API tweak

Modified: remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/Endpoint.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/Endpoint.java	2009-05-01 01:01:01 UTC (rev 5107)
+++ remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/Endpoint.java	2009-05-01 01:10:07 UTC (rev 5108)
@@ -74,11 +74,12 @@
     <I, O> Client<I, O> createClient(RequestHandler handler, Class<I> requestClass,  Class<O> replyClass) throws IOException;
 
     /**
-     * Open a connection with a peer.
+     * Open a connection with a peer.  Returns a future connection which may be used to cancel the connection attempt.
+     * This method does not block; use the return value to wait for a result if you wish to block.
      *
      * @param destination the destination
-     * @return
-     * @throws IOException
+     * @return the future connection
+     * @throws IOException if an error occurs while starting the connect attempt
      */
     IoFuture<? extends Connection> connect(URI destination) throws IOException;
 
@@ -90,7 +91,7 @@
      * @param providerFactory the provider factory
      * @return a handle which may be used to remove the registration
      */
-    void addConnectionProvider(String uriScheme, ConnectionProviderFactory providerFactory);
+    SimpleCloseable addConnectionProvider(String uriScheme, ConnectionProviderFactory providerFactory);
 
     /**
      * Flags which can be passed in to listener registration methods.

Modified: remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/EndpointImpl.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/EndpointImpl.java	2009-05-01 01:01:01 UTC (rev 5107)
+++ remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/EndpointImpl.java	2009-05-01 01:10:07 UTC (rev 5108)
@@ -351,7 +351,7 @@
         return futureResult;
     }
 
-    public void addConnectionProvider(final String uriScheme, final ConnectionProviderFactory providerFactory) {
+    public SimpleCloseable addConnectionProvider(final String uriScheme, final ConnectionProviderFactory providerFactory) {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             sm.checkPermission(ADD_CONNECTION_PROVIDER_PERM);
@@ -367,6 +367,11 @@
                 connectionProviders.remove(uriScheme, provider);
             }
         });
+        return new AbstractSimpleCloseable(executor) {
+            protected void closeAction() throws IOException {
+                context.close();
+            }
+        };
     }
 
     public String toString() {




More information about the jboss-remoting-commits mailing list