Package org.jgroups

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


    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

   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

         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

   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

    */
   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

      // 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

         this.autoStart = Boolean.valueOf(properties.getProperty(AUTO_START, DEFAULT_AUTO_START));
         this.autoStop = Boolean.valueOf(properties.getProperty(AUTO_STOP, DEFAULT_AUTO_STOP));
        
         String stack = properties.getProperty(STACK, DEFAULT_STACK);
         String id = properties.getProperty(CHANNEL_ID);
         ChannelFactory factory = (ChannelFactory) properties.get(CHANNEL_FACTORY);
        
         try
         {
            return factory.createMultiplexerChannel(stack, id);
         }
         catch (Exception e)
         {
            throw new IllegalArgumentException(e);
         }
View Full Code Here

      @Override
      public Channel getJGroupsChannel(Properties properties)
      {
         String stack = properties.getProperty(STACK, DEFAULT_STACK);
         String id = properties.getProperty(CHANNEL_ID);
         ChannelFactory factory = (ChannelFactory) properties.get(CHANNEL_FACTORY);
        
         try
         {
            return factory.createMultiplexerChannel(stack, id);
         }
         catch (Exception e)
         {
            throw new IllegalArgumentException(e);
         }
View Full Code Here

    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

TOP

Related Classes of org.jgroups.ChannelFactory

Copyright © 2018 www.massapicom. 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.