Package org.eclipse.ecf.core.sharedobject

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


  public IMergeableChannel createChannel(IChannelConfig newChannelConfig) throws ECFException {
    final IChannelListener listener = newChannelConfig.getListener();
    final SharedObjectDescription sodesc = new SharedObjectDescription(FeedSharedObject.class, IDFactory.getDefault().createGUID(), new HashMap());
    final SharedObjectTypeDescription sotypedesc = sodesc.getTypeDescription();
    ISharedObject sharedObject = null;
    if (sotypedesc.getName() != null) {
      sharedObject = SharedObjectFactory.getDefault().createSharedObject(sotypedesc, new Object[] {listener});
    } else {
      sharedObject = createSharedObject(sotypedesc, listener);
    }
    final IMergeableChannel channel = (IMergeableChannel) sharedObject.getAdapter(IMergeableChannel.class);
    if (channel == null) {
      throw new SharedObjectCreateException("Cannot coerce object " + channel + " to be of type IChannel");
    }
    ID newID = sodesc.getID();
    if (newID == null) {
View Full Code Here


    try {
      cons = clazz.getDeclaredConstructor(new Class[] {IChannelListener.class});
    } catch (final NoSuchMethodException e) {
      throw new SharedObjectCreateException("No constructor for shared object of class " + sotypedesc.getClassName(), e);
    }
    ISharedObject so = null;
    try {
      so = (ISharedObject) cons.newInstance(new Object[] {listener});
    } catch (final Exception e) {
      throw new SharedObjectCreateException("Cannot create instance of class " + sotypedesc.getClassName(), e);
    }
View Full Code Here

      for (int j = 0; j < clientCount; j++) {
        ISharedObjectContainer scg = sm[j];
        sharedObjects = new ID[sharedObjectClassNames.length];
        for (int i = 0; i < sharedObjectClassNames.length; i++) {
          System.out.println("Creating sharedObject: " + sharedObjectClassNames[i] + " for client " + scg.getID().getName()); //$NON-NLS-1$ //$NON-NLS-2$
          ISharedObject so = (ISharedObject) Class.forName(sharedObjectClassNames[i]).newInstance();
          sharedObjects[i] = IDFactory.getDefault().createStringID(sharedObjectClassNames[i] + "_" + i); //$NON-NLS-1$
          scg.getSharedObjectManager().addSharedObject(sharedObjects[i], so, new HashMap());
          System.out.println("Created sharedObject for client " + scg.getID().getName()); //$NON-NLS-1$
        }
      }
View Full Code Here

    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

    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

    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

    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

    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(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

      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

TOP

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

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.