From 7721b86995d2d7fe8d1582d7517757f0614e4f48 Mon Sep 17 00:00:00 2001 From: kimchy Date: Mon, 10 May 2010 01:15:08 +0300 Subject: [PATCH] don't let guice by mistake inject two instances --- .../transport/local/LocalTransportManagement.java | 7 ++++--- .../transport/netty/NettyTransportManagement.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/transport/local/LocalTransportManagement.java b/modules/elasticsearch/src/main/java/org/elasticsearch/transport/local/LocalTransportManagement.java index 55ddd33c0ed..1202567a291 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/transport/local/LocalTransportManagement.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/transport/local/LocalTransportManagement.java @@ -19,8 +19,9 @@ package org.elasticsearch.transport.local; -import org.elasticsearch.util.guice.inject.Inject; import org.elasticsearch.jmx.MBean; +import org.elasticsearch.transport.Transport; +import org.elasticsearch.util.guice.inject.Inject; /** * @author kimchy (Shay Banon) @@ -30,7 +31,7 @@ public class LocalTransportManagement { private final LocalTransport transport; - @Inject public LocalTransportManagement(LocalTransport transport) { - this.transport = transport; + @Inject public LocalTransportManagement(Transport transport) { + this.transport = (LocalTransport) transport; } } \ No newline at end of file diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/transport/netty/NettyTransportManagement.java b/modules/elasticsearch/src/main/java/org/elasticsearch/transport/netty/NettyTransportManagement.java index 2223f1e8509..4091e17d16b 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/transport/netty/NettyTransportManagement.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/transport/netty/NettyTransportManagement.java @@ -19,9 +19,10 @@ package org.elasticsearch.transport.netty; -import org.elasticsearch.util.guice.inject.Inject; import org.elasticsearch.jmx.MBean; import org.elasticsearch.jmx.ManagedAttribute; +import org.elasticsearch.transport.Transport; +import org.elasticsearch.util.guice.inject.Inject; /** * @author kimchy (Shay Banon) @@ -31,8 +32,8 @@ public class NettyTransportManagement { private final NettyTransport transport; - @Inject public NettyTransportManagement(NettyTransport transport) { - this.transport = transport; + @Inject public NettyTransportManagement(Transport transport) { + this.transport = (NettyTransport) transport; } @ManagedAttribute(description = "Number of connections this node has to other nodes")