Search in sources :

Example 6 with ISharedObjectManager

use of org.eclipse.ecf.core.sharedobject.ISharedObjectManager in project ecf by eclipse.

the class AbstractChatRoomSOAddTest method testAddTwoSharedObjects.

public void testAddTwoSharedObjects() throws Exception {
    if (chatRoomContainer[0] == null)
        return;
    final IContainer client0Container = chatRoomContainer[0];
    assertNotNull(client0Container);
    final ISharedObjectContainer socontainer = (ISharedObjectContainer) client0Container.getAdapter(ISharedObjectContainer.class);
    final ISharedObjectManager manager = socontainer.getSharedObjectManager();
    assertNotNull(manager);
    final ID objectID0 = createSharedObjectID();
    final ID id0 = manager.addSharedObject(objectID0, createSharedObject(objectID0), null);
    assertNotNull(id0);
    final ID objectID1 = createSharedObjectID();
    final ID id1 = manager.addSharedObject(objectID1, createSharedObject(objectID1), null);
    assertNotNull(id1);
    final ISharedObject sharedObject0 = manager.getSharedObject(id0);
    assertNotNull(sharedObject0);
    final ISharedObject sharedObject1 = manager.getSharedObject(id1);
    assertNotNull(sharedObject1);
    sleep(5000);
}
Also used : ISharedObjectContainer(org.eclipse.ecf.core.sharedobject.ISharedObjectContainer) ISharedObjectManager(org.eclipse.ecf.core.sharedobject.ISharedObjectManager) ID(org.eclipse.ecf.core.identity.ID) ISharedObject(org.eclipse.ecf.core.sharedobject.ISharedObject) IContainer(org.eclipse.ecf.core.IContainer)

Example 7 with ISharedObjectManager

use of org.eclipse.ecf.core.sharedobject.ISharedObjectManager in project ecf by eclipse.

the class AbstractChatRoomSOAddTest method testAddSharedObject1.

public void testAddSharedObject1() throws Exception {
    if (chatRoomContainer[0] == null)
        return;
    final IContainer client0Container = chatRoomContainer[1];
    assertNotNull(client0Container);
    // 
    final ISharedObjectContainer socontainer = (ISharedObjectContainer) client0Container.getAdapter(ISharedObjectContainer.class);
    final ISharedObjectManager manager = socontainer.getSharedObjectManager();
    assertNotNull(manager);
    final ID objectID = createSharedObjectID();
    final ID id = manager.addSharedObject(objectID, createSharedObject(objectID), null);
    assertNotNull(id);
    final ISharedObject sharedObject = manager.getSharedObject(id);
    assertNotNull(sharedObject);
    sleep(5000);
}
Also used : ISharedObjectContainer(org.eclipse.ecf.core.sharedobject.ISharedObjectContainer) ISharedObjectManager(org.eclipse.ecf.core.sharedobject.ISharedObjectManager) ID(org.eclipse.ecf.core.identity.ID) ISharedObject(org.eclipse.ecf.core.sharedobject.ISharedObject) IContainer(org.eclipse.ecf.core.IContainer)

Example 8 with ISharedObjectManager

use of org.eclipse.ecf.core.sharedobject.ISharedObjectManager in project ecf by eclipse.

the class AbstractChatRoomSOAddTest method testAddSharedObject.

public void testAddSharedObject() throws Exception {
    if (chatRoomContainer[0] == null)
        return;
    final IContainer client0Container = chatRoomContainer[0];
    assertNotNull(client0Container);
    // 
    final ISharedObjectContainer socontainer = (ISharedObjectContainer) client0Container.getAdapter(ISharedObjectContainer.class);
    final ISharedObjectManager manager = socontainer.getSharedObjectManager();
    assertNotNull(manager);
    final ID objectID = createSharedObjectID();
    final ID id = manager.addSharedObject(objectID, createSharedObject(objectID), null);
    assertNotNull(id);
    final ISharedObject sharedObject = manager.getSharedObject(id);
    assertNotNull(sharedObject);
    sleep(5000);
}
Also used : ISharedObjectContainer(org.eclipse.ecf.core.sharedobject.ISharedObjectContainer) ISharedObjectManager(org.eclipse.ecf.core.sharedobject.ISharedObjectManager) ID(org.eclipse.ecf.core.identity.ID) ISharedObject(org.eclipse.ecf.core.sharedobject.ISharedObject) IContainer(org.eclipse.ecf.core.IContainer)

