Package org.eclipse.ecf.core

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


      // make container instance
      IContainer cont = ContainerFactory.getDefault().createContainer("ecf.twitter");
      // make targetID      
      ID targetID;
      targetID = IDFactory.getDefault().createID(cont.getConnectNamespace(),"http://twitter.com/savino2");
      cont.connect(targetID,null);
    } catch (IDCreateException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ContainerConnectException e) {
      // TODO Auto-generated catch block
View Full Code Here


      // make container instance
      IContainer cont = ContainerFactory.getDefault().createContainer("ecf.twitter");
      // make targetID
      ID targetID;
      targetID = IDFactory.getDefault().createID(cont.getConnectNamespace(),"savino2");
      cont.connect(targetID,null);
    } catch (IDCreateException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ContainerConnectException e) {
      // TODO Auto-generated catch block
View Full Code Here

      // make container instance
      IContainer cont = ContainerFactory.getDefault().createContainer("ecf.twitter");
      // make targetID
      ID targetID;
      targetID = IDFactory.getDefault().createID(cont.getConnectNamespace(),"savino2");
      cont.connect(targetID,null);
    } catch (IDCreateException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ContainerConnectException e) {
      // TODO Auto-generated catch block
View Full Code Here

    // decouple the long running connect call from the ui thread
    return new Job(NLS.bind("Connecting {0}", createConnectId.getName())) {
      protected IStatus run(IProgressMonitor monitor) {
        try {
          if (container != null)
            container.connect(createConnectId, null);
        } catch (ContainerConnectException e) {
          showException(e);
          return Status.CANCEL_STATUS;
        }
        return Status.OK_STATUS;
View Full Code Here

    IContainer container = createRestContainer(RestConstants.TEST_DE_TARGET);
    ID connectedID = container.getConnectedID();
    ID targetID = createRestID(new URL(
          RestConstants.TEST_TWITTER_TARGET));
    assertNotNull(targetID);
    container.connect(targetID, null);
    connectedID = container.getConnectedID();
    assertEquals(targetID, connectedID);
  }

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

    ID connectTargetID = IDFactory.getDefault().createStringID(
        NLS.bind(SERVER_ID, new Integer(port)));
   
    System.out.println("Attempting connect to id="+connectTargetID);
    client.connect(connectTargetID, null);
    System.out.println("Client connected to connectTargetID="
        + connectTargetID);

    Thread.sleep(1000);
   
View Full Code Here

    ID connectTargetID = IDFactory.getDefault().createStringID(
        NLS.bind(SERVER_ID, new Integer(port)));
   
    System.out.println("Attempting connect to id="+connectTargetID);
    client.connect(connectTargetID, null);
    System.out.println("Client connected to connectTargetID="
        + connectTargetID);

    Thread.sleep(1000);
   
View Full Code Here

  }

  public void testGetConnectedID() throws Exception {
    final IContainer client = getClients()[0];
    assertNull(client.getConnectedID());
    client.connect(createServerID(), null);
    assertNotNull(client.getConnectedID());
    client.disconnect();
    assertNull(client.getConnectedID());
  }
View Full Code Here

  public void testClientListener() throws Exception {
    final IContainer client = getClients()[0];
    client.addListener(createListener());
    assertTrue(clientConnectingEvents.size() == 0);
    assertTrue(clientConnectedEvents.size() == 0);
    client.connect(createServerID(), null);
    assertTrue(clientConnectingEvents.size() == 1);
    assertTrue(clientConnectedEvents.size() == 1);
    assertTrue(clientDisconnectingEvents.size() == 0);
    assertTrue(clientDisconnectedEvents.size() == 0);
    sleep(2000);
View Full Code Here

  }

  public void testListenerConnecting() throws Exception {
    final IContainer client = getClients()[0];
    client.addListener(createListener());
    client.connect(createServerID(), null);
    final Object o = clientConnectingEvents.get(0);
    assertTrue(o instanceof IContainerConnectingEvent);
    final IContainerConnectingEvent cco = (IContainerConnectingEvent) o;
    assertTrue(cco.getLocalContainerID().equals(client.getID()));
    assertTrue(cco.getTargetID().equals(createServerID()));
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.