Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: wildfly/wildfly
Choose a Base Repository
wildfly/wildfly
2002simon01/jboss-as
ALRubinger/wildfly
ErikWRasmussen/jboss-as
KurtStam/jboss-as
Lerm/jboss-as
LinuxEvangelist/jboss-as
Mogztter/wildfly
OndraZizka/jboss-as
PayU-EMEA/jboss-as
aaronwalker/jboss-as
agibsonccc/jboss-as
akalachm/jboss-as
alesj/jboss-as
alns/jboss-as
aloubyansky/wildfly
aminorex/jboss-as
andersnorgaard/jboss-as
andredemathe/jboss-as
andytaylor/wildfly
aprilhu0/jboss-as
ashields/jboss-as
aslakknutsen/jboss-as
asoldano/wildfly
awirayaksa/jboss-as
bershath/jboss-as
bgeorges/jboss-as
blue61/jboss-as
bosschaert/jboss-as
bstansberry/wildfly
btison/jboss-as
cbue/jboss-as
charleswmiller/jboss-as
chikin/jboss-as
chriskriel/jboss-as
coberle/jboss-as
colmsean/jboss-as
ctomc/wildfly
dandreadis/wildfly
darranl/wildfly
dcaillia/jboss-as
denuno/jboss-as
deruelle/jboss-as
dhollandAtWex/dh-old-forks-jboss-as
dmlloyd/wildfly
dobozysaurus/jboss-as
dpospisil/wildfly
edbean/jboss-as
emannuel/jboss-as
emerile1/jboss-as
emuckenhuber/wildfly
esantana/jboss-as
fbricon/jboss-as
fedora-jboss-as/wildfly
fei-yin/jboss-as
fharms/wildfly
fregaham/jboss-as
fxlambda-twickly5/wildfly
garcimouche/jboss-as
goldmann/jboss-as
gonne/jboss-as
gvagenas/jboss-as
hamanju/jboss-as
hamming229/jboss-as
heiko-braun/wildfly
hgkmiracle/jboss-as
hunter-thom/jboss-as
ikaro/jboss-as
istudens/wildfly
jaikiran/wildfly
jamezp/wildfly
janpiel/jboss-as
java-coder/jboss-as
jayhowell/jboss-as
jbossejb3/jboss-as
jdmr/jboss-as
jdpgrailsdev/jboss-as
jeenapeter/jboss-as
jeffzhang/jboss-as
jeremiahshirk/jboss-as
jiwils/jboss-as
jlindesmith/jboss-as
jmartisk/wildfly
jocstar/jboss-as
joseph2000/jboss-as
jrwhitley/jboss-as
jswordfish/jboss-as
jtoerber/jboss-as
julianzhu/jboss-as
jwulf/jboss-as
kabir/wildfly
kbys/jboss-as
koledzhikov/jboss-as
kpiwko/wildfly
kylape/wildfly
ldevrie/jboss-as
lingling788/jboss-as
liweinan/jboss-as
luksa/wildfly
lydonchandra/jboss-as
maasvdberg/wildfly
madhumita/jboss-as
madhumita12/jboss-as
maerqiang/jboss-as
maeste/jboss-as
mageshbk/jboss-as
markmc/jboss-as
markyour/jboss-as
maschmid/jboss-as
matejonnet/jboss-as
mathieuancelin/jboss-as
mathieufortin01/jboss-as
mattdrees/jboss-as
maxandersen/jboss-as
maximilienw/jboss-as
mbogoevici/jboss-as
mbrasier/jboss-as
mdemerath/jboss-as
mgencur/jboss-as
michaelschuetz/jboss-as
miclark/jboss-as
migue/wildfly
mikebrock/jboss-as
mkiman/jboss-as
mlinhard/jboss-as
mmoyses/jboss-as
mojavelinux/jboss-as
mschwartzman/jboss-as
mstruk/jboss-as
nikkack/jboss-as
nookala/jboss-as
npfr/jboss-as
nscavell/jboss-as
ochaloup/wildfly
patmcdonough/jboss-as
pbielicki/jboss-as
pentarou/jboss-as
pepite/jboss-as
petbac/jboss-as
pferraro/wildfly
pmf8/jboss-as
pmuir/jboss-as
porobd/jboss-as
prabugp/jboss-as
pragnesh/jboss-as
prasad-deshpande/jboss-as
prcg66/jboss-as
pskopek/wildfly
pslegr/jboss-as
rachmatowicz/wildfly
rachmatowicz2/jboss-as
randythomas/jboss-as
rhusar/wildfly
richmidwinter/jboss-as
richsharples/jboss-as
ringerc/jboss-as
robertpanzer/jboss-as
robstryker/jboss-as
rsvoboda/wildfly
rzimmermann/jboss-as
sacdroid/jboss-as
samuelo/jboss-as
sasgww/jboss-as
scottmarlow/wildfly
sebersole/jboss-as
seeburger-ag/jboss-as
seko2000/jboss-as
sgilda/wildfly
shadangi/jboss-as
shuawest/jboss-as
sjancke/jboss-as
skoussou/jboss-as
smcgowan/wildfly
spreadline/jboss-as
ssilvert/wildfly
starksm64/jboss-as
starksmjboss/jboss-as
stliu/jboss-as
stuartwdouglas/wildfly
sujaybawaskar/jboss-as
tdiesler/wildfly
tfennelly/jboss-as
thammoud/jboss-as
thanhvc/jboss-as
thauser/jboss-as
thomasnymand/jboss-as
thunderlei/jboss-as
tomathome/jboss-as
tomwells/jboss-as
tristantarrant/wildfly
tyasuma/jboss-as
undertow-io/jboss-as
vladimirralev/jboss-as
vmariusvv/jboss-as
vratsel/jboss-as
weld/wildfly
wfink/wildfly
wolfc/jboss-as
zhigunovs/jboss-as
zhleonix/jboss-as
Nothing to show
base: 09595a3
head repository: wildfly/wildfly
Choose a Head Repository
wildfly/wildfly
2002simon01/jboss-as
ALRubinger/wildfly
ErikWRasmussen/jboss-as
KurtStam/jboss-as
Lerm/jboss-as
LinuxEvangelist/jboss-as
Mogztter/wildfly
OndraZizka/jboss-as
PayU-EMEA/jboss-as
aaronwalker/jboss-as
agibsonccc/jboss-as
akalachm/jboss-as
alesj/jboss-as
alns/jboss-as
aloubyansky/wildfly
aminorex/jboss-as
andersnorgaard/jboss-as
andredemathe/jboss-as
andytaylor/wildfly
aprilhu0/jboss-as
ashields/jboss-as
aslakknutsen/jboss-as
asoldano/wildfly
awirayaksa/jboss-as
bershath/jboss-as
bgeorges/jboss-as
blue61/jboss-as
bosschaert/jboss-as
bstansberry/wildfly
btison/jboss-as
cbue/jboss-as
charleswmiller/jboss-as
chikin/jboss-as
chriskriel/jboss-as
coberle/jboss-as
colmsean/jboss-as
ctomc/wildfly
dandreadis/wildfly
darranl/wildfly
dcaillia/jboss-as
denuno/jboss-as
deruelle/jboss-as
dhollandAtWex/dh-old-forks-jboss-as
dmlloyd/wildfly
dobozysaurus/jboss-as
dpospisil/wildfly
edbean/jboss-as
emannuel/jboss-as
emerile1/jboss-as
emuckenhuber/wildfly
esantana/jboss-as
fbricon/jboss-as
fedora-jboss-as/wildfly
fei-yin/jboss-as
fharms/wildfly
fregaham/jboss-as
fxlambda-twickly5/wildfly
garcimouche/jboss-as
goldmann/jboss-as
gonne/jboss-as
gvagenas/jboss-as
hamanju/jboss-as
hamming229/jboss-as
heiko-braun/wildfly
hgkmiracle/jboss-as
hunter-thom/jboss-as
ikaro/jboss-as
istudens/wildfly
jaikiran/wildfly
jamezp/wildfly
janpiel/jboss-as
java-coder/jboss-as
jayhowell/jboss-as
jbossejb3/jboss-as
jdmr/jboss-as
jdpgrailsdev/jboss-as
jeenapeter/jboss-as
jeffzhang/jboss-as
jeremiahshirk/jboss-as
jiwils/jboss-as
jlindesmith/jboss-as
jmartisk/wildfly
jocstar/jboss-as
joseph2000/jboss-as
jrwhitley/jboss-as
jswordfish/jboss-as
jtoerber/jboss-as
julianzhu/jboss-as
jwulf/jboss-as
kabir/wildfly
kbys/jboss-as
koledzhikov/jboss-as
kpiwko/wildfly
kylape/wildfly
ldevrie/jboss-as
lingling788/jboss-as
liweinan/jboss-as
luksa/wildfly
lydonchandra/jboss-as
maasvdberg/wildfly
madhumita/jboss-as
madhumita12/jboss-as
maerqiang/jboss-as
maeste/jboss-as
mageshbk/jboss-as
markmc/jboss-as
markyour/jboss-as
maschmid/jboss-as
matejonnet/jboss-as
mathieuancelin/jboss-as
mathieufortin01/jboss-as
mattdrees/jboss-as
maxandersen/jboss-as
maximilienw/jboss-as
mbogoevici/jboss-as
mbrasier/jboss-as
mdemerath/jboss-as
mgencur/jboss-as
michaelschuetz/jboss-as
miclark/jboss-as
migue/wildfly
mikebrock/jboss-as
mkiman/jboss-as
mlinhard/jboss-as
mmoyses/jboss-as
mojavelinux/jboss-as
mschwartzman/jboss-as
mstruk/jboss-as
nikkack/jboss-as
nookala/jboss-as
npfr/jboss-as
nscavell/jboss-as
ochaloup/wildfly
patmcdonough/jboss-as
pbielicki/jboss-as
pentarou/jboss-as
pepite/jboss-as
petbac/jboss-as
pferraro/wildfly
pmf8/jboss-as
pmuir/jboss-as
porobd/jboss-as
prabugp/jboss-as
pragnesh/jboss-as
prasad-deshpande/jboss-as
prcg66/jboss-as
pskopek/wildfly
pslegr/jboss-as
rachmatowicz/wildfly
rachmatowicz2/jboss-as
randythomas/jboss-as
rhusar/wildfly
richmidwinter/jboss-as
richsharples/jboss-as
ringerc/jboss-as
robertpanzer/jboss-as
robstryker/jboss-as
rsvoboda/wildfly
rzimmermann/jboss-as
sacdroid/jboss-as
samuelo/jboss-as
sasgww/jboss-as
scottmarlow/wildfly
sebersole/jboss-as
seeburger-ag/jboss-as
seko2000/jboss-as
sgilda/wildfly
shadangi/jboss-as
shuawest/jboss-as
sjancke/jboss-as
skoussou/jboss-as
smcgowan/wildfly
spreadline/jboss-as
ssilvert/wildfly
starksm64/jboss-as
starksmjboss/jboss-as
stliu/jboss-as
stuartwdouglas/wildfly
sujaybawaskar/jboss-as
tdiesler/wildfly
tfennelly/jboss-as
thammoud/jboss-as
thanhvc/jboss-as
thauser/jboss-as
thomasnymand/jboss-as
thunderlei/jboss-as
tomathome/jboss-as
tomwells/jboss-as
tristantarrant/wildfly
tyasuma/jboss-as
undertow-io/jboss-as
vladimirralev/jboss-as
vmariusvv/jboss-as
vratsel/jboss-as
weld/wildfly
wfink/wildfly
wolfc/jboss-as
zhigunovs/jboss-as
zhleonix/jboss-as
Nothing to show
compare: 10dc57c
  • 3 commits
  • 7 files changed
  • 0 commit comments
  • 2 contributors
