Examples of ISharedObjectManager


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

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

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

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

     *
     * @see org.eclipse.ecf.sdo.IDataGraphSharingManager#getInstance(org.eclipse.ecf.core.ISharedObjectContainer)
     */
    public synchronized IDataGraphSharing getInstance(
            ISharedObjectContainer container) throws ECFException {
        ISharedObjectManager mgr = container.getSharedObjectManager();
        ID id = IDFactory.getDefault().createStringID(DataGraphSharing.DATA_GRAPH_SHARING_ID);
        DataGraphSharing result = (DataGraphSharing) mgr.getSharedObject(id);
        if (result == null) {
            result = new DataGraphSharing();
            mgr.addSharedObject(id, result, null);
        }

        return result;
    }
View Full Code Here

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

      directoryID = IDFactory.getDefault().createStringID(PublishedServiceDirectory.SHARED_OBJECT_ID);
    } catch (IDCreateException e) {
      throw new RuntimeException(e);
    }
   
    final ISharedObjectManager mgr = container.getSharedObjectManager();
    IPublishedServiceDirectory directory = (IPublishedServiceDirectory) mgr.getSharedObject(directoryID);
    if (directory != null)
      return directory;
   
    try {
      SharedObjectDescription desc = createDirectoryDescription(directoryID);
      mgr.createSharedObject(desc);
      return (IPublishedServiceDirectory) mgr.getSharedObject(directoryID);
    } catch (SharedObjectCreateException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return null;
    }
View Full Code Here

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

      disconnected((IContainerDisconnectedEvent) event);
  }
 
  protected void activated(final ID sharedObjectID) {
    if (sharedObjectID.equals(config.getSharedObjectID())) {
      ISharedObjectManager mgr = config.getContext().getSharedObjectManager();
      if (discoveryAgentID == null) {
        try {
          discoveryAgentID = IDFactory.getDefault().createGUID();
          mgr.createSharedObject(createDiscoveryAgentDescription());
        } catch (ECFException e) {
          // TODO Log me!
          e.printStackTrace();
        }
      }
View Full Code Here

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

        e.printStackTrace();
      }
    } else {
      ArrayList published = new ArrayList();
      ISharedObjectContext ctx = config.getContext();
      ISharedObjectManager mgr = ctx.getSharedObjectManager();
      ID[] ids = mgr.getSharedObjectIDs();
      ID containerID = ctx.getLocalContainerID();
      for (int i = 0; i < ids.length; ++i) {
        Object object = mgr.getSharedObject(ids[i]);
        if (object instanceof IPublishedService) {
          IPublishedService svc = (IPublishedService) object;
          Map props = svc.getProperties();
          published.add(new PublishedServiceDescriptor(containerID, ids[i], props));
        }
View Full Code Here

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

public class PresenceContainerAdapterFactory implements IAdapterFactory {

  public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adapterType.equals(IPresenceContainerAdapter.class)) {
      TCPClientSOContainer container = (TCPClientSOContainer) adaptableObject;
      ISharedObjectManager manager = container.getSharedObjectManager();
      ID[] ids = manager.getSharedObjectIDs();
      for (int i = 0; i < ids.length; i++) {
        ISharedObject object = manager.getSharedObject(ids[i]);
        if (object instanceof EclipseCollabSharedObject) {
          EclipseCollabSharedObject ecso = (EclipseCollabSharedObject) object;
          return ecso.getPresenceContainer();
        }
      }
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.