From f130c9c3b691181e2a297782c3dbe4a19b77acab Mon Sep 17 00:00:00 2001 From: "David M. Lloyd" Date: Tue, 17 Jan 2017 17:30:39 -0600 Subject: [PATCH] [EJBCLIENT-186] Automatically add EJB Remoting discovery provider to default discovery configuration --- pom.xml | 2 +- .../RemoteEJBDiscoveryConfigurator.java | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/jboss/ejb/protocol/remote/RemoteEJBDiscoveryConfigurator.java diff --git a/pom.xml b/pom.xml index 114438b25..7a6dd8a97 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 1.7 1.2.0.Beta3 1.0.0.Beta6 - 1.0.0.Beta4 + 1.0.0.Beta5 1.1.0.Beta17 1.0.0.Beta3 diff --git a/src/main/java/org/jboss/ejb/protocol/remote/RemoteEJBDiscoveryConfigurator.java b/src/main/java/org/jboss/ejb/protocol/remote/RemoteEJBDiscoveryConfigurator.java new file mode 100644 index 000000000..e424e81bf --- /dev/null +++ b/src/main/java/org/jboss/ejb/protocol/remote/RemoteEJBDiscoveryConfigurator.java @@ -0,0 +1,33 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2017 Red Hat, Inc., and individual contributors + * as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jboss.ejb.protocol.remote; + +import java.util.function.Consumer; + +import org.kohsuke.MetaInfServices; +import org.wildfly.discovery.spi.DiscoveryProvider; +import org.wildfly.discovery.spi.ExternalDiscoveryConfigurator; +import org.wildfly.discovery.spi.RegistryProvider; + +@MetaInfServices +public final class RemoteEJBDiscoveryConfigurator implements ExternalDiscoveryConfigurator { + public void configure(final Consumer discoveryProviderConsumer, final Consumer registryProviderConsumer) { + discoveryProviderConsumer.accept(RemotingEJBDiscoveryProvider.INSTANCE); + } +}