Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,22 @@ public final void setEncryptionFactory(Encryption.Factory encryptionFactory) {
}

protected void registerMBean() {

try {
mbeanServer.registerMBean(this, new ObjectName(getMBeanName()));
ObjectName objectName = new ObjectName(getMBeanName());
synchronized (mbeanServer) {
if (mbeanServer.isRegistered(objectName)) {
mbeanServer.unregisterMBean(objectName);
}
try {
mbeanServer.registerMBean(this, objectName);
} catch (javax.management.InstanceAlreadyExistsException e) {
mbeanServer.unregisterMBean(objectName);
mbeanServer.registerMBean(this, objectName);
}
}
} catch (Exception e) {
throw new RuntimeException("Unable to register mbean", e);
}

}

protected void unregisterMBean() {
Expand Down Expand Up @@ -481,8 +490,9 @@ public String[] getBoundAddresses() {
protected void configureBootstrap(ServerBootstrap bootstrap) {
super.configureBootstrap(bootstrap);

// enable tcp keep-alives
// enable tcp keep-alives and disable Nagle's algorithm for low latency
bootstrap.childOption(ChannelOption.SO_KEEPALIVE, true);
bootstrap.childOption(ChannelOption.TCP_NODELAY, true);
Comment on lines -484 to +486

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does nothing new.

super.configureBootstrap(bootstrap) already sets it in protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java:182

The added line sets it a second time, and the new comment wrongly suggests it wasn't set before.

}

protected abstract ChannelHandlerFactory createFrameHandlerFactory();
Expand Down