examples.message.assyncpingpong01
Class Ping

java.lang.Object
  extended by examples.message.assyncpingpong01.Ping
All Implemented Interfaces:
ISourceMessage

public class Ping
extends java.lang.Object
implements ISourceMessage

This class creates client Ping and implements ISourceMessage own free attributes


Constructor Summary
Ping(IMessageFactory factory, IBroker broker, IAssyncReceiver thePong)
          Constructor default receives the parameters below:
 
Method Summary
 void start()
          This method initializes a creating message and send through of the broker
public void start() { System.out.println("ping"); IMessage message = factory.createMessage("ping", this); broker.dispatchAssyncMessage(thePong, message); }
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ping

public Ping(IMessageFactory factory,
            IBroker broker,
            IAssyncReceiver thePong)
Constructor default receives the parameters below:

Parameters:
factory - This parameter of the type IMessageFactory.
broker - This parameter of the type IBroker.
thePong - This parameter of the type IAssyncReceiver.
 public Ping(IMessageFactory factory, IBroker broker,
                IAssyncReceiver thePong)
    {
        this.factory = factory;
        this.broker = broker;
        this.thePong = thePong;
    }
 
Method Detail

start

public void start()
This method initializes a creating message and send through of the broker
public void start()
    {
        System.out.println("ping");
        IMessage message = factory.createMessage("ping", this);

        broker.dispatchAssyncMessage(thePong, message);
    }
 



Copyright © 2007. All Rights Reserved.