Package org.jgroups

Examples of org.jgroups.Channel


        Util.printThreads();
    }

    public void testCreationAndClose() throws Exception {
        System.out.println("-- creating channel1 --");
        Channel c = null;
        c = createChannel();
        c.connect("testCreationAndClose");
        assertTrue("channel open", c.isOpen());
        assertTrue("channel connected", c.isConnected());       
        c.close();       
        assertFalse("channel not connected", c.isConnected());
        c.close();
    }
View Full Code Here


      RuntimeConfig rtcfg = cfg.getRuntimeConfig();

      // Only inject if there isn't already a channel or factory
      if (rtcfg.getMuxChannelFactory() != null && rtcfg.getChannel() != null)
      {
         Channel ch;
         try
         {
            ch = multiplexerService.createMultiplexerChannel(cfg.getMultiplexerStack(), cfg.getClusterName());
         }
         catch (Exception e)
View Full Code Here

      RuntimeConfig rtcfg = cfg.getRuntimeConfig();

      // Only inject if there isn't already a channel or factory
      if (rtcfg.getMuxChannelFactory() == null && rtcfg.getChannel() == null)
      {
         Channel ch;
         try
         {
            ch = multiplexerService.createMultiplexerChannel(cfg.getMultiplexerStack(), cfg.getClusterName());
         }
         catch (Exception e)
View Full Code Here

    * @param members
    * @return
    */
   private List<Address> checkBuddyStatus(List<Address> members)
   {
      Channel ch = configuration.getRuntimeConfig().getChannel();
      View currentView = ch.getView();
      List<Address> deadBuddies = new LinkedList<Address>();
      for (Address a : members) if (!currentView.containsMember(a)) deadBuddies.add(a);
      return deadBuddies;
   }
View Full Code Here

    * @param members
    * @return
    */
   private List<Address> checkBuddyStatus(List<Address> members)
   {
      Channel ch = configuration.getRuntimeConfig().getChannel();
      View currentView = ch.getView();
      List<Address> deadBuddies = new LinkedList<Address>();
      for (Address a : members) if (!currentView.containsMember(a)) deadBuddies.add(a);
      return deadBuddies;
   }
View Full Code Here

      catch (Exception e)
      {
         // normal behaviour
      }

      Channel c = cache.channel; // hold a reference to this since stopService will set this to null in the cache.

      assertFalse("Channel should not have connected!", c.isConnected());
      assertFalse("Channel should not be open", c.isOpen());

      cache.stopService();

      assertFalse("Channel should not have connected!", c.isConnected());
      assertFalse("Channel should not be open", c.isOpen());

      assertNull("Should be null", cache.channel);
   }
View Full Code Here

      catch (Exception e)
      {
         fail("NOT expecting the startService() method to throw an exception");
      }

      Channel c = cache.channel; // hold a reference to this since stopService will set this to null in the cache.

      assertTrue("Channel should have connected!", c.isConnected());
      assertTrue("Channel should be open", c.isOpen());


      cache.stopService();

      assertFalse("Channel should not have connected!", c.isConnected());
      assertFalse("Channel should not be open", c.isOpen());

      assertNull("Should be null", cache.channel);
   }
View Full Code Here

      return values;
   }

   public static DISCARD getDiscardForCache(Cache<?, ?> c) throws Exception {
      JGroupsTransport jgt = (JGroupsTransport) TestingUtil.extractComponent(c, Transport.class);
      Channel ch = jgt.getChannel();
      ProtocolStack ps = ch.getProtocolStack();
      DISCARD discard = new DISCARD();
      ps.insertProtocol(discard, ProtocolStack.ABOVE, TP.class);
      return discard;
   }
View Full Code Here

    * @return a reference to the DELAY instance being used by the JGroups stack
    * @throws Exception
    */
   public static DELAY setDelayForCache(Cache<?, ?> cache, int in_delay_millis, int out_delay_millis) throws Exception {
      JGroupsTransport jgt = (JGroupsTransport) TestingUtil.extractComponent(cache, Transport.class);
      Channel ch = jgt.getChannel();
      ProtocolStack ps = ch.getProtocolStack();
      DELAY delay = (DELAY) ps.findProtocol(DELAY.class);
      if (delay==null) {
         delay = new DELAY();
         ps.insertProtocol(delay, ProtocolStack.ABOVE, TP.class);
      }
View Full Code Here

         SharedLocalYieldingClusterLockManager lockManager = this.lockManagers.get(clusterName);
        
         if (lockManager == null)
         {
            JGroupsTransport transport = (JGroupsTransport) cache.getAdvancedCache().getRpcManager().getTransport();
            Channel channel = transport.getChannel();
           
            CoreGroupCommunicationService gcs = new CoreGroupCommunicationService();
            gcs.setChannel(channel);
            gcs.setScopeId(SCOPE_ID);
           
View Full Code Here

TOP

Related Classes of org.jgroups.Channel

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.