Package org.eclipse.ecf.core

Examples of org.eclipse.ecf.core.IContainer.connect()


  }

  public void testListenerConnected() throws Exception {
    final IContainer client = getClients()[0];
    client.addListener(createListener());
    client.connect(createServerID(), null);
    final Object o = clientConnectedEvents.get(0);
    assertTrue(o instanceof IContainerConnectedEvent);
    final IContainerConnectedEvent cco = (IContainerConnectedEvent) o;
    assertTrue(cco.getLocalContainerID().equals(client.getID()));
    assertTrue(cco.getTargetID().equals(createServerID()));
View Full Code Here


  }

  public void testListenerDisconnected() throws Exception {
    final IContainer client = getClients()[0];
    client.addListener(createListener());
    client.connect(createServerID(), null);
    client.disconnect();
    final Object o = clientDisconnectedEvents.get(0);
    assertTrue(o instanceof IContainerDisconnectedEvent);
    final IContainerDisconnectedEvent cco = (IContainerDisconnectedEvent) o;
    assertTrue(cco.getLocalContainerID().equals(client.getID()));
View Full Code Here

  public void testRemoveListener() throws Exception {
    final IContainer client = getClients()[0];
    final IContainerListener l = createListener();
    client.addListener(l);
    client.removeListener(l);
    client.connect(createServerID(), null);
    assertTrue(clientConnectingEvents.size() == 0);
  }

}
View Full Code Here

  protected IContainer createContainer() throws ContainerCreateException,
      ContainerConnectException {
    IContainer container = super.createBasicContainer();
    if (targetId != null) {
      container.connect(targetId, connectContext);
    }
    return container;
  }

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

    ISharedObjectContainer sharedObjectContainer = (ISharedObjectContainer) newClient.getAdapter(ISharedObjectContainer.class);
    SharedObjectContainerUI socui = new SharedObjectContainerUI(this, sharedObjectContainer);
    socui.setup(sharedObjectContainer, newClientEntry, resource, username);
    // Now connect
    try {
      newClient.connect(targetID, ConnectContextFactory.createUsernamePasswordConnectContext(username, connectData));
    } catch (ContainerConnectException e) {
      // If we have a connect exception then we remove any previously
      // added shared object
      EclipseCollabSharedObject so = newClientEntry.getSharedObject();
      if (so != null)
View Full Code Here

      final Collection containersFailedToConnect = new HashSet();
      for (final Iterator itr = containers.iterator(); itr.hasNext();) {
        final IContainer container = (IContainer) itr.next();
        if (container.getConnectedID() == null) {
          try {
            container.connect(targetID, connectContext);
          } catch (ContainerConnectException cce) {
            Trace.catching(Activator.PLUGIN_ID, METHODS_TRACING, this.getClass(), "connect", //$NON-NLS-1$
                cce);
            containersFailedToConnect.add(container);
            continue;
View Full Code Here

  public boolean addContainer(final Object object) {
    // connect the new container if necessary and register ourself as listeners
    IContainer iContainer = (IContainer) object;
    if (iContainer.getConnectedID() == null) {
      try {
        iContainer.connect(targetID, null);
      } catch (ContainerConnectException e) {
        // we eat the exception here
        Trace.catching(Activator.PLUGIN_ID, METHODS_CATCHING, this.getClass(), "addContainer(Object)", e); //$NON-NLS-1$
        return false;
      }
View Full Code Here

      // (IChannelContainerAdapter)
      // container.getAdapter(IChannelContainerAdapter.class);

      // Connect
      ID targetID = IDFactory.getDefault().createID(container.getConnectNamespace(), "myid");
      container.connect(targetID, null);

    } catch (ECFException 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.