Package org.jgroups

Examples of org.jgroups.JChannelFactory


      assertEquals(cacheNames, registry.getConfigurationNames());
   }

   public void testNullConfigResource() throws Exception
   {
      JChannelFactory cf = new JChannelFactory();
      cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
      String configResource = null;
      CacheManagerImpl registry = new CacheManagerImpl(configResource, cf);
      registry.start();

      assertEquals("No configs", 0, registry.getConfigurationNames().size());
View Full Code Here


   public ChannelFactory createMuxChannelFactory(String muxConfig) throws Exception
   {
      synchronized (factories)
      {
         muxConfig = new UnitTestCacheFactory().mangleClusterConfiguration(muxConfig);
         JChannelFactory factory = new JChannelFactory();
         factory.setDomain("jbc.mux.test");
         factory.setExposeChannels(false);
         factory.setMultiplexerConfig(getClusterConfigElement(muxConfig));

         factories.add(factory);

         return factory;
      }
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

    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

            // Get path to JGroups configuration
            String jgroupsConfigurationFilePath = parameterEntry.getParameterValue(JGROUPS_CONFIG);
            if (jgroupsConfigurationFilePath != null)
            {
               // Create and inject multiplexer factory
               JChannelFactory muxFactory = new JChannelFactory();
               muxFactory.setMultiplexerConfig(configurationManager.getResource(jgroupsConfigurationFilePath));
               cache.getConfiguration().getRuntimeConfig().setMuxChannelFactory(muxFactory);
               log.info("Multiplexer stack successfully enabled for the cache.");
            }
         }
         catch (Exception e)
View Full Code Here

       
        configureBroadcastHandlers();
       
        try
        {
            JChannelFactory channelFactory = new JChannelFactory(props);
            clusterChannel = (JChannel) channelFactory.createChannel();
            // Disable delivery of messages we send to ourself.
            clusterChannel.setOpt(Channel.LOCAL, Boolean.FALSE);
            //clusterChannel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
            broadcastDispatcher = new MessageDispatcher(clusterChannel, null, clusterMembershipListener, this);
            clusterChannel.connect(clusterId);
View Full Code Here

            // Get path to JGroups configuration
            String jgroupsConfigurationFilePath = parameterEntry.getParameterValue(JGROUPS_CONFIG);
            if (jgroupsConfigurationFilePath != null)
            {
               // Create and inject multiplexer factory
               JChannelFactory muxFactory = new JChannelFactory();
               muxFactory.setMultiplexerConfig(configurationManager.getResource(jgroupsConfigurationFilePath));
               cache.getConfiguration().getRuntimeConfig().setMuxChannelFactory(muxFactory);
               log.info("Multiplexer stack successfully enabled for the cache.");
            }
         }
         catch (Exception e)
View Full Code Here

    */
   public ObjectName createMuxChannelFactory(Element muxConfig) throws Exception
   {
      synchronized (factories)
      {
         JChannelFactory factory = new JChannelFactory();
         factory.setDomain("jbc.mux.test");
         factory.setExposeChannels(false);
           
         MuxChannelFactory muxFactory = new MuxChannelFactory(factory, muxConfig);
         // Give the factory a unique ObjectName
         ObjectName on = new ObjectName(FACTORY_OBJECT_NAME_BASE + factories.size());
         mbeanServer.registerMBean(muxFactory, on);
View Full Code Here

        if (cache == null) {
           
            if (channelFactory == null) {
                String muxStacks = PropertiesHelper.getString(CHANNEL_FACTORY_RESOURCE_PROP, properties, DEF_JGROUPS_RESOURCE);
                if (muxStacks != null) {
                    channelFactory = new JChannelFactory();
                    try {
                        channelFactory.setMultiplexerConfig(muxStacks);
                    }
                    catch (Exception e) {
                        throw new CacheException("Problem setting ChannelFactory config", e);
View Full Code Here

            if (buildCaches && jbcFactory == null) {
                // See if the user configured a multiplexer stack
                if (channelFactory == null) {
                    String muxStacks = PropertiesHelper.getString(CHANNEL_FACTORY_RESOURCE_PROP, properties, DEF_JGROUPS_RESOURCE);
                    if (muxStacks != null) {
                        channelFactory = new JChannelFactory();
                        channelFactory.setMultiplexerConfig(muxStacks);
                    }
                }
               
                String factoryRes = PropertiesHelper.getString(CACHE_FACTORY_RESOURCE_PROP, properties, DEF_CACHE_FACTORY_RESOURCE);
View Full Code Here

TOP

Related Classes of org.jgroups.JChannelFactory

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.