Examples of RuntimeConfig


Examples of org.jboss.cache.config.RuntimeConfig

            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());
      assertSame("Same TM", tm, rc.getTransactionManager());
      assertSame("Same ChannelFactory", cf, wrapper.getMuxChannelFactory());
      assertSame("Same ChannelFactory", cf, rc.getMuxChannelFactory());
   }
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

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

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

      if (channelFactory != null)
      {
         try
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

   // --------------------------------------------------------  Private methods

   private void injectMuxChannel() throws CacheException
   {
      Configuration cfg = getConfiguration();
      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)
         {
            throw new CacheException("Exception creating multiplexed channel", e);
         }
         rtcfg.setChannel(ch);
      }
   }
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

      return base + ":" + attributesBase + configName;
   }
  
   private void configureMuxUpHandlerChannel(Cache<?, ?> cache) throws Exception
   {
      RuntimeConfig rc = cache.getConfiguration().getRuntimeConfig();
      Channel channel = rc.getChannel();
     
         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)
         {
            // replace
            rc.setChannel(new MuxHandlerChannel((JChannel) channel));
         }
         // else the Channel was injected and already had a handler -- shouldn't happen
   }
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

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

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

      if (channelFactory != null)
      {
         try
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

      muxHelper.configureCacheForMux(cache);

      Channel channel = new JChannel(new UnitTestCacheFactory().mangleClusterConfiguration(
              UnitTestCacheConfigurationFactory.getClusterConfigFromProperties(JChannel.DEFAULT_PROTOCOL_STACK)));

      RuntimeConfig rtcfg = cache.getConfiguration().getRuntimeConfig();
      rtcfg.setChannel(channel);

      // Start shouldn't fail and we shouldn't be using mulitplexer
      checkStart(false, false);

      assertEquals("Injected channel used", channel, rtcfg.getChannel());
   }
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

            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());
      assertSame("Same TM", tm, rc.getTransactionManager());
      assertSame("Same ChannelFactory", cf, wrapper.getMuxChannelFactory());
      assertSame("Same ChannelFactory", cf, rc.getMuxChannelFactory());
   }
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

      wrapper.setMultiplexerService((JChannelFactoryMBean) MBeanServerInvocationHandler.newProxyInstance(mBeanServer, on, JChannelFactoryMBean.class, false));

      wrapper.start();

      RuntimeConfig rc = wrapper.getConfiguration().getRuntimeConfig();
      assertNotNull("Channel created", rc.getChannel());
     
      //wrapper.stop();
      //wrapper.destroy();
           
   }
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

   // --------------------------------------------------------  Private methods

   private void injectMuxChannel() throws CacheException
   {
      Configuration cfg = getConfiguration();
      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)
         {
            throw new CacheException("Exception creating multiplexed channel", e);
         }
         rtcfg.setChannel(ch);
      }
   }
View Full Code Here

Examples of org.jboss.cache.config.RuntimeConfig

      muxHelper.configureCacheForMux(cache);

      Channel channel = new JChannel(new UnitTestCacheFactory().mangleClusterConfigurationUdp(
              getClusterConfigFromProperties(JChannel.DEFAULT_PROTOCOL_STACK)));

      RuntimeConfig rtcfg = cache.getConfiguration().getRuntimeConfig();
      rtcfg.setChannel(channel);

      // Start shouldn't fail and we shouldn't be using mulitplexer
      checkStart(false, false);

      assertEquals("Injected channel used", channel, rtcfg.getChannel());
   }
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.