Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

made code a bit more compact, removed cruft

  • Loading branch information...
commit 0a37f60abac6fe4dddb957b9cd9c827d9a6a17da 1 parent 9cc1aa7
@belaban authored
Showing with 5 additions and 27 deletions.
  1. +5 −27 tests/junit/org/jgroups/tests/ChannelTestBase.java
View
32 tests/junit/org/jgroups/tests/ChannelTestBase.java
@@ -219,48 +219,28 @@ public Channel createChannel(boolean unique, int num) throws Exception {
}
public Channel createChannel(final JChannel ch) throws Exception {
- Map<Integer, Object> channelOptions = new HashMap<Integer, Object>();
- boolean useBlocking = (Boolean) ch.getOpt(Channel.BLOCK);
- channelOptions.put(Channel.BLOCK, useBlocking);
-
- log.info("Using configuration file " + channel_conf);
JChannel retval = new JChannel(ch);
- for (Map.Entry<Integer, Object> entry : channelOptions.entrySet()) {
- Integer key = entry.getKey();
- Object value = entry.getValue();
- retval.setOpt(key, value);
- }
+ retval.setOpt(Channel.BLOCK, ch.getOpt(Channel.BLOCK));
if(useFlush())
Util.addFlush(retval, new FLUSH());
-
return retval;
}
private JChannel createChannel(String configFile) throws Exception {
- Map<Integer, Object> channelOptions = new HashMap<Integer, Object>();
- channelOptions.put(Channel.BLOCK, useBlocking());
-
- log.info("Using configuration file " + configFile);
JChannel ch = new JChannel(configFile);
- for (Map.Entry<Integer, Object> entry : channelOptions.entrySet()) {
- Integer key = entry.getKey();
- Object value = entry.getValue();
- ch.setOpt(key, value);
- }
+ ch.setOpt(Channel.BLOCK, useBlocking());
if(useFlush())
Util.addFlush(ch, new FLUSH());
-
return ch;
}
protected void makeUnique(Channel channel, int num) throws Exception {
- String str = Util.getProperty(new String[] { Global.UDP_MCAST_ADDR,
- "jboss.partition.udpGroup" }, null, "mcast_addr", false, null);
+ String str = Util.getProperty(new String[]{ Global.UDP_MCAST_ADDR, "jboss.partition.udpGroup" },
+ null, "mcast_addr", false, null);
if (str != null)
makeUnique(channel, num, str);
else
makeUnique(channel, num, null);
-
}
protected void makeUnique(Channel channel, int num, String mcast_address) throws Exception {
@@ -302,15 +282,13 @@ protected void makeUnique(Channel channel, int num, String mcast_address) throws
interface EventSequence {
List<Object> getEvents();
-
String getName();
}
/**
* Base class for all aplications using channel
*/
- protected abstract class ChannelApplication extends ExtendedReceiverAdapter implements
- EventSequence, Runnable {
+ protected abstract class ChannelApplication extends ExtendedReceiverAdapter implements EventSequence, Runnable {
protected Channel channel;
protected Thread thread;
protected Throwable exception;
Please sign in to comment.
Something went wrong with that request. Please try again.