Examples of ChannelFactory


Examples of org.jboss.netty.channel.ChannelFactory

        }
    }

    private static void runAsyncClients(SocketAddress server, int nClients, int nSelectors)
            throws Exception {
        ChannelFactory channelFactory = new NioClientSocketChannelFactory(
                Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool(),
                nSelectors);
        allConnected = new CountDownLatch(nClients);
        allFinished = new CountDownLatch(nClients);
View Full Code Here

Examples of org.jboss.netty.channel.ChannelFactory

public class RpcServer extends RpcPeer {

    ServerBootstrap bootstrap;

    public RpcServer() {
        ChannelFactory channelFactory = new NioServerSocketChannelFactory(
                Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());
        bootstrap = new ServerBootstrap(channelFactory);
        bootstrap.setPipelineFactory(new RpcChannelPiplineFactory(this));
    }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelFactory

    ClientBootstrap bootstrap;
    private volatile RpcChannel rpcChannel;

    public RpcClient() {
        ChannelFactory channelFactory = new NioClientSocketChannelFactory(
                Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());

        bootstrap = new ClientBootstrap(channelFactory);
        bootstrap.setPipelineFactory(new RpcChannelPiplineFactory(this));
View Full Code Here

Examples of org.jgroups.ChannelFactory

    }


    public static void main(String args[]) {
        DistributedHashtableDemo  client=new DistributedHashtableDemo();
        ChannelFactory            factory=new JChannelFactory();
        String                    arg;
        boolean                   persist=false;

        // test for pbcast
        /*
 
View Full Code Here

Examples of org.jgroups.ChannelFactory

    public static void main(String[] args)
    {
        String groupname = "QueueDemo";
        DistributedQueueDemo client = new DistributedQueueDemo();
        ChannelFactory factory = new JChannelFactory();
        String arg;
        String next_arg;
        boolean trace = false;
        boolean persist = false;
View Full Code Here

Examples of org.jgroups.ChannelFactory

   private JChannel getMultiplexerChannel() throws CacheException
   {
      String stackName = configuration.getMultiplexerStack();

      RuntimeConfig rtc = configuration.getRuntimeConfig();
      ChannelFactory channelFactory = rtc.getMuxChannelFactory();
      JChannel muxchannel = null;

      if (channelFactory != null)
      {
         try
         {
            muxchannel = (JChannel) channelFactory.createMultiplexerChannel(stackName, configuration.getClusterName());
         }
         catch (Exception e)
         {
            throw new CacheException("Failed to create multiplexed channel using stack " + stackName, e);
         }
View Full Code Here

Examples of org.jgroups.ChannelFactory

         if (channel == null)     
         {
            // TODO we could deal with other JBC mechanisms of configuring Channels, but in
            // reality the AS use cases that want MuxUpHandler shouldn't configure their
            // JBC that way
            ChannelFactory cf = rc.getMuxChannelFactory();
            if (cf == null)
            {
               log.debug("Cache " + cache.getConfiguration().getClusterName() +
                     " does not have a ChannelFactory injected so MuxUpHandler cannot be integrated");
            }
            String stack = cache.getConfiguration().getMuxStackName();
            if (stack == null)
            {
               log.debug("Cache " + cache.getConfiguration().getClusterName() +
                     " does not have a MuxStackName configured so MuxUpHandler cannot be integrated");
            }
            if (cf != null && stack != null)
            {
               // This doesn't result in JMX reg of channel              
               //channel = cf.createChannel(stack);
               channel = cf.createMultiplexerChannel(stack, cache.getConfiguration().getClusterName());
               rc.setChannel(new MuxHandlerChannel((JChannel) channel));
            }
         }
         else if (channel.getUpHandler() == null)
         {
View Full Code Here

Examples of org.jgroups.ChannelFactory

   private JChannel getMultiplexerChannel() throws CacheException
   {
      String stackName = configuration.getMultiplexerStack();

      RuntimeConfig rtc = configuration.getRuntimeConfig();
      ChannelFactory channelFactory = rtc.getMuxChannelFactory();
      JChannel muxchannel = null;

      if (channelFactory != null)
      {
         try
         {
            muxchannel = (JChannel) channelFactory.createMultiplexerChannel(stackName, configuration.getClusterName());
         }
         catch (Exception e)
         {
            throw new CacheException("Failed to create multiplexed channel using stack " + stackName, e);
         }
View Full Code Here

Examples of org.jgroups.ChannelFactory

    */
   public void configureCacheForMux(Cache cache) throws Exception
   {
      synchronized (caches)
      {
         ChannelFactory factory = createMuxChannelFactory(cache);
         cache.getConfiguration().getRuntimeConfig().setMuxChannelFactory(factory);
         cache.getConfiguration().setMultiplexerStack(MUX_STACK + Thread.currentThread().getName());
      }
   }
View Full Code Here

Examples of org.jgroups.ChannelFactory

      // Fake a TM by making a bogus proxy
      TransactionManager tm = (TransactionManager) Proxy.newProxyInstance(getClass().getClassLoader(),
            new Class[]{TransactionManager.class}, new MockInvocationHandler());
      wrapper.setTransactionManager(tm);
      ChannelFactory cf = new JChannelFactory();
      wrapper.setMuxChannelFactory(cf);

      RuntimeConfig rc = wrapper.getConfiguration().getRuntimeConfig();

      assertSame("Same TM", tm, wrapper.getTransactionManager());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.