Package org.eclipse.ecf.core.sharedobject

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


    } 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) {
      newID = IDFactory.getDefault().createGUID();
    }
View Full Code Here


  private ISharedObject createSharedObject(SharedObjectTypeDescription sotypedesc, IChannelListener listener) throws SharedObjectCreateException {
    Class clazz;
    try {
      clazz = Class.forName(sotypedesc.getClassName());
    } catch (final ClassNotFoundException e) {
      throw new SharedObjectCreateException("No constructor for shared object of class " + sotypedesc.getClassName(), e);
    }
    Constructor cons = null;
    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);
    }
    return so;
  }
View Full Code Here

      synchronized (monitor) {
        addSharedObject(mgr,id,data,updaterID);
        if (result[0] == null) monitor.wait(getCreationTimeout());
      }
    } catch (InterruptedException e) {
      throw new SharedObjectCreateException(e);
    } finally {
      container.removeListener(listener);
    }
   
   
View Full Code Here

    props.put(INITIAL_DATA_KEY, data);
    props.put(MODEL_UPDATER_KEY, updaterID);
    try {
      mgr.addSharedObject(id, new LocalAgent(), props);
    } catch (SharedObjectAddException e) {
      throw new SharedObjectCreateException(e);
    }   
  }
View Full Code Here

TOP

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

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.