use of org.eclipse.ecf.core.sharedobject.ISharedObjectContainer 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());
}
}
}
}
use of org.eclipse.ecf.core.sharedobject.ISharedObjectContainer in project ecf by eclipse.
the class SSLGenericServerContainerGroup method createContainer.
public ISharedObjectContainer createContainer(String path, int keepAlive, Map properties) throws ContainerCreateException {
if (path == null)
// $NON-NLS-1$
throw new ContainerCreateException("Path for new container cannot be null");
Map lock = serverGroup.getMap();
ISharedObjectContainer newContainer = null;
synchronized (lock) {
SSLServerSOContainer existing = (SSLServerSOContainer) lock.get(path);
if (existing != null)
// $NON-NLS-1$ //$NON-NLS-2$
throw new ContainerCreateException("Container with path=" + path + " already exists");
// create container
newContainer = createGenericServerContainer(path, keepAlive, properties);
// add To container manager
addNewContainerToContainerManager(newContainer);
}
return newContainer;
}
Aggregations