Package org.jgroups

Examples of org.jgroups.ReceiverAdapter


     */
    @Test
    public void testStress() throws Exception {
        channel=new JChannel("tunnel.xml");
        channel.connect("agroup");
        channel.setReceiver(new ReceiverAdapter() {

            @Override
            public void receive(Message msg) {
                receivedCnt++;
                if(receivedCnt % 2000 == 0)
View Full Code Here


    public void incomingBroadcast() {
        try {
            logger.info("Starting Atmosphere JGroups Clustering support");

            jchannel = new JChannel();
            jchannel.setReceiver(new ReceiverAdapter() {
                /** {@inheritDoc} */
                @Override
                public void receive(final Message message) {
                    final String msg = (String) message.getObject();
                    if (msg != null) {
View Full Code Here

  public static void main(String[] args) throws Exception {

    JChannel channel = new JChannel();
   
    channel.setReceiver(new ReceiverAdapter(){

      public void receive(Message msg) {
        Address sender = msg.getSrc();
        System.out.println(msg.getObject() + " [" + sender + "]");
      }
View Full Code Here

  public static void main(String[] args) throws Exception {

    JChannel ch = new JChannel();
    ch.connect("demo");
    ch.setReceiver(new ReceiverAdapter() {
      public void receive(Message msg) {
        MyHeader hdr = (MyHeader) msg.getHeader(ID);
        System.out.println("-- received " + msg + ", header is " + hdr);
      }
    });
View Full Code Here

        .addProtocol(new STABLE()).addProtocol(new GMS())
        .addProtocol(new UFC()).addProtocol(new MFC())
        .addProtocol(new FRAG2());
    stack.init();
   
    channel.setReceiver(new ReceiverAdapter(){

      public void receive(Message msg) {
        Address sender=msg.getSrc();
        System.out.println(msg.getObject() + " [" + sender + "]");
      }
View Full Code Here

  public void start() throws Exception {
    String props = "udp.xml";

    channel = new JChannel(props);

        channel.setReceiver(new ReceiverAdapter() {
            public void viewAccepted(View view) {
                setInternalState(view.getMembers());
            }

            public void setInternalState(java.util.List<Address> mbrs) {
View Full Code Here

  public static void main(String[] args) throws Exception {

    JChannel channel = new JChannel(args[0]);
   
    channel.setReceiver(new ReceiverAdapter(){

      public void receive(Message msg) {
        Address sender=msg.getSrc();
        System.out.println(msg.getObject() + " [" + sender + "]");
      }
View Full Code Here

    public void incomingBroadcast() {
        try {
            logger.info("Starting Atmosphere JGroups Clustering support with group name {}", getID());

            jchannel = new JChannel();
            jchannel.setReceiver(new ReceiverAdapter() {
                /** {@inheritDoc} */
                @Override
                public void receive(final Message message) {
                    final Object msg = message.getObject();
                    if (msg != null && BroadcastMessage.class.isAssignableFrom(msg.getClass())) {
View Full Code Here

         }

         public synchronized void connect() throws Exception
         {
            if (channel.isConnected()) return;
            channel.setReceiver(new ReceiverAdapter()
            {

               @Override
               public void receive(Message msg)
               {
View Full Code Here

    public void start() throws Exception {
        String props="udp.xml";

        channel=new JChannel(props);

        channel.setReceiver(new ReceiverAdapter() {
            public void viewAccepted(View view) {
                setInternalState(view.getMembers());
            }

            public void setInternalState(java.util.List<Address> mbrs) {
View Full Code Here

TOP

Related Classes of org.jgroups.ReceiverAdapter

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.