Example 9 with ISharedObjectManager

use of org.eclipse.ecf.core.sharedobject.ISharedObjectManager in project ecf by eclipse.

the class AbstractChatRoomSOAddTest method testAddTwoSharedObjects1.

public void testAddTwoSharedObjects1() throws Exception {
    if (chatRoomContainer[0] == null)
        return;
    final IContainer client0Container = chatRoomContainer[1];
    assertNotNull(client0Container);
    final ISharedObjectContainer socontainer = (ISharedObjectContainer) client0Container.getAdapter(ISharedObjectContainer.class);
    final ISharedObjectManager manager = socontainer.getSharedObjectManager();
    assertNotNull(manager);
    final ID objectID0 = createSharedObjectID();
    final ID id0 = manager.addSharedObject(objectID0, createSharedObject(objectID0), null);
    assertNotNull(id0);
    final ID objectID1 = createSharedObjectID();
    final ID id1 = manager.addSharedObject(objectID1, createSharedObject(objectID1), null);
    assertNotNull(id1);
    final ISharedObject sharedObject0 = manager.getSharedObject(id0);
    assertNotNull(sharedObject0);
    final ISharedObject sharedObject1 = manager.getSharedObject(id1);
    assertNotNull(sharedObject1);
    sleep(5000);
}
Also used : ISharedObjectContainer(org.eclipse.ecf.core.sharedobject.ISharedObjectContainer) ISharedObjectManager(org.eclipse.ecf.core.sharedobject.ISharedObjectManager) ID(org.eclipse.ecf.core.identity.ID) ISharedObject(org.eclipse.ecf.core.sharedobject.ISharedObject) IContainer(org.eclipse.ecf.core.IContainer)

Example 10 with ISharedObjectManager

use of org.eclipse.ecf.core.sharedobject.ISharedObjectManager in project ecf by eclipse.

the class AddSharedObjectTest method testAddTwoSharedObjects.

public void testAddTwoSharedObjects() throws Exception {
    final ISharedObjectManager manager = getClientSOManager(0);
    assertNotNull(manager);
    final ID id0 = manager.addSharedObject(IDFactory.getDefault().createStringID("foo0"), new TestSharedObject(TEST_USERNAME0), null);
    assertNotNull(id0);
    final ID id1 = manager.addSharedObject(IDFactory.getDefault().createStringID("foo1"), new TestSharedObject(TEST_USERNAME1), null);
    assertNotNull(id1);
    final ISharedObject sharedObject0 = manager.getSharedObject(id0);
    assertNotNull(sharedObject0);
    final ISharedObject sharedObject1 = manager.getSharedObject(id1);
    assertNotNull(sharedObject1);
    sleep(1000);
}
Also used : ISharedObjectManager(org.eclipse.ecf.core.sharedobject.ISharedObjectManager) ID(org.eclipse.ecf.core.identity.ID) ISharedObject(org.eclipse.ecf.core.sharedobject.ISharedObject)

Aggregations

ISharedObjectManager (org.eclipse.ecf.core.sharedobject.ISharedObjectManager)13 ID (org.eclipse.ecf.core.identity.ID)11 ISharedObject (org.eclipse.ecf.core.sharedobject.ISharedObject)9 IContainer (org.eclipse.ecf.core.IContainer)4 ISharedObjectContainer (org.eclipse.ecf.core.sharedobject.ISharedObjectContainer)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)2 ISharedObjectContext (org.eclipse.ecf.core.sharedobject.ISharedObjectContext)2 ReplicaSharedObjectDescription (org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription)2 SharedObjectCreateException (org.eclipse.ecf.core.sharedobject.SharedObjectCreateException)2 IPublishedService (org.eclipse.ecf.pubsub.IPublishedService)2 URISyntaxException (java.net.URISyntaxException)1 PermissionCollection (java.security.PermissionCollection)1 List (java.util.List)1 Map (java.util.Map)1 PlatformObject (org.eclipse.core.runtime.PlatformObject)1 IContainerListener (org.eclipse.ecf.core.IContainerListener)1 IContainerEvent (org.eclipse.ecf.core.events.IContainerEvent)1 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)1 IConnectHandlerPolicy (org.eclipse.ecf.core.security.IConnectHandlerPolicy)1