Package org.jgroups.conf

Examples of org.jgroups.conf.ProtocolStackConfigurator


     * {@inheritDoc}
     * @see org.jboss.msc.service.Service#start(org.jboss.msc.service.StartContext)
     */
    @Override
    public void start(final StartContext context) throws StartException {
        ProtocolStackConfigurator configurator = load(ProtocolDefaultsService.this.resource);
        Defaults defaults = new Defaults();
        for (org.jgroups.conf.ProtocolConfiguration config: configurator.getProtocolStack()) {
            defaults.add(config.getProtocolName(), config.getProperties());
        }
        ProtocolDefaultsService.this.defaults = defaults;
    }
View Full Code Here


  @Test
  public void should_create_jchannel_using_provided_configurator_and_cluster_name() throws Exception {
    JGroupsChannelFactoryBean factoryBean = new JGroupsChannelFactoryBean();

    ProtocolStackConfigurator protocolStackConfigurator = mock(ProtocolStackConfigurator.class);
    List<ProtocolConfiguration> protocols = asList(new ProtocolConfiguration("UDP"));
    when(protocolStackConfigurator.getProtocolStack()).thenReturn(protocols);


    factoryBean.setProtocolStackConfigurator(protocolStackConfigurator);
    factoryBean.setClusterName("cluster");
    factoryBean.afterPropertiesSet();
View Full Code Here

  public void should_load_configuration_from_xml_file() throws Exception {
    XmlConfiguratorFactoryBean factoryBean = new XmlConfiguratorFactoryBean();
    factoryBean.setResource(new ClassPathResource("/udp.xml"));
    factoryBean.afterPropertiesSet();

    ProtocolStackConfigurator configurator = factoryBean.getObject();

    assertThat(configurator.getProtocolStack()).isNotEmpty();
  }
View Full Code Here

    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage(is("no XML resource with JGroups configuration"));

    factoryBean.afterPropertiesSet();

    @SuppressWarnings("unused")
    ProtocolStackConfigurator stackConfigurator = factoryBean.getObject();
  }
View Full Code Here

     */
    public JChannel(Object properties) throws ChannelException {
        if (properties == null)
            properties = DEFAULT_PROTOCOL_STACK;

        ProtocolStackConfigurator c=null;

        try {
            c=ConfiguratorFactory.getStackConfigurator(properties);
        }
        catch(Exception x) {
View Full Code Here

     */
    public JChannel(Object properties) throws ChannelException {
        if (properties == null)
            properties = DEFAULT_PROTOCOL_STACK;

        ProtocolStackConfigurator c;

        try {
            c=ConfiguratorFactory.getStackConfigurator(properties);
        }
        catch(Exception x) {
View Full Code Here

     */
    public JChannel(Object properties) throws ChannelException {
        if (properties == null)
            properties = DEFAULT_PROTOCOL_STACK;

        ProtocolStackConfigurator c;

        try {
            c=ConfiguratorFactory.getStackConfigurator(properties);
        }
        catch(Exception x) {
View Full Code Here

      checkStarted();

      if (properties == null)
         properties = JChannel.DEFAULT_PROTOCOL_STACK;

      ProtocolStackConfigurator config = null;

      try
      {
         ProtocolStackConfigurator c = ConfiguratorFactory.getStackConfigurator(properties);
         config = c;
      }
      catch (Exception x)
      {
         throw new ChannelException("unable to load protocol stack", x);
View Full Code Here

   }
 
   private ProtocolStackConfigurator addSingletonName(ProtocolStackConfigurator orig, String singletonName)
      throws ChannelException
   {
      ProtocolStackConfigurator result = null;
      try
      {
         ProtocolData[] protocols=orig.getProtocolStack();
         ProtocolData transport=protocols[0];
         ProtocolParameter singletonParam = new ProtocolParameter(Global.SINGLETON_NAME, singletonName);
View Full Code Here

     */
    public JChannel(Object properties) throws ChannelException {
        if (properties == null)
            properties = DEFAULT_PROTOCOL_STACK;

        ProtocolStackConfigurator c=null;

        try {
            c=ConfiguratorFactory.getStackConfigurator(properties);
        }
        catch(Exception x) {
View Full Code Here

TOP

Related Classes of org.jgroups.conf.ProtocolStackConfigurator

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.