Search in sources :

Example 11 with ISharedObject

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

the class ClientApplication method createSharedObjects.

public void createSharedObjects() throws Exception {
    if (sharedObjectClassNames != null) {
        for (int j = 0; j < clientCount; j++) {
            ISharedObjectContainer scg = sm[j];
            sharedObjects = new ID[sharedObjectClassNames.length];
            for (int i = 0; i < sharedObjectClassNames.length; i++) {
                // $NON-NLS-1$ //$NON-NLS-2$
                System.out.println("Creating sharedObject: " + sharedObjectClassNames[i] + " for client " + scg.getID().getName());
                ISharedObject so = (ISharedObject) Class.forName(sharedObjectClassNames[i]).newInstance();
                // $NON-NLS-1$
                sharedObjects[i] = IDFactory.getDefault().createStringID(sharedObjectClassNames[i] + "_" + i);
                scg.getSharedObjectManager().addSharedObject(sharedObjects[i], so, new HashMap());
                // $NON-NLS-1$
                System.out.println("Created sharedObject for client " + scg.getID().getName());
            }
        }
    }
}
Also used : HashMap(java.util.HashMap) ISharedObjectContainer(org.eclipse.ecf.core.sharedobject.ISharedObjectContainer) ISharedObject(org.eclipse.ecf.core.sharedobject.ISharedObject)

Aggregations

ISharedObject (org.eclipse.ecf.core.sharedobject.ISharedObject)11 ID (org.eclipse.ecf.core.identity.ID)9 ISharedObjectManager (org.eclipse.ecf.core.sharedobject.ISharedObjectManager)8 ISharedObjectContainer (org.eclipse.ecf.core.sharedobject.ISharedObjectContainer)5 IContainer (org.eclipse.ecf.core.IContainer)4 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 SharedObjectCreateException (org.eclipse.ecf.core.sharedobject.SharedObjectCreateException)2 IChannelListener (org.eclipse.ecf.datashare.IChannelListener)2 Constructor (java.lang.reflect.Constructor)1 Map (java.util.Map)1 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)1 StringID (org.eclipse.ecf.core.identity.StringID)1 ISharedObjectContext (org.eclipse.ecf.core.sharedobject.ISharedObjectContext)1 SharedObjectDescription (org.eclipse.ecf.core.sharedobject.SharedObjectDescription)1 SharedObjectTypeDescription (org.eclipse.ecf.core.sharedobject.SharedObjectTypeDescription)1 ECFException (org.eclipse.ecf.core.util.ECFException)1 IMergeableChannel (org.eclipse.ecf.datashare.mergeable.IMergeableChannel)1 EclipseCollabSharedObject (org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject)1 ConnectionCreateException (org.eclipse.ecf.provider.comm.ConnectionCreateException)1