Skip to content

Commit

Permalink
Merge pull request #4 from dfbarreto/add-shared-channel-init
Browse files Browse the repository at this point in the history
Added SharedTCP channel initializer
  • Loading branch information
pfouto authored Aug 3, 2023
2 parents b8fdc41 + 5689e0b commit 781169e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>pt.unl.fct.di.novasys</groupId>
<artifactId>babel-core</artifactId>
<version>0.5.02</version>
<version>0.5.03</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/pt/unl/fct/di/novasys/babel/core/Babel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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<SharedTCPChannel<BabelMessage>> {

@Override
public SharedTCPChannel<BabelMessage> initialize(ISerializer<BabelMessage> iSerializer, ChannelListener<BabelMessage> channelListener,
Properties properties, short protoId) throws IOException {
return new SharedTCPChannel<>(iSerializer, channelListener, properties);
}
}

0 comments on commit 781169e

Please sign in to comment.