-
Feature Request
-
Resolution: Done
-
Major
-
5.0.20.Final
-
None
Generally speaking, Remoting services are defined on endpoints in the following way by specifying a channel name and an OpenListener:
try {
registration = endpoint.registerService(CHANNEL_NAME, channelOpenListener, this.channelCreationOptions);
} catch (ServiceRegistrationException e) {
throw new StartException(e);
}
Once the service has been registered, it can in general be used atop any connection from the client to any Remoting connector by calling from the client:
IoFuture<Channel> futureChannel = connection.openChannel(CHANNEL_NAME, OptionMap.EMPTY);
Sometimes we want to restrict the connectors that services can be created on.
We want to introduce a version of registerService which allows being able to restrict the set of connectors we may use the service on, by way of a validation predicate on the Connection:
Predicate<Connection> validationPredicate = {some predicate defined in terms of connection instance}
try {
registration = endpoint.registerService(CHANNEL_NAME, channelOpenListener, this.channelCreationOptions, validationPredicate);
} catch (ServiceRegistrationException e) {
throw new StartException(e);
}
For example, we may wish prevent service requests atop of a connection on the connector listening on port 1234.
When we try to create a service Channel on a connection for which the validationPredicate evaluates to false, the connection is refused and the client receives a ServiceOpenException with message "Service refused".
- is related to
-
WFLY-14567 Model change in EJB remote service causes regression
-
- Closed
-