Package org.eclipse.ecf.core.sharedobject

Examples of org.eclipse.ecf.core.sharedobject.ISharedObjectManager


      public void refresh() {
        System.out.println("joinPolicy.refresh()");
      }
    });
    // Setup add shared object policy
    final ISharedObjectManager manager = server.getSharedObjectManager();
    manager.setRemoteAddPolicy(new ISharedObjectPolicy() {
      public PermissionCollection checkAddSharedObject(ID fromID, ID toID, ID localID, ReplicaSharedObjectDescription newObjectDescription) throws SecurityException {
        System.out.println("ADDSHAREDOBJECT From=" + fromID + ";To=" + toID + ";SharedObjectDesc=" + newObjectDescription);
        return null;
      }
View Full Code Here


    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);
  }
View Full Code Here

    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);
  }
View Full Code Here

  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);
  }
View Full Code Here

  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);
  }
View Full Code Here

    super.tearDown();
    cleanUpServerAndClients();
  }

  public void testAddSharedObject() throws Exception {
    final ISharedObjectManager manager = getClientSOManager(0);
    assertNotNull(manager);
    final ID id = manager.addSharedObject(IDFactory.getDefault()
        .createStringID("foo"), new TestSharedObject(TEST_USERNAME0),
        null);
    assertNotNull(id);
    final ISharedObject sharedObject = manager.getSharedObject(id);
    assertNotNull(sharedObject);
    sleep(1000);
  }
View Full Code Here

    assertNotNull(sharedObject);
    sleep(1000);
  }

  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);
  }
View Full Code Here

  public static SharedModelFactory getInstance() {
    return INSTANCE;
  }

  public IMasterModel createSharedDataSource(ISharedObjectContainer container, final ID id, Object data, String updaterID) throws SharedObjectCreateException {
    final ISharedObjectManager mgr = container.getSharedObjectManager();
    final Object[] result = new Object[1];
    final Object monitor = new Object();
   
    IContainerListener listener = new IContainerListener() {
      public void handleEvent(IContainerEvent event) {
        if (event instanceof ISharedObjectActivatedEvent) {
          ISharedObjectActivatedEvent e = (ISharedObjectActivatedEvent) event;
          if (e.getActivatedID().equals(id)) {
            result[0] = mgr.getSharedObject(id);
            synchronized (monitor) {
              monitor.notify();
            }
          }
        }
View Full Code Here

      }

      return;
    }
   
    ISharedObjectManager mgr = ctx.getSharedObjectManager();
    ISharedObject so = mgr.getSharedObject(sharedObjectID);
    try {
      ID homeContainerID = config.getHomeContainerID();
      if (so instanceof IPublishedService) {
        IPublishedService svc = (IPublishedService) so;
        svc.subscribe(homeContainerID, config.getSharedObjectID());
View Full Code Here

        if (config == null)
            throw new ECFException("Not initialized.");

        // create local object
        ISharedObjectManager mgr = config.getContext().getSharedObjectManager();
        SharedDataGraph sdg = new SharedDataGraph(dataGraph, provider,
                consumer, callback, null);
        mgr.addSharedObject(id, sdg, null);
        return sdg;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.core.sharedobject.ISharedObjectManager

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.