Package org.eclipse.ecf.datashare

Examples of org.eclipse.ecf.datashare.IChannel.sendMessage()


  }

  public void testSendMessage() throws Exception {
    final IChannel ch0 = getChannelContainer(0).getChannel(channelID);
    ID target1 = getClient(1).getConnectedID();
    ch0.sendMessage(target1, new String("hello").getBytes());
    sleep(SLEEPTIME);
  }

  public void testBiSendMessage() throws Exception {
    final IChannel ch0 = getChannelContainer(0).getChannel(channelID);
View Full Code Here


   
    ID target1 = getClient(1).getConnectedID();
    ID target0 = getClient(0).getConnectedID();
   
    ch0.sendMessage(target1, new String("hello").getBytes());
    ch1.sendMessage(target0, new String("hello").getBytes());
    sleep(SLEEPTIME);
  }


  public void testSendMessages() throws Exception {
View Full Code Here

  public void testSendMessages() throws Exception {
    final IChannel ch0 = getChannelContainer(0).getChannel(channelID);
    ID target1 = getClient(1).getConnectedID();
    for(int i=0; i < SEND_MESSAGE_COUNT; i++) {
      ch0.sendMessage(target1, new String("hello.  msg#="+i).getBytes());
    }
    sleep(SLEEPTIME);
  }

  public void testBiSendMessages() throws Exception {
View Full Code Here

    ID target1 = getClient(1).getConnectedID();
    ID target0 = getClient(0).getConnectedID();
       
    for(int i=0; i < SEND_MESSAGE_COUNT; i++) {
      ch0.sendMessage(target1, new String("hello.  msg#="+i).getBytes());
      ch1.sendMessage(target0, new String("hello.  msg#="+i).getBytes());
    }
    sleep(SLEEPTIME);
  }

  protected IChannelListener getIChannelListener(final ID containerid) throws Exception {
View Full Code Here

  public void testSender() throws Exception {
    final IChannelContainerAdapter senderContainer = getChannelContainer(0);
    final IChannel sender = senderContainer.getChannel(getNewID(CHANNEL_NAME));
    assertNotNull(sender);
    sender.sendMessage(new String("hello").getBytes());
    sleep(3000);
    for (int i = 1; i < getClientCount(); i++) {
      assertNotNull(messageEvents.get(getContainerID(i)));
    }
  }
View Full Code Here

                monitor.beginTask("Sending task...", 5);
                ByteArrayOutputStream stream = new ByteArrayOutputStream();
                TasksUiPlugin.getTaskListManager().getTaskListWriter().writeTask((AbstractTask) task, stream);
                monitor.worked(2);
                try {
                  channel.sendMessage(getRosterEntry().getUser().getID(), stream.toByteArray());
                  monitor.worked(3);
                } catch (Exception e) {
                  return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "An error occurred while sending the task.", e);
                } finally {
                  monitor.done();
View Full Code Here

      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(bos);
      oos.writeObject(new String[] { "Hi " + rosterEntry.getName(),
          "http://www.eclipse.org/ecf" });
      IChannel channel = initializeChannelFor(getContainerForRosterEntry(rosterEntry));
      channel.sendMessage(rosterEntry.getUser().getID(), bos
          .toByteArray());
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.