Package org.jgroups

Examples of org.jgroups.JChannelFactory


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


      registerWrapper(wrapper);

      wrapper = (CacheJmxWrapperMBean) MBeanServerInvocationHandler.newProxyInstance(mBeanServer, mBeanName, CacheJmxWrapperMBean.class, false);
      wrapper.setMultiplexerStack(MultiplexerTestHelper.MUX_STACK);

      JChannelFactory factory = new JChannelFactory();
      factory.setDomain("jbc.mux.test");
      factory.setExposeChannels(false);
      factory.setMultiplexerConfig(MultiplexerTestHelper.getClusterConfigElement(getDefaultProperties()));

      ObjectName on = new ObjectName("jgroups:service=Mux");
      mBeanServer.registerMBean(new org.jgroups.jmx.JChannelFactory(factory), on);

      wrapper.setMultiplexerService((JChannelFactoryMBean) MBeanServerInvocationHandler.newProxyInstance(mBeanServer, on, JChannelFactoryMBean.class, false));
View Full Code Here

    */
   public ChannelFactory createMuxChannelFactory(String muxConfig) throws Exception
   {
      synchronized (factories)
      {
         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

    *
    * @throws Exception
    */
   public void testBasic() throws Exception
   {
      JChannelFactory cf = new JChannelFactory();
      cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
      CacheManagerImpl registry = new CacheManagerImpl(DEFAULT_CONFIGURATION_FILE, cf);
      registry.start();
     
      ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();
     
View Full Code Here

      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

       
        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

        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.