Search in sources :

Example 11 with IContainer

use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.

the class SimpleConcatClient method start.

public void start(int port) throws Exception {
    IContainer client = ContainerFactory.getDefault().createContainer(CLIENT_TYPE);
    // Get adapter for accessing remote services
    IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) client.getAdapter(IRemoteServiceContainerAdapter.class);
    rsContainer = new RemoteServiceContainer(client, adapter);
    System.out.println("Client created with ID=" + client.getID());
    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);
    // Get remote service reference
    IRemoteServiceReference[] refs = adapter.getRemoteServiceReferences((ID[]) null, IConcatService.class.getName(), null);
    rsReference = refs[0];
    System.out.println("Remote service with ref=" + refs[0]);
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IConcatService(org.eclipse.ecf.tests.remoteservice.IConcatService) RemoteServiceContainer(org.eclipse.ecf.remoteservice.RemoteServiceContainer) IRemoteServiceContainer(org.eclipse.ecf.remoteservice.IRemoteServiceContainer) IRemoteServiceContainerAdapter(org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter) ID(org.eclipse.ecf.core.identity.ID) IContainer(org.eclipse.ecf.core.IContainer)

Example 12 with IContainer

use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.

the class ROsgiConcatConsumerTest method setUp.

protected void setUp() throws Exception {
    super.setUp();
    IContainer container = createContainer("r-osgi://localhost:9279");
    rsContainer = createRemoteServiceContainer(container);
    targetID = createID(container, R_OSGi.HOST_CONTAINER_ENDPOINT_ID);
}
Also used : IContainer(org.eclipse.ecf.core.IContainer)

Example 13 with IContainer

use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.

the class SSLClientContainerConnectTest method testListenerConnecting.

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()));
    assertTrue(cco.getData() == null);
}
Also used : IContainerConnectingEvent(org.eclipse.ecf.core.events.IContainerConnectingEvent) IContainer(org.eclipse.ecf.core.IContainer)

Example 14 with IContainer

use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.

the class SSLClientContainerConnectTest method testGetConnectedID.

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());
}
Also used : IContainer(org.eclipse.ecf.core.IContainer)

Example 15 with IContainer

use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.

the class SSLClientContainerConnectTest method testListenerDisconnected.

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()));
    assertTrue(cco.getTargetID().equals(createServerID()));
}
Also used : IContainerDisconnectedEvent(org.eclipse.ecf.core.events.IContainerDisconnectedEvent) IContainer(org.eclipse.ecf.core.IContainer)

Aggregations

IContainer (org.eclipse.ecf.core.IContainer)121 ID (org.eclipse.ecf.core.identity.ID)29 ContainerTypeDescription (org.eclipse.ecf.core.ContainerTypeDescription)20 IRosterEntry (org.eclipse.ecf.presence.roster.IRosterEntry)9 IRoster (org.eclipse.ecf.presence.roster.IRoster)8 IChannelContainerAdapter (org.eclipse.ecf.datashare.IChannelContainerAdapter)7 IRemoteServiceContainer (org.eclipse.ecf.remoteservice.IRemoteServiceContainer)7 IRemoteServiceContainerAdapter (org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter)7 ISharedObjectContainer (org.eclipse.ecf.core.sharedobject.ISharedObjectContainer)5 IPresenceContainerAdapter (org.eclipse.ecf.presence.IPresenceContainerAdapter)5 RemoteServiceContainer (org.eclipse.ecf.remoteservice.RemoteServiceContainer)5 Action (org.eclipse.jface.action.Action)5 IAction (org.eclipse.jface.action.IAction)5 URL (java.net.URL)4 Job (org.eclipse.core.runtime.jobs.Job)4 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)4 IContainerManager (org.eclipse.ecf.core.IContainerManager)4 ISharedObject (org.eclipse.ecf.core.sharedobject.ISharedObject)4 ISharedObjectManager (org.eclipse.ecf.core.sharedobject.ISharedObjectManager)4 RestClientContainer (org.eclipse.ecf.remoteservice.rest.client.RestClientContainer)4