Commits on Apr 14, 2019
 WFLY-11984 ChannelCommandDispatcherFactory does not notify any GroupListener
@@ -264,7 +264,7 @@ public void viewAccepted(View view) {
this.members.keySet().removeAll(leftMembers);
}

if (this.listeners.isEmpty()) {
if (!this.listeners.isEmpty()) {
Address localAddress = this.dispatcher.getChannel().getAddress();
ViewMembership oldMembership = new ViewMembership(localAddress, oldView, this);
ViewMembership membership = new ViewMembership(localAddress, view, this);
@@ -0,0 +1,136 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2019, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file 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.jboss.as.test.clustering.cluster.group;

import static org.junit.Assert.*;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.TargetsContainer;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.as.test.clustering.cluster.AbstractClusteringTestCase;
import org.jboss.as.test.clustering.cluster.group.bean.ClusterTopology;
import org.jboss.as.test.clustering.cluster.group.bean.ClusterTopologyRetriever;
import org.jboss.as.test.clustering.cluster.group.bean.ClusterTopologyRetrieverBean;
import org.jboss.as.test.clustering.ejb.EJBDirectory;
import org.jboss.as.test.clustering.ejb.RemoteEJBDirectory;
import org.jboss.as.test.shared.TimeoutUtil;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
* Integration test for the listener facility of a {@link Group}.
* @author Paul Ferraro
*/
@RunWith(Arquillian.class)
public class GroupListenerTestCase extends AbstractClusteringTestCase {
private static final String MODULE_NAME = GroupListenerTestCase.class.getSimpleName();
private static final long VIEW_CHANGE_WAIT = TimeoutUtil.adjust(2000);

@Deployment(name = DEPLOYMENT_1, managed = false, testable = false)
@TargetsContainer(NODE_1)
public static Archive<?> deployment1() {
return createDeployment();
}

@Deployment(name = DEPLOYMENT_2, managed = false, testable = false)
@TargetsContainer(NODE_2)
public static Archive<?> deployment2() {
return createDeployment();
}

private static Archive<?> createDeployment() {
final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
ejbJar.addPackage(ClusterTopologyRetriever.class.getPackage());
return ejbJar;
}

@Test
public void test() throws Exception {
try (EJBDirectory directory = new RemoteEJBDirectory(MODULE_NAME)) {
ClusterTopologyRetriever bean = directory.lookupStateless(ClusterTopologyRetrieverBean.class, ClusterTopologyRetriever.class);

ClusterTopology topology = bean.getClusterTopology();
assertEquals(topology.getCurrentMembers().toString(), 2, topology.getCurrentMembers().size());
assertTrue(topology.getCurrentMembers().toString(), topology.getCurrentMembers().contains(NODE_1));
assertTrue(topology.getCurrentMembers().toString(), topology.getCurrentMembers().contains(NODE_2));
assertEquals(topology.getPreviousMembers().toString(), 0, topology.getPreviousMembers().size());

stop(NODE_2);

Thread.sleep(VIEW_CHANGE_WAIT);

topology = bean.getClusterTopology();
assertEquals(topology.getCurrentMembers().toString(), 1, topology.getCurrentMembers().size());
assertTrue(topology.getCurrentMembers().toString(), topology.getCurrentMembers().contains(NODE_1));
assertEquals(topology.getPreviousMembers().toString(), 2, topology.getPreviousMembers().size());
assertTrue(topology.getPreviousMembers().toString(), topology.getPreviousMembers().contains(NODE_1));
assertTrue(topology.getPreviousMembers().toString(), topology.getPreviousMembers().contains(NODE_2));

start(NODE_2);

Thread.sleep(VIEW_CHANGE_WAIT);

topology = bean.getClusterTopology();
assertEquals(topology.getCurrentMembers().toString(), 2, topology.getCurrentMembers().size());
assertTrue(topology.getCurrentMembers().toString(), topology.getCurrentMembers().contains(NODE_1));
assertTrue(topology.getCurrentMembers().toString(), topology.getCurrentMembers().contains(NODE_2));
if (topology.getTargetMember().equals(NODE_1)) {
assertEquals(topology.getPreviousMembers().toString(), 1, topology.getPreviousMembers().size());
assertTrue(topology.getPreviousMembers().toString(), topology.getPreviousMembers().contains(NODE_1));
} else {
// Since node 2 was just started, its previous membership will be empty
assertEquals(topology.getPreviousMembers().toString(), 0, topology.getPreviousMembers().size());
}

stop(NODE_1);

Thread.sleep(VIEW_CHANGE_WAIT);

topology = bean.getClusterTopology();
assertEquals(topology.getCurrentMembers().toString(), 1, topology.getCurrentMembers().size());
assertTrue(topology.getCurrentMembers().toString(), topology.getCurrentMembers().contains(NODE_2));
assertEquals(topology.getPreviousMembers().toString(), 2, topology.getPreviousMembers().size());
assertTrue(topology.getPreviousMembers().toString(), topology.getPreviousMembers().contains(NODE_1));
assertTrue(topology.getPreviousMembers().toString(), topology.getPreviousMembers().contains(NODE_2));

start(NODE_1);

Thread.sleep(VIEW_CHANGE_WAIT);

topology = bean.getClusterTopology();
assertEquals(topology.getCurrentMembers().toString(), 2, topology.getCurrentMembers().size());
assertTrue(topology.getCurrentMembers().toString(), topology.getCurrentMembers().contains(NODE_1));
assertTrue(topology.getCurrentMembers().toString(), topology.getCurrentMembers().contains(NODE_2));
if (topology.getTargetMember().equals(NODE_2)) {
assertEquals(topology.getPreviousMembers().toString(), 1, topology.getPreviousMembers().size());
assertTrue(topology.getPreviousMembers().toString(), topology.getPreviousMembers().contains(NODE_2));
} else {
// Since node 1 was just started, its previous membership will be empty
assertEquals(topology.getPreviousMembers().toString(), 0, topology.getPreviousMembers().size());
}
}
}
}
@@ -0,0 +1,30 @@
package org.jboss.as.test.clustering.cluster.group.bean;

import java.io.Serializable;
import java.util.List;

public class ClusterTopology implements Serializable {
private static final long serialVersionUID = 413628123168918069L;

private final String targetMember;
private final List<String> currentMembers;
private final List<String> previousMembers;

public ClusterTopology(String targetMember, List<String> currentMembers, List<String> previousMembers) {
this.targetMember = targetMember;
this.currentMembers = currentMembers;
this.previousMembers = previousMembers;
}

public String getTargetMember() {
return this.targetMember;
}

public List<String> getCurrentMembers() {
return this.currentMembers;
}

public List<String> getPreviousMembers() {
return this.previousMembers;
}
}
@@ -0,0 +1,6 @@
package org.jboss.as.test.clustering.cluster.group.bean;

public interface ClusterTopologyRetriever {

ClusterTopology getClusterTopology();
}
@@ -0,0 +1,28 @@
package org.jboss.as.test.clustering.cluster.group.bean;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.ejb.Stateless;

import org.wildfly.clustering.group.Membership;
import org.wildfly.clustering.group.Node;

@Stateless
@Remote(ClusterTopologyRetriever.class)
public class ClusterTopologyRetrieverBean implements ClusterTopologyRetriever {
@EJB
private Group group;

@Override
public ClusterTopology getClusterTopology() {
return new ClusterTopology(this.group.getLocalMember().getName(), getNames(this.group.getMembership()), getNames(this.group.getPreviousMembership()));
}

private static List<String> getNames(Membership membership) {
return (membership != null) ? membership.getMembers().stream().map(Node::getName).collect(Collectors.toList()) : Collections.emptyList();
}
}
@@ -0,0 +1,32 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2019, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file 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.jboss.as.test.clustering.cluster.group.bean;

import org.wildfly.clustering.group.Membership;

/**
* @author Paul Ferraro
*/
public interface Group extends org.wildfly.clustering.group.Group {
Membership getPreviousMembership();
}
@@ -0,0 +1,75 @@
package org.jboss.as.test.clustering.cluster.group.bean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.Local;
import javax.ejb.Singleton;
import javax.ejb.Startup;

import org.wildfly.clustering.Registration;
import org.wildfly.clustering.group.GroupListener;
import org.wildfly.clustering.group.Membership;
import org.wildfly.clustering.group.Node;

@Singleton
@Startup
@Local(Group.class)
public class GroupBean implements Group, GroupListener {

@Resource(lookup = "java:jboss/clustering/group/default")
private org.wildfly.clustering.group.Group group;
private Registration registration;
private volatile Membership previousMembership;

@PostConstruct
public void init() {
this.registration = this.group.register(this);
}

@PreDestroy
public void destroy() {
this.registration.close();
}

@Override
public void membershipChanged(Membership previousMembership, Membership membership, boolean merged) {
this.previousMembership = previousMembership;
}

@Deprecated
@Override
public void removeListener(org.wildfly.clustering.group.Group.Listener listener) {
this.group.removeListener(listener);
}

@Override
public String getName() {
return this.group.getName();
}

@Override
public Node getLocalMember() {
return this.group.getLocalMember();
}

@Override
public Membership getMembership() {
return this.group.getMembership();
}

@Override
public boolean isSingleton() {
return this.group.isSingleton();
}

@Override
public Registration register(GroupListener object) {
return this.group.register(object);
}

@Override
public Membership getPreviousMembership() {
return this.previousMembership;
}
}

No commit comments for this range

You can’t perform that action at this time.