diff --git a/pom.xml b/pom.xml index 7506010..98f771a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ pt.unl.fct.di.novasys babel-core - 0.5.02 + 0.5.03 UTF-8 diff --git a/src/main/java/pt/unl/fct/di/novasys/babel/core/Babel.java b/src/main/java/pt/unl/fct/di/novasys/babel/core/Babel.java index 466d22e..b5b81e4 100644 --- a/src/main/java/pt/unl/fct/di/novasys/babel/core/Babel.java +++ b/src/main/java/pt/unl/fct/di/novasys/babel/core/Babel.java @@ -15,6 +15,7 @@ import pt.unl.fct.di.novasys.channel.accrual.AccrualChannel; import pt.unl.fct.di.novasys.channel.simpleclientserver.SimpleClientChannel; import pt.unl.fct.di.novasys.channel.simpleclientserver.SimpleServerChannel; +import pt.unl.fct.di.novasys.channel.tcp.SharedTCPChannel; import pt.unl.fct.di.novasys.channel.tcp.TCPChannel; import pt.unl.fct.di.novasys.network.ISerializer; import pt.unl.fct.di.novasys.network.data.Host; @@ -121,6 +122,7 @@ private Babel() { registerChannelInitializer(SimpleServerChannel.NAME, new SimpleServerChannelInitializer()); registerChannelInitializer(TCPChannel.NAME, new TCPChannelInitializer()); registerChannelInitializer(AccrualChannel.NAME, new AccrualChannelInitializer()); + registerChannelInitializer(SharedTCPChannel.NAME, new SharedTCPChannelInitializer()); //registerChannelInitializer("Ackos", new AckosChannelInitializer()); //registerChannelInitializer(MultithreadedTCPChannel.NAME, new MultithreadedTCPChannelInitializer()); diff --git a/src/main/java/pt/unl/fct/di/novasys/babel/initializers/SharedTCPChannelInitializer.java b/src/main/java/pt/unl/fct/di/novasys/babel/initializers/SharedTCPChannelInitializer.java new file mode 100644 index 0000000..653df53 --- /dev/null +++ b/src/main/java/pt/unl/fct/di/novasys/babel/initializers/SharedTCPChannelInitializer.java @@ -0,0 +1,18 @@ +package pt.unl.fct.di.novasys.babel.initializers; + +import pt.unl.fct.di.novasys.babel.internal.BabelMessage; +import pt.unl.fct.di.novasys.channel.ChannelListener; +import pt.unl.fct.di.novasys.channel.tcp.SharedTCPChannel; +import pt.unl.fct.di.novasys.network.ISerializer; + +import java.io.IOException; +import java.util.Properties; + +public class SharedTCPChannelInitializer implements ChannelInitializer> { + + @Override + public SharedTCPChannel initialize(ISerializer iSerializer, ChannelListener channelListener, + Properties properties, short protoId) throws IOException { + return new SharedTCPChannel<>(iSerializer, channelListener, properties); + } +}