Interface Endpoint
-
- All Superinterfaces:
Attachable
,AutoCloseable
,Closeable
,org.wildfly.common.context.Contextual<Endpoint>
,HandleableCloseable<Endpoint>
- All Known Implementing Classes:
LegacyEndpoint
public interface Endpoint extends HandleableCloseable<Endpoint>, Attachable, org.wildfly.common.context.Contextual<Endpoint>
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
-
Nested classes/interfaces inherited from interface org.jboss.remoting3.HandleableCloseable
HandleableCloseable.Key
-
-
Field Summary
Fields Modifier and Type Field Description static org.wildfly.common.context.ContextManager<Endpoint>
ENDPOINT_CONTEXT_MANAGER
The context manager for Remoting endpoints.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Registration
addConnectionProvider(String uriScheme, ConnectionProviderFactory providerFactory, org.xnio.OptionMap optionMap)
Register a connection provider for a URI scheme.static EndpointBuilder
builder()
Create a new endpoint builder.default org.xnio.IoFuture<Connection>
connect(URI destination)
Open an unshared connection with a peer.org.xnio.IoFuture<Connection>
connect(URI destination, InetSocketAddress bindAddress, org.xnio.OptionMap connectOptions, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration connectionConfiguration)
Open an unshared connection with a peer.org.xnio.IoFuture<Connection>
connect(URI destination, InetSocketAddress bindAddress, org.xnio.OptionMap connectOptions, org.wildfly.security.auth.client.AuthenticationContext authenticationContext)
Open an unshared connection with a peer.org.xnio.IoFuture<Connection>
connect(URI destination, org.xnio.OptionMap connectOptions)
Open an unshared connection with a peer.org.xnio.IoFuture<Connection>
connect(URI destination, org.xnio.OptionMap connectOptions, CallbackHandler callbackHandler)
Deprecated.org.xnio.IoFuture<Connection>
connect(URI destination, org.xnio.OptionMap connectOptions, org.wildfly.security.auth.client.AuthenticationContext authenticationContext)
Open an unshared connection with a peer.default org.xnio.IoFuture<ConnectionPeerIdentity>
getConnectedIdentity(URI destination, String abstractType, String abstractTypeAuthority)
Get a possibly shared, possibly existing connection to the destination.default org.xnio.IoFuture<ConnectionPeerIdentity>
getConnectedIdentity(URI destination, String abstractType, String abstractTypeAuthority, org.wildfly.security.auth.client.AuthenticationContext context)
Get a possibly shared, possibly existing connection to the destination.org.xnio.IoFuture<ConnectionPeerIdentity>
getConnectedIdentity(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration authenticationConfiguration)
Get a possibly shared, possibly existing connection to the destination.default org.xnio.IoFuture<ConnectionPeerIdentity>
getConnectedIdentityIfExists(URI destination, String abstractType, String abstractTypeAuthority, org.wildfly.security.auth.client.AuthenticationContext context)
Get a possibly shared, possibly existing connection to the destination, if the connection was already established.org.xnio.IoFuture<ConnectionPeerIdentity>
getConnectedIdentityIfExists(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration authenticationConfiguration)
Get a possibly shared, possibly existing connection to the destination, if the connection was already established.default org.xnio.IoFuture<Connection>
getConnection(URI destination)
Deprecated.default org.xnio.IoFuture<Connection>
getConnection(URI destination, String abstractType, String abstractTypeAuthority)
Deprecated.default org.xnio.IoFuture<Connection>
getConnection(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration authenticationConfiguration)
Deprecated.default org.xnio.IoFuture<Connection>
getConnection(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration connectionConfiguration, org.wildfly.security.auth.client.AuthenticationConfiguration operateConfiguration)
Deprecated.default org.xnio.IoFuture<Connection>
getConnectionIfExists(URI destination)
Deprecated.default org.xnio.IoFuture<Connection>
getConnectionIfExists(URI destination, String abstractType, String abstractTypeAuthority)
Deprecated.default org.xnio.IoFuture<Connection>
getConnectionIfExists(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration connectionConfiguration, org.wildfly.security.auth.client.AuthenticationConfiguration operateConfiguration)
Deprecated.<T> T
getConnectionProviderInterface(String uriScheme, Class<T> expectedType)
Get the interface for a connection provider.static Endpoint
getCurrent()
Get the currently active Remoting endpoint.default org.wildfly.common.context.ContextManager<Endpoint>
getInstanceContextManager()
Get the context manager for Remoting endpoints (ENDPOINT_CONTEXT_MANAGER
).String
getName()
Get the name of this endpoint.org.xnio.XnioWorker
getXnioWorker()
Get the XNIO worker configured for 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.Attachable
getAttachments
-
Methods inherited from interface org.wildfly.common.context.Contextual
run, runAction, runBiConsumer, runBiFunction, runBiPredicate, runCallable, runConsumer, runExBiConsumer, runExBiFunction, runExBiPredicate, runExceptionAction, runExConsumer, runExFunction, runExIntFunction, runExLongFunction, runExPredicate, runFunction, runIntFunction, runLongFunction, runPredicate
-
Methods inherited from interface org.jboss.remoting3.HandleableCloseable
addCloseHandler, awaitClosed, awaitClosedUninterruptibly, close, closeAsync, isOpen
-
-
-
-
Field Detail
-
ENDPOINT_CONTEXT_MANAGER
static final org.wildfly.common.context.ContextManager<Endpoint> ENDPOINT_CONTEXT_MANAGER
The context manager for Remoting endpoints.
-
-
Method Detail
-
getInstanceContextManager
default org.wildfly.common.context.ContextManager<Endpoint> getInstanceContextManager()
Get the context manager for Remoting endpoints (ENDPOINT_CONTEXT_MANAGER
).- Specified by:
getInstanceContextManager
in interfaceorg.wildfly.common.context.Contextual<Endpoint>
- Returns:
- the context manager for Remoting endpoints (not
null
)
-
getCurrent
static Endpoint getCurrent()
Get the currently active Remoting endpoint. If none is selected,null
is returned.- Returns:
- the currently active Remoting endpoint, or
null
if none
-
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 typeopenListener
- the channel open listeneroptionMap
- the option map- Returns:
- the service registration which may be closed to remove the service
- Throws:
ServiceRegistrationException
- if the service could not be registered
-
getConnectedIdentity
default org.xnio.IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, String abstractType, String abstractTypeAuthority, org.wildfly.security.auth.client.AuthenticationContext context)
Get a possibly shared, possibly existing connection to the destination. The authentication and SSL configuration is selected from the given context with the given abstract type (if specified).- Parameters:
destination
- the destination URI (must not benull
)abstractType
- the abstract type of the connection (may benull
)abstractTypeAuthority
- the authority name of the abstract type of the connection (may benull
)context
- the authentication context to use (must not benull
)- Returns:
- the future connection identity (not
null
)
-
getConnectedIdentity
default org.xnio.IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, String abstractType, String abstractTypeAuthority)
Get a possibly shared, possibly existing connection to the destination. The authentication and SSL configuration is selected from the currently active authentication context with the given abstract type (if specified).- Parameters:
destination
- the destination URI (must not benull
)abstractType
- the abstract type of the connection (may benull
)abstractTypeAuthority
- the authority name of the abstract type of the connection (may benull
)- Returns:
- the future connection identity (not
null
)
-
getConnectedIdentity
org.xnio.IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration authenticationConfiguration)
Get a possibly shared, possibly existing connection to the destination. The authentication and SSL configuration is specified directly.- Parameters:
destination
- the destination URI (must not benull
)sslContext
- the SSL context to use for secure connections (may benull
)authenticationConfiguration
- the authentication configuration to use (must not benull
)- Returns:
- the future connection identity (not
null
)
-
getConnectedIdentityIfExists
default org.xnio.IoFuture<ConnectionPeerIdentity> getConnectedIdentityIfExists(URI destination, String abstractType, String abstractTypeAuthority, org.wildfly.security.auth.client.AuthenticationContext context)
Get a possibly shared, possibly existing connection to the destination, if the connection was already established. The authentication and SSL configuration is specified directly.If no existing connection was found,
null
is returned. If a non-null
IoFuture
is returned, it may represent a complete connection, a failed attempt, or an in-progress attempt.- Parameters:
destination
- the destination URI (must not benull
)abstractType
- the abstract type of the connection (may benull
)abstractTypeAuthority
- the authority name of the abstract type of the connection (may benull
)context
- the authentication context to use (must not benull
)- Returns:
- the existing connection, or
null
if no connection currently exists
-
getConnectedIdentityIfExists
org.xnio.IoFuture<ConnectionPeerIdentity> getConnectedIdentityIfExists(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration authenticationConfiguration)
Get a possibly shared, possibly existing connection to the destination, if the connection was already established. The authentication and SSL configuration is specified directly.If no existing connection was found,
null
is returned. If a non-null
IoFuture
is returned, it may represent a complete connection, a failed attempt, or an in-progress attempt.- Parameters:
destination
- the destination URI (must not benull
)sslContext
- the SSL context to use for secure connections (may benull
)authenticationConfiguration
- the authentication configuration to use (must not benull
)- Returns:
- the existing connection, or
null
if no connection currently exists
-
getConnection
@Deprecated default org.xnio.IoFuture<Connection> getConnection(URI destination)
Deprecated.Get a possibly pre-existing connection to the destination.- Parameters:
destination
- the destination URI- Returns:
- the future (or existing) connection
-
getConnection
@Deprecated default org.xnio.IoFuture<Connection> getConnection(URI destination, String abstractType, String abstractTypeAuthority)
Deprecated.Get a possibly pre-existing connection to the destination. The given abstract type and authority are used to locate the authentication configuration.- Parameters:
destination
- the destination URI (must not benull
)abstractType
- the abstract type of the connection (may benull
)abstractTypeAuthority
- the authority name of the abstract type of the connection (may benull
)- Returns:
- the future (or existing) connection
-
getConnection
@Deprecated default org.xnio.IoFuture<Connection> getConnection(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration authenticationConfiguration)
Deprecated.Get a possibly pre-existing connection to the destination. The given authentication configuration is used to authenticate the connection.The given SSL context factory is used only for TLS-based protocols. It may be
null
, but in such cases, no TLS-based protocols will be available.- Parameters:
destination
- the destination URI (must not benull
)sslContext
- the SSL context to use for secure connections (may benull
)authenticationConfiguration
- the authentication configuration to use (must not benull
)- Returns:
- the future (or existing) connection
-
getConnection
@Deprecated default org.xnio.IoFuture<Connection> getConnection(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration connectionConfiguration, org.wildfly.security.auth.client.AuthenticationConfiguration operateConfiguration)
Deprecated.Get a possibly pre-existing connection to the destination. The connection authentication configuration is used to authenticate the peer if the connection supports multiple identity switching. The run authentication configuration is used to authenticate the peer if the connection does not support multiple identity switching.- Parameters:
destination
- the destination URI (must not benull
)sslContext
- the SSL context to use for secure connections (may benull
)connectionConfiguration
- the connection authentication configuration (must not benull
)operateConfiguration
- the run authentication configuration (must not benull
)- Returns:
- the future (or existing) connection
-
getConnectionIfExists
@Deprecated default org.xnio.IoFuture<Connection> getConnectionIfExists(URI destination, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration connectionConfiguration, org.wildfly.security.auth.client.AuthenticationConfiguration operateConfiguration)
Deprecated.Get a pre-existing connection to the destination. The connection authentication configuration is used to authenticate the peer if the connection supports multiple identity switching. The run authentication configuration is used to authenticate the peer if the connection does not support multiple identity switching.If no existing connection was found,
null
is returned. If a non-null
IoFuture
is returned, it may represent a complete connection, a failed attempt, or an in-progress attempt.- Parameters:
destination
- the destination URI (must not benull
)sslContext
- the SSL context to use for secure connections (may benull
)connectionConfiguration
- the connection authentication configuration (must not benull
)operateConfiguration
- the run authentication configuration (must not benull
)- Returns:
- the existing connection, or
null
if no connection currently exists
-
getConnectionIfExists
@Deprecated default org.xnio.IoFuture<Connection> getConnectionIfExists(URI destination, String abstractType, String abstractTypeAuthority)
Deprecated.Get a pre-existing connection to the destination.If no existing connection was found,
null
is returned. If a non-null
IoFuture
is returned, it may represent a complete connection, a failed attempt, or an in-progress attempt.- Parameters:
destination
- the destination URI (must not benull
)abstractType
- the abstract type of the connection (may benull
)abstractTypeAuthority
- the authority name of the abstract type of the connection (may benull
)- Returns:
- the existing connection, or
null
if no connection currently exists
-
getConnectionIfExists
@Deprecated default org.xnio.IoFuture<Connection> getConnectionIfExists(URI destination)
Deprecated.Get a pre-existing shared connection to the destination.If no existing connection was found,
null
is returned. If a non-null
IoFuture
is returned, it may represent a complete connection, a failed attempt, or an in-progress attempt.- Parameters:
destination
- the destination URI (must not benull
)- Returns:
- the existing connection, or
null
if no connection currently exists
-
connect
default org.xnio.IoFuture<Connection> connect(URI destination)
Open an unshared 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 theconnect EndpointPermission
to invoke this method.- Parameters:
destination
- the destination- Returns:
- the future connection
-
connect
org.xnio.IoFuture<Connection> connect(URI destination, org.xnio.OptionMap connectOptions)
Open an unshared 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 theconnect EndpointPermission
to invoke this method.- Parameters:
destination
- the destinationconnectOptions
- options to configure this connection- Returns:
- the future connection
-
connect
org.xnio.IoFuture<Connection> connect(URI destination, org.xnio.OptionMap connectOptions, org.wildfly.security.auth.client.AuthenticationContext authenticationContext)
Open an unshared 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 theconnect EndpointPermission
to invoke this method.- Parameters:
destination
- the destinationconnectOptions
- options to configure this connectionauthenticationContext
- the client authentication context to use- Returns:
- the future connection
-
connect
org.xnio.IoFuture<Connection> connect(URI destination, InetSocketAddress bindAddress, org.xnio.OptionMap connectOptions, org.wildfly.security.auth.client.AuthenticationContext authenticationContext)
Open an unshared 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 theconnect EndpointPermission
to invoke this method.- Parameters:
destination
- the destinationbindAddress
- the local bind addressconnectOptions
- options to configure this connectionauthenticationContext
- the client authentication context to use- Returns:
- the future connection
-
connect
org.xnio.IoFuture<Connection> connect(URI destination, InetSocketAddress bindAddress, org.xnio.OptionMap connectOptions, SSLContext sslContext, org.wildfly.security.auth.client.AuthenticationConfiguration connectionConfiguration)
Open an unshared 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 theconnect EndpointPermission
to invoke this method.- Parameters:
destination
- the destinationbindAddress
- the local bind addressconnectOptions
- options to configure this connectionsslContext
- the SSL context to use for secure connections (may benull
)connectionConfiguration
- the connection authentication configuration (must not benull
)- Returns:
- the future connection (not
null
)
-
connect
@Deprecated org.xnio.IoFuture<Connection> connect(URI destination, org.xnio.OptionMap connectOptions, CallbackHandler callbackHandler) throws IOException
Deprecated.Open an unshared 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 theconnect EndpointPermission
to invoke this method.- Parameters:
destination
- the destinationconnectOptions
- options to configure this connectioncallbackHandler
- the local callback handler to use for authentication- Returns:
- the future connection (not
null
) - Throws:
IOException
-
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 theaddConnectionProvider EndpointPermission
to invoke this method.- Parameters:
uriScheme
- the URI schemeproviderFactory
- the provider factoryoptionMap
- 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 initializeDuplicateRegistrationException
- 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 thegetConnectionProviderInterface EndpointPermission
to invoke this method.- Type Parameters:
T
- the expected type of the interface- Parameters:
uriScheme
- the URI scheme of the registered connection providerexpectedType
- the expected type of the interface- Returns:
- the provider interface
- Throws:
UnknownURISchemeException
- if the given URI scheme is not registeredClassCastException
- 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
-
getXnioWorker
org.xnio.XnioWorker getXnioWorker()
Get the XNIO worker configured for this endpoint.- Returns:
- the XNIO worker
-
builder
static EndpointBuilder builder()
Create a new endpoint builder.- Returns:
- the new endpoint builder
-
-