Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] ISharedObjectObjectContainer problem client side - SharedObjects not found

Dear All

I am using ECF 3.3 and the DistributedEventAdmin service. On the
server side, I have successfully added the service to the
ISharedObjectManager:

//wait for a container manager to come online
containerTracker = new ServiceTracker(context,
IContainerManager.class.getName(), new ServiceTrackerCustomizer() {

			@Override
			public Object addingService(ServiceReference arg0) {
				IContainerManager manager = (IContainerManager) context.getService(arg0);
				try {
					EventAdmin admin = new DistributedEventAdmin(context);
					
					
					final IContainer container =
manager.getContainerFactory().createContainer("ecf.generic.server");
					final ISharedObjectContainer sharedObjectContainer =
(ISharedObjectContainer)
container.getAdapter(ISharedObjectContainer.class);
					
					ISharedObjectManager manager1 =
sharedObjectContainer.getSharedObjectManager();
					
					Properties props = new Properties();
					props.put(EventConstants.EVENT_TOPIC, "uk_co_xlegal_xbundle3_remote");
					manager1.addSharedObject(IDFactory.getDefault().createStringID("uk.co.xlegal.xbundle3.remote"),
(ISharedObject) admin, props);
					
...

I have also successfully advertised the info representing the server
sharedobjectcontainer using the IDiscoveryAdvertiser

On the client side, I have successfully found the info using
IDiscoveryLocator, created a client ecf container and connected it to
the server

I have received an IContainerConnectedEvent in IContainerListener.handleEvent

However, when I query the IDs of the services within the shared object
container, I find an empty array:


//this is fine
ISharedObjectContainer soc = (ISharedObjectContainer) ((IAdaptable)
container).getAdapter(ISharedObjectContainer.class);
													
//yup, picks up the manager OK
													
ISharedObjectManager manager = soc.getSharedObjectManager();

//oh dear, I find ids is an empty array
													
ID[] ids = manager.getSharedObjectIDs();
												
Am I missing a step here?

Robert

ps thanks for a fantastic framework.

-- 
Robert Onslow
XLegal Limited


Back to the top