Package org.eclipse.ecf.datashare

Examples of org.eclipse.ecf.datashare.IChannelContainerAdapter


    setClientCount(2);
    clients = createClients();
    channelID = IDFactory.getDefault().createStringID(CHANNEL_NAME);
    connectClients();
    for (int i = 0; i < clientCount; i++) {
      final IChannelContainerAdapter channelContainer = getChannelContainer(i);
      channelContainer.createChannel(channelID, getIChannelListener(getContainerID(i)), null);
    }
  }
View Full Code Here


  /**
   *
   */
  protected void addChannelToClients() throws Exception {
    for (int i = 0; i < clientCount; i++) {
      final IChannelContainerAdapter channelContainer = getChannelContainer(i);
      channelContainer.createChannel(getNewID(CHANNEL_NAME), getIChannelListener(getContainerID(i)), null);
    }
  }
View Full Code Here

  protected IChannelContainerAdapter getChannelContainer(int clientIndex) {
    return (IChannelContainerAdapter) getClients()[clientIndex].getAdapter(IChannelContainerAdapter.class);
  }

  public void testGetChannelContainerAdapter() throws Exception {
    final IChannelContainerAdapter channelContainer = getChannelContainer(0);
    assertNotNull(channelContainer);
  }
View Full Code Here

    final IChannelContainerAdapter channelContainer = getChannelContainer(0);
    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

    assertNotNull(channel.getID());
    assertNotNull(channel.getListener());
  }

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

    channelContainer.createChannel(getNewID(CHANNEL_NAME_1), getIChannelListener(getContainerID(0)), null);
    assertNotNull(channelContainer.getChannel(getNewID(CHANNEL_NAME_1)));
  }

  public void testGetChannelNamespace() throws Exception {
    final IChannelContainerAdapter channelContainer = getChannelContainer(0);
    assertNotNull(channelContainer.getChannelNamespace());
  }
View Full Code Here

    final IChannelContainerAdapter channelContainer = getChannelContainer(0);
    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

    setTopMenuImageDescriptor(Activator.getDefault().getImageRegistry().getDescriptor("IMG_SHARED_TASK"));
  }

  protected IContributionItem[] createContributionItemsForPresenceContainer(IPresenceContainerAdapter presenceContainerAdapter) {
    // if this IPCA doesn't support the datashare APIs, we should not create any contribution items
    IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) presenceContainerAdapter.getAdapter(IChannelContainerAdapter.class);
    if (channelAdapter == null) {
      return new IContributionItem[0];
    }
    return super.createContributionItemsForPresenceContainer(presenceContainerAdapter);
  }
View Full Code Here

        if (provider == null) {
          return null;
        }
        ISelection selection = provider.getSelection();
        if (selection instanceof IStructuredSelection) {
          IChannelContainerAdapter icca = (IChannelContainerAdapter) rosterEntry.getRoster().getPresenceContainerAdapter().getAdapter(IChannelContainerAdapter.class);
          ID channelID;
          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) {
View Full Code Here

    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);
        channels.put(containerID, chan);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.datashare.IChannelContainerAdapter

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.