Search in sources :

Example 1 with SharedObjectAddException

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

the class XMPPContainer method connect.

/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.ecf.provider.generic.ClientSOContainer#connect(org.eclipse
	 * .ecf.core.identity.ID, org.eclipse.ecf.core.security.IConnectContext)
	 */
public void connect(ID remote, IConnectContext joinContext) throws ContainerConnectException {
    try {
        getSharedObjectManager().addSharedObject(presenceHelperID, presenceHelper, null);
        super.connect(remote, joinContext);
        XmppPlugin.getDefault().registerService(this);
    } catch (final ContainerConnectException e) {
        disconnect();
        throw e;
    } catch (final SharedObjectAddException e1) {
        disconnect();
        throw new ContainerConnectException(NLS.bind(Messages.XMPPContainer_EXCEPTION_ADDING_SHARED_OBJECT, presenceHelperID), e1);
    }
}
Also used : SharedObjectAddException(org.eclipse.ecf.core.sharedobject.SharedObjectAddException) ContainerConnectException(org.eclipse.ecf.core.ContainerConnectException)

Example 2 with SharedObjectAddException

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

the class SharedModelFactory method addSharedObject.

protected void addSharedObject(ISharedObjectManager mgr, ID id, Object data, String updaterID) throws SharedObjectCreateException {
    HashMap props = new HashMap(2);
    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);
    }
}
Also used : LocalAgent(org.eclipse.ecf.pubsub.model.impl.LocalAgent) SharedObjectAddException(org.eclipse.ecf.core.sharedobject.SharedObjectAddException) HashMap(java.util.HashMap) SharedObjectCreateException(org.eclipse.ecf.core.sharedobject.SharedObjectCreateException)

Aggregations

SharedObjectAddException (org.eclipse.ecf.core.sharedobject.SharedObjectAddException)2 HashMap (java.util.HashMap)1 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)1 SharedObjectCreateException (org.eclipse.ecf.core.sharedobject.SharedObjectCreateException)1 LocalAgent (org.eclipse.ecf.pubsub.model.impl.LocalAgent)1