Examples of IChannel


Examples of org.eclipse.ecf.datashare.IChannel

    assertNotNull(channelContainer);
  }

  public void testCreateChannel() throws Exception {
    final IChannelContainerAdapter channelContainer = getChannelContainer(0);
    final IChannel channel = channelContainer.createChannel(getNewID(CHANNEL_NAME_1), getIChannelListener(getContainerID(0)), null);
    assertNotNull(channel);
    assertNotNull(channel.getID());
    assertNotNull(channel.getListener());
  }
View Full Code Here

Examples of org.eclipse.ecf.datashare.IChannel

    assertNotNull(channelContainer.getChannelNamespace());
  }

  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

Examples of org.eclipse.ecf.datashare.IChannel

          try {
            channelID = icca.getChannelNamespace().createInstance(new Object[] {Activator.PLUGIN_ID});
          } catch (IDCreateException e1) {
            return null;
          }
          final IChannel channel = icca.getChannel(channelID);
          if (channel == null) {
            return null;
          }
          Object element = ((IStructuredSelection) selection).getFirstElement();
          if (element instanceof ITask) {
            final ITask task = (ITask) element;
            Job job = new Job("Send Task") {
              protected IStatus run(IProgressMonitor monitor) {
                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

Examples of org.eclipse.ecf.datashare.IChannel

    try {
      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

Examples of org.eclipse.ecf.datashare.IChannel

  private IChannel initializeChannelFor(IContainer container) {
    if (container == null)
      return null;
    ID containerID = container.getID();
    IChannel chan = (IChannel) channels.get(containerID);
    if (chan == null) {
      IChannelContainerAdapter adapter = (IChannelContainerAdapter) container
          .getAdapter(IChannelContainerAdapter.class);
      if (adapter != null) {
        chan = createChannel(adapter);
View Full Code Here

Examples of org.eclipse.ecf.datashare.IChannel

  }

  public void dispose() {
    super.dispose();
    for (Iterator i = channels.keySet().iterator(); i.hasNext();) {
      IChannel chan = (IChannel) channels.get(i.next());
      chan.dispose();
    }
    channels.clear();
  }
View Full Code Here

Examples of org.jasig.portal.IChannel

   * Test that CError propogates events to wrapped channels.
   */
  public void testReceiveEvent() {
    EventRecordingChannel irc = new EventRecordingChannel();
   
    IChannel cError = new CError(ErrorCode.GENERAL_ERROR, new Throwable(), "bogusSusbscribeId", irc);
   
    assertTrue(irc.getEventsReceived().isEmpty());

    cError.receiveEvent(PortalEvent.SESSION_DONE_EVENT);
   
    List eventsReceived = irc.getEventsReceived();
    assertFalse(eventsReceived.isEmpty());
    PortalEvent event = (PortalEvent) irc.getEventsReceived().get(0);
    assertEquals(PortalEvent.SESSION_DONE, event.getEventNumber());
View Full Code Here

Examples of org.jasig.portal.IChannel

   */
  public void testReceiveEvent() {
    EventRecordingChannel irc = new EventRecordingChannel();
   
   
    IChannel cSecureInfo = new CSecureInfo("bugusSubId", irc);
   
     
    assertTrue(irc.getEventsReceived().isEmpty());

    cSecureInfo.receiveEvent(PortalEvent.SESSION_DONE_EVENT);
   
    List eventsReceived = irc.getEventsReceived();
    assertFalse(eventsReceived.isEmpty());
    PortalEvent event = (PortalEvent) irc.getEventsReceived().get(0);
    assertEquals(PortalEvent.SESSION_DONE, event.getEventNumber());
View Full Code Here

Examples of org.jasig.portal.IChannel

   */
  public void testReceiveEvent() {
    EventRecordingChannel irc = new EventRecordingChannel();
   
   
    IChannel cSecureInfo = new CSecureInfo("bugusSubId", irc);
   
     
    assertTrue(irc.getEventsReceived().isEmpty());

    cSecureInfo.receiveEvent(PortalEvent.SESSION_DONE_EVENT);
   
    List eventsReceived = irc.getEventsReceived();
    assertFalse(eventsReceived.isEmpty());
    PortalEvent event = (PortalEvent) irc.getEventsReceived().get(0);
    assertEquals(PortalEvent.SESSION_DONE, event.getEventNumber());
View Full Code Here

Examples of org.jasig.portal.IChannel

   * Test that CError propogates events to wrapped channels.
   */
  public void testReceiveEvent() {
    EventRecordingChannel irc = new EventRecordingChannel();
   
    IChannel cError = new CError(ErrorCode.GENERAL_ERROR, new Throwable(), "bogusSusbscribeId", irc);
   
    assertTrue(irc.getEventsReceived().isEmpty());

    cError.receiveEvent(PortalEvent.SESSION_DONE_EVENT);
   
    List eventsReceived = irc.getEventsReceived();
    assertFalse(eventsReceived.isEmpty());
    PortalEvent event = (PortalEvent) irc.getEventsReceived().get(0);
    assertEquals(PortalEvent.SESSION_DONE, event.getEventNumber());
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.