Added container support for DefaultLocal(Client|Server)ChannelFactory
This commit is contained in:
parent
b6ff3a4cad
commit
4d88c5348a
@ -26,6 +26,10 @@ import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import org.jboss.netty.channel.local.DefaultLocalClientChannelFactory;
|
||||
import org.jboss.netty.channel.local.DefaultLocalServerChannelFactory;
|
||||
import org.jboss.netty.channel.local.LocalClientChannelFactory;
|
||||
import org.jboss.netty.channel.local.LocalServerChannelFactory;
|
||||
import org.jboss.netty.channel.socket.ClientSocketChannelFactory;
|
||||
import org.jboss.netty.channel.socket.DatagramChannelFactory;
|
||||
import org.jboss.netty.channel.socket.ServerSocketChannelFactory;
|
||||
@ -97,5 +101,14 @@ public class NettyModule extends AbstractModule {
|
||||
bind(OioDatagramChannelFactory.class).
|
||||
toProvider(OioDatagramChannelFactoryProvider.class).
|
||||
in(Scopes.SINGLETON);
|
||||
|
||||
// Local transports
|
||||
bind(LocalClientChannelFactory.class).
|
||||
to(DefaultLocalClientChannelFactory.class).
|
||||
in(Scopes.SINGLETON);
|
||||
|
||||
bind(LocalServerChannelFactory.class).
|
||||
to(DefaultLocalServerChannelFactory.class).
|
||||
in(Scopes.SINGLETON);
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,10 @@ import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import org.jboss.netty.channel.ChannelFactory;
|
||||
import org.jboss.netty.channel.local.DefaultLocalClientChannelFactory;
|
||||
import org.jboss.netty.channel.local.DefaultLocalServerChannelFactory;
|
||||
import org.jboss.netty.channel.local.LocalClientChannelFactory;
|
||||
import org.jboss.netty.channel.local.LocalServerChannelFactory;
|
||||
import org.jboss.netty.channel.socket.ClientSocketChannelFactory;
|
||||
import org.jboss.netty.channel.socket.DatagramChannelFactory;
|
||||
import org.jboss.netty.channel.socket.ServerSocketChannelFactory;
|
||||
@ -77,6 +81,15 @@ public class NettyBundleActivator implements BundleActivator {
|
||||
new OioDatagramChannelFactory(executor),
|
||||
DatagramChannelFactory.class);
|
||||
|
||||
// Local transports
|
||||
register(ctx,
|
||||
new DefaultLocalClientChannelFactory(),
|
||||
LocalClientChannelFactory.class);
|
||||
register(ctx,
|
||||
new DefaultLocalServerChannelFactory(),
|
||||
LocalServerChannelFactory.class);
|
||||
|
||||
// Miscellaneous transports
|
||||
register(ctx, new OioClientSocketChannelFactory(executor));
|
||||
register(ctx, new OioServerSocketChannelFactory(executor, executor));
|
||||
}
|
||||
|
@ -101,4 +101,16 @@
|
||||
</parameter>
|
||||
</constructor>
|
||||
</bean>
|
||||
|
||||
<bean mode="On Demand"
|
||||
name="org.jboss.netty.channel.local.DefaultLocalClientChannelFactory"
|
||||
class="org.jboss.netty.channel.local.DefaultLocalClientChannelFactory">
|
||||
<alias>org.jboss.netty.channel.local.LocalClientChannelFactory</alias>
|
||||
</bean>
|
||||
|
||||
<bean mode="On Demand"
|
||||
name="org.jboss.netty.channel.local.DefaultLocalServerChannelFactory"
|
||||
class="org.jboss.netty.channel.local.DefaultLocalServerChannelFactory">
|
||||
<alias>org.jboss.netty.channel.local.LocalServerChannelFactory</alias>
|
||||
</bean>
|
||||
</deployment>
|
@ -66,10 +66,24 @@
|
||||
<constructor-arg ref="org.jboss.netty.internal.ChannelFactoryExecutor"/>
|
||||
</bean>
|
||||
|
||||
<bean lazy-init="true" scope="singleton"
|
||||
name="org.jboss.netty.channel.local.DefaultLocalClientChannelFactory"
|
||||
class="org.jboss.netty.channel.local.DefaultLocalClientChannelFactory">
|
||||
</bean>
|
||||
|
||||
<bean lazy-init="true" scope="singleton"
|
||||
name="org.jboss.netty.channel.local.DefaultLocalServerChannelFactory"
|
||||
class="org.jboss.netty.channel.local.DefaultLocalServerChannelFactory">
|
||||
</bean>
|
||||
|
||||
<alias name="org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory"
|
||||
alias="org.jboss.netty.channel.socket.ClientSocketChannelFactory" />
|
||||
<alias name="org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory"
|
||||
alias="org.jboss.netty.channel.socket.ServerSocketChannelFactory" />
|
||||
<alias name="org.jboss.netty.channel.socket.oio.OioDatagramChannelFactory"
|
||||
alias="org.jboss.netty.channel.socket.DatagramChannelFactory" />
|
||||
<alias name="org.jboss.netty.channel.local.DefaultLocalClientChannelFactory"
|
||||
alias="org.jboss.netty.channel.local.LocalClientChannelFactory" />
|
||||
<alias name="org.jboss.netty.channel.local.DefaultLocalServerChannelFactory"
|
||||
alias="org.jboss.netty.channel.local.LocalServerChannelFactory" />
|
||||
</beans>
|
||||
|
Loading…
x
Reference in New Issue
Block a user