Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Communications Framework (ECF) » A Message-sent handler proposal
A Message-sent handler proposal [message #612045] Tue, 23 January 2007 15:24 Go to next message
antonio is currently offline antonioFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,
working with ECF on my application, i need to handle send/receive messages of the shared objects for tracing all the messages that are received and sent from/to all the others shared objects; to handle received messages I can add a IEventProcessor, but I don't find any mechanism to handle the event that my shared object sent a message.
So, i've added this mechanism as an event/listener mechanism: i've a IMessageSendedHandler, and after the getContext().sendMessage(...), I fire the event to all registered listeners.


Can this problem be tackled (this way or any other) in one of the future releases of ECF?

thanks
Re: A Message-sent handler proposal [message #612046 is a reply to message #612045] Tue, 23 January 2007 16:49 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 976
Registered: July 2009
Senior Member
Hi Antonio,

antonio wrote:
> Hi,
> working with ECF on my application, i need to handle send/receive messages of the shared objects for tracing all the messages that are received and sent from/to all the others shared objects; to handle received messages I can add a IEventProcessor, but I don't find any mechanism to handle the event that my shared object sent a message.
> So, i've added this mechanism as an event/listener mechanism: i've a IMessageSendedHandler, and after the getContext().sendMessage(...), I fire the event to all registered listeners.
>
>
> Can this problem be tackled (this way or any other) in one of the future releases of ECF?

It could. Just so I'm clear...you are interested in a listener for
*all* shared object messages within a given container?

Note another way to do what you want to do is to override one of the
container classes (TCPClientSOContainer) and override one of the
protected methods for handling shared object messages.

We could also build into the IContainerListener the notification of
shared object messages, and then any registered listeners (via
IContainer.addListener(IContainerListener) would be notified of these
messages (for ISharedObjectContainers anyway).

If you could describe the use case a little further we can jointly
figure out what the right answer is here.

Thanks,

Scott
Re: A Message-sent handler proposal [message #612047 is a reply to message #612046] Thu, 25 January 2007 11:17 Go to previous messageGo to next message
antonio is currently offline antonioFriend
Messages: 6
Registered: July 2009
Junior Member
i just catch all the message received events with a defaul event processor that record the events in a file, but also i want to catch all message sent by a shared object in a container (for tracing).

sorry for the delay of the reply :-)

thanks

antonio
Re: A Message-sent handler proposal [message #612052 is a reply to message #612047] Tue, 30 January 2007 21:33 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 976
Registered: July 2009
Senior Member
Hi Antonio,

I think there are two ways to address this:

1) Extend the TCPClientSOContainer class (in org.eclipse.ecf.provider)
and override the method:

handleSharedObjectMessage

You can then intercept/record the shared object message to a file,
etc...and then call super.handleSharedObjectMessage(mess) to do the
regular processing.

2) I can add an enhancement that sends a sharedobjectmessage event (new
event type) to the IContainerListener for shared object containers.

Do people think that 2 is worth it? If so then I'll file an enhancement
request and I think I will be able to implement before 0.9.7 (Feb 15).

Scott


handleantonio wrote:
> i just catch all the message received events with a defaul event processor that record the events in a file, but also i want to catch all message sent by a shared object in a container (for tracing).
>
> sorry for the delay of the reply :-)
>
> thanks
>
> antonio
Re: A Message-sent handler proposal [message #612053 is a reply to message #612052] Wed, 31 January 2007 10:25 Go to previous messageGo to next message
antonio is currently offline antonioFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,
i think that the second solution is better because for several reasons: it is more flexible for all shared object container types; if there are more processor for these events; in order to separate logic from the container implementation.

thanks :)
Re: A Message-sent handler proposal [message #612054 is a reply to message #612053] Wed, 31 January 2007 17:42 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 976
Registered: July 2009
Senior Member
Hi Antonio,

Would you mind creating an enhancement request/bug for this?

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=ECF

That way it will be tracked and interest from others can be recorded.

Thanks!

Scott

antonio wrote:
> Hi,
> i think that the second solution is better because for several reasons: it is more flexible for all shared object container types; if there are more processor for these events; in order to separate logic from the container implementation.
>
> thanks :)
Previous Topic:Patch needed to compile current ECF HEAD on 3.2.1 platform?
Next Topic:supported protocols
Goto Forum:
  


Current Time: Mon Dec 22 14:21:30 GMT 2014

Powered by FUDForum. Page generated in 0.01778 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software