Author: david.lloyd(a)jboss.com
Date: 2009-11-11 19:52:52 -0500 (Wed, 11 Nov 2009)
New Revision: 5588
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/EndpointImpl.java
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderContext.java
Log:
Allow lookups of protocol service providers by name
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-11-11
04:01:22 UTC (rev 5587)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/EndpointImpl.java 2009-11-12
00:52:52 UTC (rev 5588)
@@ -685,6 +685,10 @@
public <T> Iterable<Map.Entry<String, T>>
getProtocolServiceProviders(final ProtocolServiceType<T> serviceType) {
return getMapFor(serviceType).entrySet();
}
+
+ public <T> T getProtocolServiceProvider(final ProtocolServiceType<T>
serviceType, final String name) {
+ return getMapFor(serviceType).get(name);
+ }
}
private final class LocalConnectionProvider implements ConnectionProvider<Void>
{
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderContext.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderContext.java 2009-11-11
04:01:22 UTC (rev 5587)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/spi/ConnectionProviderContext.java 2009-11-12
00:52:52 UTC (rev 5588)
@@ -48,4 +48,15 @@
* @return the currently-registered providers
*/
<T> Iterable<Map.Entry<String, T>>
getProtocolServiceProviders(ProtocolServiceType<T> serviceType);
+
+ /**
+ * Get one registered protocol service provider of the given type and name. Returns
the provider,
+ * or {@code null} if none was registered for that name.
+ *
+ * @param serviceType the service type
+ * @param name the provider name
+ * @param <T> the type of the provider interface
+ * @return the provider, or {@code null} if none was matched
+ */
+ <T> T getProtocolServiceProvider(ProtocolServiceType<T> serviceType,
String name);
}
Show replies by date