Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix usage of deprecated MSC & wildfly-clustering-common/service API i…
…n wildfly-mod_cluster modules.
- Loading branch information
Showing
24 changed files
with
258 additions
and
276 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
...n/java/org/wildfly/extension/mod_cluster/ContainerEventHandlerAdapterBuilderProvider.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...ildfly/extension/mod_cluster/ContainerEventHandlerAdapterServiceConfiguratorProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
package org.wildfly.extension.mod_cluster; | |||
|
|||
import java.time.Duration; | |||
|
|||
import org.jboss.as.clustering.controller.CapabilityServiceConfigurator; | |||
|
|||
/** | |||
* Creates builder of a service that triggers container events for use by {@link org.jboss.modcluster.container.ContainerEventHandler}. | |||
* @author Paul Ferraro | |||
*/ | |||
public interface ContainerEventHandlerAdapterServiceConfiguratorProvider { | |||
CapabilityServiceConfigurator getServiceConfigurator(String connector, Duration statusInterval); | |||
} |
72 changes: 0 additions & 72 deletions
72
...tension/src/main/java/org/wildfly/extension/mod_cluster/ContainerEventHandlerService.java
This file was deleted.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
...main/java/org/wildfly/extension/mod_cluster/ContainerEventHandlerServiceConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,79 @@ | |||
/* | |||
* JBoss, Home of Professional Open Source | |||
* Copyright 2011, Red Hat Inc., and individual contributors as indicated | |||
* by the @authors tag. See the copyright.txt in the distribution for a | |||
* full listing of individual contributors. | |||
* | |||
* This is free software; you can redistribute it and/or modify it | |||
* under the terms of the GNU Lesser General Public License as | |||
* published by the Free Software Foundation; either version 2.1 of | |||
* the License, or (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public | |||
* License along with this software; if not, write to the Free | |||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |||
*/ | |||
package org.wildfly.extension.mod_cluster; | |||
|
|||
import java.util.function.Consumer; | |||
import java.util.function.Function; | |||
import java.util.function.Supplier; | |||
|
|||
import org.jboss.modcluster.ModClusterService; | |||
import org.jboss.modcluster.config.ModClusterConfiguration; | |||
import org.jboss.modcluster.load.LoadBalanceFactorProvider; | |||
import org.jboss.msc.Service; | |||
import org.jboss.msc.service.ServiceBuilder; | |||
import org.jboss.msc.service.ServiceName; | |||
import org.jboss.msc.service.ServiceTarget; | |||
import org.wildfly.clustering.service.AsyncServiceConfigurator; | |||
import org.wildfly.clustering.service.FunctionalService; | |||
import org.wildfly.clustering.service.ServiceConfigurator; | |||
import org.wildfly.clustering.service.SimpleServiceNameProvider; | |||
|
|||
/** | |||
* Service starting mod_cluster service. | |||
* | |||
* @author Jean-Frederic Clere | |||
* @author Radoslav Husar | |||
*/ | |||
public class ContainerEventHandlerServiceConfigurator extends SimpleServiceNameProvider implements ServiceConfigurator, Supplier<ModClusterService>, Consumer<ModClusterService> { | |||
|
|||
public static final ServiceName SERVICE_NAME = ModClusterConfigResourceDefinition.MOD_CLUSTER_CAPABILITY.getCapabilityServiceName(); | |||
public static final ServiceName CONFIG_SERVICE_NAME = SERVICE_NAME.append("config"); | |||
|
|||
private final LoadBalanceFactorProvider load; | |||
|
|||
private volatile Supplier<ModClusterConfiguration> configuration; | |||
|
|||
ContainerEventHandlerServiceConfigurator(LoadBalanceFactorProvider factorProvider) { | |||
super(SERVICE_NAME); | |||
this.load = factorProvider; | |||
} | |||
|
|||
@Override | |||
public ServiceBuilder<?> build(ServiceTarget target) { | |||
ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target); | |||
// Temporary alias, in case anyone is using old service name | |||
Consumer<ModClusterService> modClusterService = builder.addAliases(ServiceName.JBOSS.append(ModClusterExtension.SUBSYSTEM_NAME)).provides(this.getServiceName()); | |||
this.configuration = builder.requires(ContainerEventHandlerServiceConfigurator.CONFIG_SERVICE_NAME); | |||
Service service = new FunctionalService<>(modClusterService, Function.identity(), this, this); | |||
return builder.setInstance(service); | |||
} | |||
|
|||
@Override | |||
public ModClusterService get() { | |||
return new ModClusterService(this.configuration.get(), this.load); | |||
} | |||
|
|||
@Override | |||
public void accept(ModClusterService service) { | |||
service.shutdown(); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.