JBoss Remoting 3 3.2.0.Beta2-redhat-1

org.jboss.remoting3
Interface Endpoint

All Superinterfaces:
Attachable, Closeable, HandleableCloseable<Endpoint>

public interface Endpoint
extends HandleableCloseable<Endpoint>, Attachable

A potential participant in a JBoss Remoting communications relationship.

This interface is part of the Remoting public API. It is intended to be consumed by Remoting applications; it is not intended to be implemented by them. Methods may be added to this interface in future minor releases without advance notice.


Nested Class Summary
static class Endpoint.ListenerFlag
          Flags which can be passed in to listener registration methods.
 
Nested classes/interfaces inherited from interface org.jboss.remoting3.HandleableCloseable
HandleableCloseable.Key
 
Method Summary
 Registration addConnectionProvider(String uriScheme, ConnectionProviderFactory providerFactory, org.xnio.OptionMap optionMap)
          Register a connection provider for a URI scheme.
 org.xnio.IoFuture<Connection> connect(URI destination)
          Open a connection with a peer.
 org.xnio.IoFuture<Connection> connect(URI destination, org.xnio.OptionMap connectOptions)
          Open a connection with a peer.
 org.xnio.IoFuture<Connection> connect(URI destination, org.xnio.OptionMap connectOptions, CallbackHandler callbackHandler)
          Open a connection with a peer.
 org.xnio.IoFuture<Connection> connect(URI destination, org.xnio.OptionMap connectOptions, String userName, String realmName, char[] password)
          Open a connection with a peer.
 ChannelPair createChannelPair()
          Create a channel pair which are connected to one another.
<T> T
getConnectionProviderInterface(String uriScheme, Class<T> expectedType)
          Get the interface for a connection provider.
 String getName()
          Get the name of this endpoint.
 boolean isValidUriScheme(String uriScheme)
          Determine whether the given URI scheme is valid for this endpoint.
 Registration registerService(String serviceType, OpenListener openListener, org.xnio.OptionMap optionMap)
          Register a new service.
 
Methods inherited from interface org.jboss.remoting3.HandleableCloseable
addCloseHandler, awaitClosed, awaitClosedUninterruptibly, close, closeAsync
 
Methods inherited from interface org.jboss.remoting3.Attachable
getAttachments
 

Method Detail

getName

String getName()
Get the name of this endpoint.

Returns:
the endpoint name, or null if there is no name

registerService

Registration registerService(String serviceType,
                             OpenListener openListener,
                             org.xnio.OptionMap optionMap)
                             throws ServiceRegistrationException
Register a new service.

Parameters:
serviceType - the service type
openListener - the channel open listener
optionMap - the option map
Returns:
the service registration which may be closed to remove the service
Throws:
ServiceRegistrationException - if the service could not be registered

createChannelPair

ChannelPair createChannelPair()
Create a channel pair which are connected to one another.

Returns:
the channel pair

connect

org.xnio.IoFuture<Connection> connect(URI destination)
                                      throws IOException
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.

You must have the connect EndpointPermission to invoke this method.

Parameters:
destination - the destination
Returns:
the future connection
Throws:
IOException - if an error occurs while starting the connect attempt

connect

org.xnio.IoFuture<Connection> connect(URI destination,
                                      org.xnio.OptionMap connectOptions)
                                      throws IOException
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.

You must have the connect EndpointPermission to invoke this method.

Parameters:
destination - the destination
connectOptions - options to configure this connection
Returns:
the future connection
Throws:
IOException - if an error occurs while starting the connect attempt

connect

org.xnio.IoFuture<Connection> connect(URI destination,
                                      org.xnio.OptionMap connectOptions,
                                      CallbackHandler callbackHandler)
                                      throws IOException
Open a connection with a peer. Returns a future connection which may be used to cancel the connection attempt. The given callback handler is used to retrieve local authentication information, if the protocol demands it. This method does not block; use the return value to wait for a result if you wish to block.

You must have the connect EndpointPermission to invoke this method.

Parameters:
destination - the destination
connectOptions - options to configure this connection
callbackHandler - the local callback handler to use for authentication
Returns:
the future connection
Throws:
IOException - if an error occurs while starting the connect attempt

connect

org.xnio.IoFuture<Connection> connect(URI destination,
                                      org.xnio.OptionMap connectOptions,
                                      String userName,
                                      String realmName,
                                      char[] password)
                                      throws IOException
Open a connection with a peer. Returns a future connection which may be used to cancel the connection attempt. The given user name and password is used as local authentication information, if the protocol demands it. This method does not block; use the return value to wait for a result if you wish to block.

You must have the connect EndpointPermission to invoke this method.

Parameters:
destination - the destination
connectOptions - options to configure this connection
userName - the user name to authenticate as, or null if it is unspecified
realmName - the user realm to authenticate with, or null if it is unspecified
password - the password to send, or null if it is unspecified
Returns:
the future connection
Throws:
IOException - if an error occurs while starting the connect attempt

addConnectionProvider

Registration addConnectionProvider(String uriScheme,
                                   ConnectionProviderFactory providerFactory,
                                   org.xnio.OptionMap optionMap)
                                   throws DuplicateRegistrationException,
                                          IOException
Register a connection provider for a URI scheme. The provider factory is called with the context which can be used to accept new connections or terminate the registration.

You must have the addConnectionProvider EndpointPermission to invoke this method.

Parameters:
uriScheme - the URI scheme
providerFactory - the provider factory
optionMap - the configuration options for the connection provider
Returns:
a handle which may be used to remove the registration
Throws:
IOException - if the provider failed to initialize
DuplicateRegistrationException - if there is already a provider registered to that URI scheme

getConnectionProviderInterface

<T> T getConnectionProviderInterface(String uriScheme,
                                     Class<T> expectedType)
                                 throws UnknownURISchemeException,
                                        ClassCastException
Get the interface for a connection provider.

You must have the getConnectionProviderInterface EndpointPermission to invoke this method.

Type Parameters:
T - the expected type of the interface
Parameters:
uriScheme - the URI scheme of the registered connection provider
expectedType - the expected type of the interface
Returns:
the provider interface
Throws:
UnknownURISchemeException - if the given URI scheme is not registered
ClassCastException - if the interface type does not match the expected type

isValidUriScheme

boolean isValidUriScheme(String uriScheme)
Determine whether the given URI scheme is valid for this endpoint.

Parameters:
uriScheme - the URI scheme
Returns:
true if the URI scheme is valid at the time this method is called

JBoss Remoting 3 3.2.0.Beta2-redhat-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.