[jboss-remoting-commits] JBoss Remoting SVN: r5504 - remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi.
jboss-remoting-commits at lists.jboss.org
jboss-remoting-commits at lists.jboss.org
Wed Sep 16 16:20:26 EDT 2009
Author: david.lloyd at jboss.com
Date: 2009-09-16 16:20:26 -0400 (Wed, 16 Sep 2009)
New Revision: 5504
Added:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderRegistration.java
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProvider.java
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderFactory.java
Log:
Make it possible for network servers to connect in to Remoting with the new API
Modified: remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProvider.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProvider.java 2009-09-16 20:19:59 UTC (rev 5503)
+++ remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProvider.java 2009-09-16 20:20:26 UTC (rev 5504)
@@ -31,7 +31,7 @@
*
* @remoting.implement
*/
-public interface ConnectionProvider {
+public interface ConnectionProvider<T> {
/**
* Open an outbound connection to the given URI. This method is expected to be non-blocking, with the result
@@ -44,4 +44,11 @@
* @throws IllegalArgumentException if the URI is not valid
*/
Cancellable connect(URI uri, OptionMap connectOptions, Result<ConnectionHandlerFactory> result) throws IllegalArgumentException;
+
+ /**
+ * Get the user data associated with this connection provider.
+ *
+ * @return the user data
+ */
+ T getUserData();
}
Modified: remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderFactory.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderFactory.java 2009-09-16 20:19:59 UTC (rev 5503)
+++ remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderFactory.java 2009-09-16 20:20:26 UTC (rev 5504)
@@ -27,7 +27,7 @@
* endpoint will call the {@code createInstance()} method with its provider context when instances of this interface
* are registered on that endpoint.
*/
-public interface ConnectionProviderFactory {
+public interface ConnectionProviderFactory<T> {
/**
* Create a provider instance for an endpoint.
@@ -35,5 +35,5 @@
* @param context the provider context
* @return the provider
*/
- ConnectionProvider createInstance(ConnectionProviderContext context);
+ ConnectionProvider<T> createInstance(ConnectionProviderContext context);
}
Added: remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderRegistration.java
===================================================================
--- remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderRegistration.java (rev 0)
+++ remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderRegistration.java 2009-09-16 20:20:26 UTC (rev 5504)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.spi;
+
+import org.jboss.remoting3.HandleableCloseable;
+
+/**
+ *
+ */
+public interface ConnectionProviderRegistration<T> extends HandleableCloseable<ConnectionProviderRegistration<T>> {
+
+ /**
+ * Get the created provider interface associated with this registration.
+ *
+ * @return the connection provider interface
+ */
+ T getProviderInterface();
+}
More information about the jboss-remoting-commits
mailing list