Re: [jgroups-users] How to set initial_hosts for TCPPING after the JChanel object is created, but not yet connected

Questions/problems related to using JGroups <[email protected]>
Newsgroups gmane.comp.java.javagroups.general
Message-ID <[email protected]>
The code below does this for me (on 4.0, master):

         JChannel ch=new JChannel("/home/bela/tcp.xml").name("A");
         TCPPING ping=ch.getProtocolStack().findProtocol(TCPPING.class);
         List<PhysicalAddress> initial_hosts=ping.getInitialHosts();

         System.out.println("initial_hosts = " + initial_hosts);
         IpAddress new_host=new IpAddress("192.168.1.3", 7800);
         initial_hosts.add(new_host);
         ping.level("trace");
         ch.connect("demo");

On 04/04/16 20:57, Questions/problems related to using JGroups wrote:
> subj, is it even possible?
> What I want to do is following:
>
> finalJChannel channel= newJChannel("/opt/my-cluster.xml");
>
> channel.__setInitialHosts___(initialHosts);
>
>
> I know there is a way programmatically set up whole protocol stack. But
> I think it would save a lot of time and lines of code if we could load
> the initial settings from the XML, and set dynamic properties
> programmatically.
>
> Thank you,
>
> Eugene
>
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> javagroups-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/javagroups-users
>

-- 
Bela Ban, JGroups lead (http://www.jgroups.org)


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.