Skip to main content

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

I think I can answer this one! Failed to call
DistributedEventAdmin.start() on the client side. This is necessary to
enable the DistributedEventAdmin to track the registered EventHandlers

Nearly there now.

Robert

On Tue, Nov 2, 2010 at 8:25 AM, Robert Onslow <ronslow@xxxxxxxxxxxx> wrote:
> Scott
> That's great. Thank you.
>
> In the client, I connected the client container to the server,
> listening for the connection, and when connected, added the
> DistributedEventAdmin to the SharedObjectManager
>
> container.addListener(new IContainerListener() {
> @Override
>  public void handleEvent(IContainerEvent event) {
>        if (event instanceof IContainerConnectedEvent)
>                        try {
>                        manager.addSharedObject(id1, (ISharedObject) admin, props)
>                        } catch (SharedObjectAddException e) {
>                                                                                                                Log.log(Log.ERROR, e.getMessage());
>
>        }
> }
>
>
> });
> container.connect(id, null);
>
> Now, when I debug a postEvent on the DistributedEventAdmin on the
> server,  I see that the SharedObjectContext on the server is
> recognising the existence of the client, and is  successfully queuing
> a SharedObject message, destined for the DistributedEventAdmin on the
> client.
>
> I am not sure that the message is actually being sent and dequeued
> from the SharedObjectContext. It is not being received at the client.
> Is there a thread somewhere which is responsible for this e.g. in a
> bundle, which I have failed to start, on the server?
>
> Robert
>
> On Mon, Nov 1, 2010 at 10:54 PM, Scott Lewis <slewis@xxxxxxxxxxxxx> wrote:
>> Hi Robert,
>>
>> On 11/1/2010 3:25 PM, Robert Onslow wrote:
>>>
>>> Aha Scott, yes I'm getting there ..
>>>
>>> So presumably I manually create a DistributedEventAdmin on each client
>>> as well as on the server. How do I go on to specify that the the
>>> object on the client is a replica of the object on the server?
>>
>> All that's necessary to do this is to have the shared object IDs be the same
>> wherever they are created/added.  One way to do this is to just use the
>> classname as the shared object ID...e.g.
>>
>> ID sharedObjectID =
>> IDFactory.getDefault().createStringID(DistributedEventAdmin.class.getName());
>> sharedObjectManager.addSharedObject(sharedObjectID, new
>> DistributedEventAdmin(), null);
>>
>> Another option for the Distributed EventAdmin is to use the topic that the
>> eventadmin is responsible for.
>>
>> Scott
>>
>>
>> _______________________________________________
>> ecf-dev mailing list
>> ecf-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/ecf-dev
>>
>
>
>
> --
> Robert Onslow
> XLegal Limited
>



-- 
Robert Onslow
XLegal Limited


Back to the top