Package org.jboss.narayana.blacktie.jatmibroker.core.transport

Examples of org.jboss.narayana.blacktie.jatmibroker.core.transport.Sender


    AtmiBrokerEnvXML xml = new AtmiBrokerEnvXML();
    Properties properties = xml.getProperties();

    TransportFactory factory = new TransportFactory(properties);
    Transport proxy = factory.createTransport();
    Sender serviceFactory = proxy.getSender("BAR", false);

    String aString = "Hello from Java Land";
    Receiver endpoint = proxy.createReceiver(1, null);
    serviceFactory.send(endpoint.getReplyTo(), (short) 0, 0,
        aString.getBytes(), aString.getBytes().length, 0, 0, 0,
        "X_OCTET", "");
    Message receive = endpoint.receive(0);

    assertNotNull(receive);
View Full Code Here


    if (conversationalMap == null) {
      conversationalMap = new HashMap<String, Sender>();
      senders.put(conversational, conversationalMap);
    }

    Sender toReturn = conversationalMap.get(serviceName);
    if (toReturn == null) {
      try {
        String type = (String) properties.get(
            "blacktie." + serviceName + ".type");
        toReturn = new StompSenderImpl(momManagement, serviceName,
View Full Code Here

  }

  public void test() throws ConnectionException, IOException {
    Receiver serviceDispatcher = serviceTransport.getReceiver(
        "JAVA_Converse", false);
    Sender clientSender = clientTransport.getSender("JAVA_Converse", false);
    Receiver clientReceiver = clientTransport.createReceiver(1, null);
    clientSender.send(clientReceiver.getReplyTo(), (short) 1, 1,
        "hi".getBytes(), 2, 0, 0, 0, "X_OCTET", null);
    Message receive = serviceDispatcher.receive(0);
    receive.ack();
    assertTrue(receive.len == 2);

    Sender serviceSender = serviceTransport.createSender(receive.replyTo);
    Receiver serviceReceiver = serviceTransport.createReceiver(1, null);

    log.info("Chatting");
    for (int i = 0; i < 100; i++) {
      String toSend = String.valueOf(i);
      serviceSender.send(serviceReceiver.getReplyTo(), (short) 1, 1,
          toSend.getBytes(), toSend.length(), 0, 0, 0, "X_OCTET",
          null);
      Message receive2 = clientReceiver.receive(0);
      assertTrue(receive2.len == toSend.length());
      String received = new String(receive2.data);
View Full Code Here

TOP

Related Classes of org.jboss.narayana.blacktie.jatmibroker.core.transport.Sender

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.