Home » Archived » Eclipse Communications Framework (ECF) » Question about ECF architecture
|
Re: Question about ECF architecture [message #619825 is a reply to message #619819] |
Mon, 17 December 2007 03:18 |
Scott Lewis Messages: 1038 Registered: July 2009 |
Senior Member |
|
|
Hi Lionel,
Lionel wrote:
> Hi folks,
>
> I have to use ECF in my RCP applications. I found that both instant
> messaging and Shared Objects would be very useful.
> By now I already have tested them and it works fine.
>
> But my questions are more about ECF architecture :
> I would like to know if contacts in my buddy list are connected to my
> specific application(s).
By default, entries in the buddy list are not associated with any
applications. However, ECF allows an application to create and then use
arbitrary channels for messaging. These channels are created via the
ECF datashare API: http://wiki.eclipse.org/ECF_API_Docs#Datashare_API
The way this can work is that an application interested in creating a
channel for messaging to a buddy can
1) Get the IChannelContainerAdapter instance
2) Create a channel to a remote application using the instance
3) Use the channel
So, for example, given an IRosterEntry instance, a channel container
adapter can be retrieved from the provider responsible for the
IRosterEntry via
IPresenceContainerAdapter prca =
rosterEntry.getRoster().getPresenceContainerAdapter();
IContainer container = (IContainer) prca.getAdapter(IContainer.class);
IChannelContainerAdapter cca = (IChannelContainerAdapter)
container.getAdapter(IChannelContainerAdapter.class);
To create a channel, then:
ID channelID =
IDFactory.getDefault().createID(cca.getChannelNamespace(),"channel ");
IChannelListener channelListener = <create channel listener to receive
events>
IChannel newChannel = cca.createChannel(channelID, channelListener, null);
Then to use the channel to send a message to roster entry (where a
channel with same name also has to be established):
newChannel.sendMessage(rosterEntry.getID(),new String("howdy").getBytes());
Note there are examples of doing this in the
org.eclipse.presence.collab.ui plugin
URLShare (distributing URLs to buddy list members via channel):
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/url/URLShare.java?root=Technology_Project &view=log
ViewShare (remotely opening Eclipse views to buddy list members via
channel):
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/view/ViewShare.java?root=Technology_Proje ct&view=log
I think about using a shared object to store
> and exchange application informations (user connected, application
> title, special actions, etc...).
> Is it the best way to achieve that ?
The above procedure can also be used to get the
ISharedObjectContainerAdapter and to create/add a shared object
(analogous to channel). But the IChannel interface and the
IChannelContainer interface are simpler and easier to use (although they
do not provide as much access to functionality as ISharedObject and
ISharedObjectContainer). So ultimately it's up to you...based upon the
needs of your application. I suggest trying the datashare/IChannel
interfaces first, and see if that will meet your needs.
> How does SharedObject and containers work actually ? Do any instance of
> Eclipse RCP have to send Shared Object to everybody, or is it possible
> to store a Shared Object in a server and then clients requests it when
> they need ?
When shared objects are added to a container (via
ISharedObjectManager.addSharedObject) a thread is started for the shared
object, and events are delivered to that shared object by the container.
The events delivered (asynchonrously via ISharedObject.handleEvent):
Upon being added to container: ISharedObjectActivatedEvent
Upon being removed from container: ISharedObjectDeactivatedEvent
When receiving a message from a remote shared object replica (of same
ID): ISharedObjectMessageEvent
Note that when a shared object is activated, it can send a message to a
remote to create a replica of itself on the remote (with the current
state of the shared object):
sharedObjectContext.sendCreate(targetID,remoteDescription);
where the targetID is the ID of the remote target, and the
remoteDescription is a description of the replica (i.e. class, ID,
state/properties, etc). Note that there is a base shared object class,
that provides a number of utility methods for subclasses (e.g.
getReplicaDescription(), getContext(), replicatToRemoteContainers(), etc):
http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/ecli pse/ecf/core/sharedobject/BaseSharedObject.html#getContext()
The 'original' instance of the shared object can determine when/how
replicas are created...so either of your scenarios described above can
be supported.
Scott
|
|
| |
Re: Question about ECF architecture [message #619832 is a reply to message #619825] |
Wed, 19 December 2007 22:23 |
Luca Bacco Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm trying to use shareObject Api but i didn't understand how to share
the same content for different user.
I've gotten the sharedObjectContainer and added a new sharedObject to
the container. I can see that the object is added in the local
sharedContainer but I didn't understand how to replicate this object to
the shared container
of the other users.
If you can provide an example or the basic step needed for this I'll be
grateful
Bye,
Luca
Scott Lewis ha scritto:
> Hi Lionel,
>
> Lionel wrote:
>> Hi folks,
>>
>> I have to use ECF in my RCP applications. I found that both instant
>> messaging and Shared Objects would be very useful.
>> By now I already have tested them and it works fine.
>>
>> But my questions are more about ECF architecture :
>> I would like to know if contacts in my buddy list are connected to my
>> specific application(s).
>
>
> By default, entries in the buddy list are not associated with any
> applications. However, ECF allows an application to create and then use
> arbitrary channels for messaging. These channels are created via the
> ECF datashare API: http://wiki.eclipse.org/ECF_API_Docs#Datashare_API
>
> The way this can work is that an application interested in creating a
> channel for messaging to a buddy can
>
> 1) Get the IChannelContainerAdapter instance
> 2) Create a channel to a remote application using the instance
> 3) Use the channel
>
> So, for example, given an IRosterEntry instance, a channel container
> adapter can be retrieved from the provider responsible for the
> IRosterEntry via
>
> IPresenceContainerAdapter prca =
> rosterEntry.getRoster().getPresenceContainerAdapter();
>
> IContainer container = (IContainer) prca.getAdapter(IContainer.class);
>
> IChannelContainerAdapter cca = (IChannelContainerAdapter)
> container.getAdapter(IChannelContainerAdapter.class);
>
> To create a channel, then:
>
> ID channelID =
> IDFactory.getDefault().createID(cca.getChannelNamespace(),"channel ");
> IChannelListener channelListener = <create channel listener to receive
> events>
> IChannel newChannel = cca.createChannel(channelID, channelListener, null);
>
> Then to use the channel to send a message to roster entry (where a
> channel with same name also has to be established):
>
> newChannel.sendMessage(rosterEntry.getID(),new String("howdy").getBytes());
>
> Note there are examples of doing this in the
> org.eclipse.presence.collab.ui plugin
>
> URLShare (distributing URLs to buddy list members via channel):
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/url/URLShare.java?root=Technology_Project &view=log
>
>
> ViewShare (remotely opening Eclipse views to buddy list members via
> channel):
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/view/ViewShare.java?root=Technology_Proje ct&view=log
>
>
> I think about using a shared object to store
>> and exchange application informations (user connected, application
>> title, special actions, etc...).
>> Is it the best way to achieve that ?
>
> The above procedure can also be used to get the
> ISharedObjectContainerAdapter and to create/add a shared object
> (analogous to channel). But the IChannel interface and the
> IChannelContainer interface are simpler and easier to use (although they
> do not provide as much access to functionality as ISharedObject and
> ISharedObjectContainer). So ultimately it's up to you...based upon the
> needs of your application. I suggest trying the datashare/IChannel
> interfaces first, and see if that will meet your needs.
>
>
>> How does SharedObject and containers work actually ? Do any instance
>> of Eclipse RCP have to send Shared Object to everybody, or is it
>> possible to store a Shared Object in a server and then clients
>> requests it when they need ?
>
>
> When shared objects are added to a container (via
> ISharedObjectManager.addSharedObject) a thread is started for the shared
> object, and events are delivered to that shared object by the container.
> The events delivered (asynchonrously via ISharedObject.handleEvent):
>
> Upon being added to container: ISharedObjectActivatedEvent
> Upon being removed from container: ISharedObjectDeactivatedEvent
>
> When receiving a message from a remote shared object replica (of same
> ID): ISharedObjectMessageEvent
>
> Note that when a shared object is activated, it can send a message to a
> remote to create a replica of itself on the remote (with the current
> state of the shared object):
>
> sharedObjectContext.sendCreate(targetID,remoteDescription);
>
> where the targetID is the ID of the remote target, and the
> remoteDescription is a description of the replica (i.e. class, ID,
> state/properties, etc). Note that there is a base shared object class,
> that provides a number of utility methods for subclasses (e.g.
> getReplicaDescription(), getContext(), replicatToRemoteContainers(), etc):
>
> http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/ecli pse/ecf/core/sharedobject/BaseSharedObject.html#getContext()
>
>
> The 'original' instance of the shared object can determine when/how
> replicas are created...so either of your scenarios described above can
> be supported.
>
> Scott
|
|
|
Re: Question about ECF architecture [message #619834 is a reply to message #619832] |
Thu, 20 December 2007 00:05 |
Scott Lewis Messages: 1038 Registered: July 2009 |
Senior Member |
|
|
Hi Luca,
There is this test code, which adds a shared object to a client, and
this object is then replicated to the server and the other client.
The shared object code is here:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/te sts/sharedobject/TestSharedObject.java?root=Technology_Proje ct&view=log
The test case code is here:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/te sts/sharedobject/AddTest.java?root=Technology_Project&vi ew=log
The whole (test) plugin:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/?root=Technology_Proje ct
See particularly the shared object code, the 'initialize' method for
setting up an event processor that replicates the object.
Hope this helps. We will be doing more test code of this kind.
Scott
Luca Bacco wrote:
> Hi,
>
> I'm trying to use shareObject Api but i didn't understand how to share
> the same content for different user.
>
> I've gotten the sharedObjectContainer and added a new sharedObject to
> the container. I can see that the object is added in the local
> sharedContainer but I didn't understand how to replicate this object to
> the shared container
> of the other users.
>
> If you can provide an example or the basic step needed for this I'll be
> grateful
>
> Bye,
> Luca
>
> Scott Lewis ha scritto:
>> Hi Lionel,
>>
>> Lionel wrote:
>>> Hi folks,
>>>
>>> I have to use ECF in my RCP applications. I found that both instant
>>> messaging and Shared Objects would be very useful.
>>> By now I already have tested them and it works fine.
>>>
>>> But my questions are more about ECF architecture :
>>> I would like to know if contacts in my buddy list are connected to my
>>> specific application(s).
>>
>>
>> By default, entries in the buddy list are not associated with any
>> applications. However, ECF allows an application to create and then
>> use arbitrary channels for messaging. These channels are created via
>> the ECF datashare API:
>> http://wiki.eclipse.org/ECF_API_Docs#Datashare_API
>>
>> The way this can work is that an application interested in creating a
>> channel for messaging to a buddy can
>>
>> 1) Get the IChannelContainerAdapter instance
>> 2) Create a channel to a remote application using the instance
>> 3) Use the channel
>>
>> So, for example, given an IRosterEntry instance, a channel container
>> adapter can be retrieved from the provider responsible for the
>> IRosterEntry via
>>
>> IPresenceContainerAdapter prca =
>> rosterEntry.getRoster().getPresenceContainerAdapter();
>>
>> IContainer container = (IContainer) prca.getAdapter(IContainer.class);
>>
>> IChannelContainerAdapter cca = (IChannelContainerAdapter)
>> container.getAdapter(IChannelContainerAdapter.class);
>>
>> To create a channel, then:
>>
>> ID channelID =
>> IDFactory.getDefault().createID(cca.getChannelNamespace(),"channel ");
>> IChannelListener channelListener = <create channel listener to receive
>> events>
>> IChannel newChannel = cca.createChannel(channelID, channelListener,
>> null);
>>
>> Then to use the channel to send a message to roster entry (where a
>> channel with same name also has to be established):
>>
>> newChannel.sendMessage(rosterEntry.getID(),new
>> String("howdy").getBytes());
>>
>> Note there are examples of doing this in the
>> org.eclipse.presence.collab.ui plugin
>>
>> URLShare (distributing URLs to buddy list members via channel):
>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/url/URLShare.java?root=Technology_Project &view=log
>>
>>
>> ViewShare (remotely opening Eclipse views to buddy list members via
>> channel):
>>
>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/view/ViewShare.java?root=Technology_Proje ct&view=log
>>
>>
>> I think about using a shared object to store
>>> and exchange application informations (user connected, application
>>> title, special actions, etc...).
>>> Is it the best way to achieve that ?
>>
>> The above procedure can also be used to get the
>> ISharedObjectContainerAdapter and to create/add a shared object
>> (analogous to channel). But the IChannel interface and the
>> IChannelContainer interface are simpler and easier to use (although
>> they do not provide as much access to functionality as ISharedObject
>> and ISharedObjectContainer). So ultimately it's up to you...based
>> upon the needs of your application. I suggest trying the
>> datashare/IChannel interfaces first, and see if that will meet your
>> needs.
>>
>>
>>> How does SharedObject and containers work actually ? Do any instance
>>> of Eclipse RCP have to send Shared Object to everybody, or is it
>>> possible to store a Shared Object in a server and then clients
>>> requests it when they need ?
>>
>>
>> When shared objects are added to a container (via
>> ISharedObjectManager.addSharedObject) a thread is started for the
>> shared object, and events are delivered to that shared object by the
>> container. The events delivered (asynchonrously via
>> ISharedObject.handleEvent):
>>
>> Upon being added to container: ISharedObjectActivatedEvent
>> Upon being removed from container: ISharedObjectDeactivatedEvent
>>
>> When receiving a message from a remote shared object replica (of same
>> ID): ISharedObjectMessageEvent
>>
>> Note that when a shared object is activated, it can send a message to
>> a remote to create a replica of itself on the remote (with the current
>> state of the shared object):
>>
>> sharedObjectContext.sendCreate(targetID,remoteDescription);
>>
>> where the targetID is the ID of the remote target, and the
>> remoteDescription is a description of the replica (i.e. class, ID,
>> state/properties, etc). Note that there is a base shared object
>> class, that provides a number of utility methods for subclasses (e.g.
>> getReplicaDescription(), getContext(), replicatToRemoteContainers(),
>> etc):
>>
>> http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/ecli pse/ecf/core/sharedobject/BaseSharedObject.html#getContext()
>>
>>
>> The 'original' instance of the shared object can determine when/how
>> replicas are created...so either of your scenarios described above can
>> be supported.
>>
>> Scott
>
|
|
|
Re: Question about ECF architecture [message #619837 is a reply to message #619834] |
Sun, 23 December 2007 09:07 |
Luca Bacco Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Scott Lewis ha scritto:
> Hi Luca,
>
> There is this test code, which adds a shared object to a client, and
> this object is then replicated to the server and the other client.
>
> The shared object code is here:
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/te sts/sharedobject/TestSharedObject.java?root=Technology_Proje ct&view=log
>
>
> The test case code is here:
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/te sts/sharedobject/AddTest.java?root=Technology_Project&vi ew=log
>
>
> The whole (test) plugin:
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/?root=Technology_Proje ct
>
>
> See particularly the shared object code, the 'initialize' method for
> setting up an event processor that replicates the object.
>
> Hope this helps. We will be doing more test code of this kind.
>
> Scott
>
>
> Luca Bacco wrote:
>> Hi,
>>
>> I'm trying to use shareObject Api but i didn't understand how to share
>> the same content for different user.
>>
>> I've gotten the sharedObjectContainer and added a new sharedObject to
>> the container. I can see that the object is added in the local
>> sharedContainer but I didn't understand how to replicate this object
>> to the shared container
>> of the other users.
>>
>> If you can provide an example or the basic step needed for this I'll
>> be grateful
>>
>> Bye,
>> Luca
>>
>> Scott Lewis ha scritto:
>>> Hi Lionel,
>>>
>>> Lionel wrote:
>>>> Hi folks,
>>>>
>>>> I have to use ECF in my RCP applications. I found that both instant
>>>> messaging and Shared Objects would be very useful.
>>>> By now I already have tested them and it works fine.
>>>>
>>>> But my questions are more about ECF architecture :
>>>> I would like to know if contacts in my buddy list are connected to
>>>> my specific application(s).
>>>
>>>
>>> By default, entries in the buddy list are not associated with any
>>> applications. However, ECF allows an application to create and then
>>> use arbitrary channels for messaging. These channels are created via
>>> the ECF datashare API:
>>> http://wiki.eclipse.org/ECF_API_Docs#Datashare_API
>>>
>>> The way this can work is that an application interested in creating a
>>> channel for messaging to a buddy can
>>>
>>> 1) Get the IChannelContainerAdapter instance
>>> 2) Create a channel to a remote application using the instance
>>> 3) Use the channel
>>>
>>> So, for example, given an IRosterEntry instance, a channel container
>>> adapter can be retrieved from the provider responsible for the
>>> IRosterEntry via
>>>
>>> IPresenceContainerAdapter prca =
>>> rosterEntry.getRoster().getPresenceContainerAdapter();
>>>
>>> IContainer container = (IContainer) prca.getAdapter(IContainer.class);
>>>
>>> IChannelContainerAdapter cca = (IChannelContainerAdapter)
>>> container.getAdapter(IChannelContainerAdapter.class);
>>>
>>> To create a channel, then:
>>>
>>> ID channelID =
>>> IDFactory.getDefault().createID(cca.getChannelNamespace(),"channel ");
>>> IChannelListener channelListener = <create channel listener to
>>> receive events>
>>> IChannel newChannel = cca.createChannel(channelID, channelListener,
>>> null);
>>>
>>> Then to use the channel to send a message to roster entry (where a
>>> channel with same name also has to be established):
>>>
>>> newChannel.sendMessage(rosterEntry.getID(),new
>>> String("howdy").getBytes());
>>>
>>> Note there are examples of doing this in the
>>> org.eclipse.presence.collab.ui plugin
>>>
>>> URLShare (distributing URLs to buddy list members via channel):
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/url/URLShare.java?root=Technology_Project &view=log
>>>
>>>
>>> ViewShare (remotely opening Eclipse views to buddy list members via
>>> channel):
>>>
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/view/ViewShare.java?root=Technology_Proje ct&view=log
>>>
>>>
>>> I think about using a shared object to store
>>>> and exchange application informations (user connected, application
>>>> title, special actions, etc...).
>>>> Is it the best way to achieve that ?
>>>
>>> The above procedure can also be used to get the
>>> ISharedObjectContainerAdapter and to create/add a shared object
>>> (analogous to channel). But the IChannel interface and the
>>> IChannelContainer interface are simpler and easier to use (although
>>> they do not provide as much access to functionality as ISharedObject
>>> and ISharedObjectContainer). So ultimately it's up to you...based
>>> upon the needs of your application. I suggest trying the
>>> datashare/IChannel interfaces first, and see if that will meet your
>>> needs.
>>>
>>>
>>>> How does SharedObject and containers work actually ? Do any instance
>>>> of Eclipse RCP have to send Shared Object to everybody, or is it
>>>> possible to store a Shared Object in a server and then clients
>>>> requests it when they need ?
>>>
>>>
>>> When shared objects are added to a container (via
>>> ISharedObjectManager.addSharedObject) a thread is started for the
>>> shared object, and events are delivered to that shared object by the
>>> container. The events delivered (asynchonrously via
>>> ISharedObject.handleEvent):
>>>
>>> Upon being added to container: ISharedObjectActivatedEvent
>>> Upon being removed from container: ISharedObjectDeactivatedEvent
>>>
>>> When receiving a message from a remote shared object replica (of same
>>> ID): ISharedObjectMessageEvent
>>>
>>> Note that when a shared object is activated, it can send a message to
>>> a remote to create a replica of itself on the remote (with the
>>> current state of the shared object):
>>>
>>> sharedObjectContext.sendCreate(targetID,remoteDescription);
>>>
>>> where the targetID is the ID of the remote target, and the
>>> remoteDescription is a description of the replica (i.e. class, ID,
>>> state/properties, etc). Note that there is a base shared object
>>> class, that provides a number of utility methods for subclasses (e.g.
>>> getReplicaDescription(), getContext(), replicatToRemoteContainers(),
>>> etc):
>>>
>>> http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/ecli pse/ecf/core/sharedobject/BaseSharedObject.html#getContext()
>>>
>>>
>>> The 'original' instance of the shared object can determine when/how
>>> replicas are created...so either of your scenarios described above
>>> can be supported.
>>>
>>> Scott
>>
Thank you very much for your answer!
Luca
|
|
|
Re: Question about ECF architecture [message #620015 is a reply to message #619834] |
Tue, 01 January 2008 23:11 |
Luca Bacco Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Scott Lewis ha scritto:
> Hi Luca,
>
> There is this test code, which adds a shared object to a client, and
> this object is then replicated to the server and the other client.
>
> The shared object code is here:
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/te sts/sharedobject/TestSharedObject.java?root=Technology_Proje ct&view=log
>
>
> The test case code is here:
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/te sts/sharedobject/AddTest.java?root=Technology_Project&vi ew=log
>
>
> The whole (test) plugin:
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/?root=Technology_Proje ct
>
>
> See particularly the shared object code, the 'initialize' method for
> setting up an event processor that replicates the object.
>
> Hope this helps. We will be doing more test code of this kind.
>
> Scott
>
>
> Luca Bacco wrote:
>> Hi,
>>
>> I'm trying to use shareObject Api but i didn't understand how to share
>> the same content for different user.
>>
>> I've gotten the sharedObjectContainer and added a new sharedObject to
>> the container. I can see that the object is added in the local
>> sharedContainer but I didn't understand how to replicate this object
>> to the shared container
>> of the other users.
>>
>> If you can provide an example or the basic step needed for this I'll
>> be grateful
>>
>> Bye,
>> Luca
>>
>> Scott Lewis ha scritto:
>>> Hi Lionel,
>>>
>>> Lionel wrote:
>>>> Hi folks,
>>>>
>>>> I have to use ECF in my RCP applications. I found that both instant
>>>> messaging and Shared Objects would be very useful.
>>>> By now I already have tested them and it works fine.
>>>>
>>>> But my questions are more about ECF architecture :
>>>> I would like to know if contacts in my buddy list are connected to
>>>> my specific application(s).
>>>
>>>
>>> By default, entries in the buddy list are not associated with any
>>> applications. However, ECF allows an application to create and then
>>> use arbitrary channels for messaging. These channels are created via
>>> the ECF datashare API:
>>> http://wiki.eclipse.org/ECF_API_Docs#Datashare_API
>>>
>>> The way this can work is that an application interested in creating a
>>> channel for messaging to a buddy can
>>>
>>> 1) Get the IChannelContainerAdapter instance
>>> 2) Create a channel to a remote application using the instance
>>> 3) Use the channel
>>>
>>> So, for example, given an IRosterEntry instance, a channel container
>>> adapter can be retrieved from the provider responsible for the
>>> IRosterEntry via
>>>
>>> IPresenceContainerAdapter prca =
>>> rosterEntry.getRoster().getPresenceContainerAdapter();
>>>
>>> IContainer container = (IContainer) prca.getAdapter(IContainer.class);
>>>
>>> IChannelContainerAdapter cca = (IChannelContainerAdapter)
>>> container.getAdapter(IChannelContainerAdapter.class);
>>>
>>> To create a channel, then:
>>>
>>> ID channelID =
>>> IDFactory.getDefault().createID(cca.getChannelNamespace(),"channel ");
>>> IChannelListener channelListener = <create channel listener to
>>> receive events>
>>> IChannel newChannel = cca.createChannel(channelID, channelListener,
>>> null);
>>>
>>> Then to use the channel to send a message to roster entry (where a
>>> channel with same name also has to be established):
>>>
>>> newChannel.sendMessage(rosterEntry.getID(),new
>>> String("howdy").getBytes());
>>>
>>> Note there are examples of doing this in the
>>> org.eclipse.presence.collab.ui plugin
>>>
>>> URLShare (distributing URLs to buddy list members via channel):
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/url/URLShare.java?root=Technology_Project &view=log
>>>
>>>
>>> ViewShare (remotely opening Eclipse views to buddy list members via
>>> channel):
>>>
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plu gins/org.eclipse.ecf.presence.collab.ui/src/org/eclipse/ecf/ presence/collab/ui/view/ViewShare.java?root=Technology_Proje ct&view=log
>>>
>>>
>>> I think about using a shared object to store
>>>> and exchange application informations (user connected, application
>>>> title, special actions, etc...).
>>>> Is it the best way to achieve that ?
>>>
>>> The above procedure can also be used to get the
>>> ISharedObjectContainerAdapter and to create/add a shared object
>>> (analogous to channel). But the IChannel interface and the
>>> IChannelContainer interface are simpler and easier to use (although
>>> they do not provide as much access to functionality as ISharedObject
>>> and ISharedObjectContainer). So ultimately it's up to you...based
>>> upon the needs of your application. I suggest trying the
>>> datashare/IChannel interfaces first, and see if that will meet your
>>> needs.
>>>
>>>
>>>> How does SharedObject and containers work actually ? Do any instance
>>>> of Eclipse RCP have to send Shared Object to everybody, or is it
>>>> possible to store a Shared Object in a server and then clients
>>>> requests it when they need ?
>>>
>>>
>>> When shared objects are added to a container (via
>>> ISharedObjectManager.addSharedObject) a thread is started for the
>>> shared object, and events are delivered to that shared object by the
>>> container. The events delivered (asynchonrously via
>>> ISharedObject.handleEvent):
>>>
>>> Upon being added to container: ISharedObjectActivatedEvent
>>> Upon being removed from container: ISharedObjectDeactivatedEvent
>>>
>>> When receiving a message from a remote shared object replica (of same
>>> ID): ISharedObjectMessageEvent
>>>
>>> Note that when a shared object is activated, it can send a message to
>>> a remote to create a replica of itself on the remote (with the
>>> current state of the shared object):
>>>
>>> sharedObjectContext.sendCreate(targetID,remoteDescription);
>>>
>>> where the targetID is the ID of the remote target, and the
>>> remoteDescription is a description of the replica (i.e. class, ID,
>>> state/properties, etc). Note that there is a base shared object
>>> class, that provides a number of utility methods for subclasses (e.g.
>>> getReplicaDescription(), getContext(), replicatToRemoteContainers(),
>>> etc):
>>>
>>> http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/ecli pse/ecf/core/sharedobject/BaseSharedObject.html#getContext()
>>>
>>>
>>> The 'original' instance of the shared object can determine when/how
>>> replicas are created...so either of your scenarios described above
>>> can be supported.
>>>
>>> Scott
>>
I'm sorry if I ask again about this question but I still have a few
questions :
I followed the examples in the test, I've tried to use a connection to a
xmpp server creating two containers (client a and b):
container =ContainerFactory.getDefault().createContainer("ecf.xmpp.smack " );
container.addListener( this );
id = IDFactory.getDefault().createID( container.getConnectNamespace(),
userName );
connectContext = ConnectContextFactory.createPasswordConnectContext(
password );
container.connect( id, connectContext );
}
However "addEventProcessor(new IEventProcessor())" has always failed and
I was able to create my object (and share it) only commenting this step
but I didn't understand why.
Now I want to propagate the changes done on my local copy to the others.
If I've understand from the other examples I could send a
sharedMessage and use a handleShaderMessage and make changes to the
other object.
Thank you in advance.
I want to wish you all an happy new year.
Luca
|
|
| |
Re: Question about ECF architecture [message #620042 is a reply to message #620017] |
Thu, 10 January 2008 00:45 |
Luca Bacco Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Scott Lewis ha scritto:
> Hi Luca,
>
> Luca Bacco wrote:
>> Scott Lewis ha scritto:
> <stuff deleted>
>
>> I'm sorry if I ask again about this question but I still have a few
>> questions :
>> I followed the examples in the test, I've tried to use a connection to
>> a xmpp server creating two containers (client a and b):
>>
>> container
>> =ContainerFactory.getDefault().createContainer("ecf.xmpp.smack " );
>> container.addListener( this );
>> id = IDFactory.getDefault().createID( container.getConnectNamespace(),
>> userName );
>> connectContext = ConnectContextFactory.createPasswordConnectContext(
>> password );
>> container.connect( id, connectContext );
>> }
>> However "addEventProcessor(new IEventProcessor())" has always failed
>> and I was able to create my object (and share it) only commenting this
>> step but I didn't understand why.
>
I've tested more and discovered that this was a simple problem of delay
between server\client...
>
> Could you describe what you mean by addEventProcessor failing? Does it
> throw some exception? If so, which one? When is addEventProcessor
> called in your code?
>
>
>>
>> Now I want to propagate the changes done on my local copy to the
>> others. If I've understand from the other examples I could send a
>> sharedMessage and use a handleShaderMessage and make changes to the
>> other object.
>
I'm sorry but I still need help here...
I've successfully used this feature sending a message to another
client(after creating 2 instances of contanier connected to a remote
xmpp server), however I've still some doubt about this...
1)it's possible to send automatically a message to all the users
connected to same sever?
2) getReplicaDescription(ID receiver) should let me to create a replica
of a shared object to another remote container so if I've understand, if
client adds a shared object client b should only use
SharedManager.getSharedObject(ID) to obtain a replica of that object.
(or didn't I understand?)
Now even if I'm able to send a message to another client
(sendSharedMsgTo(ID, msg)) I'm not able to get this replica, did i miss
a step?
Do I need to connect the SharedObjectManager to a room/group or to
another client?
I think I'm missing a step.
I'm posting the simple code I'm using for this test (I've just modified
AddTest.java)
http://jazz.di.uniba.it:8000/econference-over-ecf/browser/tr unk/it.uniba.cdg.instantmessenger.handRaise.test/src/it/unib a/cdg/instantmessenger/handraise/test/SobjectTest.java
and this is our project:
http://jazz.di.uniba.it:8000/econference-over-ecf/
Bye,
Luca
>
> Yes, that's correct. The methods to do these things are in
> BaseSharedObject.
>
>
>>
>> Thank you in advance.
>
> Sure...just would like to get you fully going.
>
>>
>> I want to wish you all an happy new year.
>
> Happy New Year to you as well.
>
> Scott
>
>
>>
>> Luca
|
|
|
Re: Question about ECF architecture [message #620044 is a reply to message #620042] |
Thu, 10 January 2008 05:13 |
Scott Lewis Messages: 1038 Registered: July 2009 |
Senior Member |
|
|
Hi Luca,
Luca Bacco wrote:
<stuff deleted>
>
> I've successfully used this feature sending a message to another
> client(after creating 2 instances of contanier connected to a remote
> xmpp server), however I've still some doubt about this...
>
> 1)it's possible to send automatically a message to all the users
> connected to same sever?
For XMPP servers the answer is no...because XMPP has no concept of a
'group'. So the
BaseSharedObject.sendSharedObjectMsgTo(ID toID, SharedObjectMsg msg)
method will send a message to a given receiver (toID)...OR, if toID is
null, to all members of the group defined by the container. For XMPP
there is no group, and so if toID is null an exception will be thrown.
OTOH, if you use the ECF generic server, toID can be null, and it will
be sent to all participants in the given group. There's an ECF generic
server running at ecftcp://ecf.eclipse.org:3282/server...and you can run
one yourself as an application as described here:
http://wiki.eclipse.org/ECF_Servers
>
> 2) getReplicaDescription(ID receiver) should let me to create a replica
> of a shared object to another remote container
getReplicaDescription(ID receiver) is called by the method
BaseSharedObject.replicateToRemoteContainers(ID[] remoteContainers)
to determine what ReplicaSharedObjectDescription instance to use for
creating a shared object replica on a given remote container.
In the test code for example (TestSharedObject):
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/tes ts/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/te sts/sharedobject/TestSharedObject.java?root=Technology_Proje ct&view=log
You will notice that the event processor created in the init method ends
up calling replicateToRemoteContainers when the shared object is
activated (i.e. the ISharedObjectActivatedEvent). This ends up calling
getReplicaDescription(ID receiver). You should override this method to
return a non-null value for all receivers if you want it to be
replicated to all clients in the group. If getReplicaDescription
returns null, then this means no replication is done.
so if I've understand, if
> client adds a shared object client b should only use
> SharedManager.getSharedObject(ID) to obtain a replica of that object.
> (or didn't I understand?)
>
> Now even if I'm able to send a message to another client
> (sendSharedMsgTo(ID, msg)) I'm not able to get this replica, did i miss
> a step?
The replica needs to be created as per the description above about
replicateToRemoteContainers and getReplicaDescription
> Do I need to connect the SharedObjectManager to a room/group or to
> another client?
> I think I'm missing a step.
>
> I'm posting the simple code I'm using for this test (I've just modified
> AddTest.java)
>
> http://jazz.di.uniba.it:8000/econference-over-ecf/browser/tr unk/it.uniba.cdg.instantmessenger.handRaise.test/src/it/unib a/cdg/instantmessenger/handraise/test/SobjectTest.java
Please let me know.Thanks I'll try to take a look at it over the
next few days, but maybe the description of the replication process as
described above will help. I'm happy to help support the project! It
sounds interesting.
Scott
>
>
> and this is our project:
>
> http://jazz.di.uniba.it:8000/econference-over-ecf/
>
> Bye,
>
> Luca
>>
>> Yes, that's correct. The methods to do these things are in
>> BaseSharedObject.
>>
>>
>>>
>>> Thank you in advance.
>>
>> Sure...just would like to get you fully going.
>>
>>>
>>> I want to wish you all an happy new year.
>>
>> Happy New Year to you as well.
>>
>> Scott
>>
>>
>>>
>>> Luca
|
|
|
Re: Question about ECF architecture [message #620046 is a reply to message #620044] |
Thu, 10 January 2008 10:44 |
Eclipse User |
|
|
|
Originally posted by: basquale.fersini.libero.it
Scott Lewis ha scritto:
> Hi Luca,
>
> Luca Bacco wrote:
> <stuff deleted>
>
>> Do I need to connect the SharedObjectManager to a room/group or to
>> another client?
>> I think I'm missing a step.
>>
>> I'm posting the simple code I'm using for this test (I've just
>> modified AddTest.java)
>>
>> http://jazz.di.uniba.it:8000/econference-over-ecf/browser/tr unk/it.uniba.cdg.instantmessenger.handRaise.test/src/it/unib a/cdg/instantmessenger/handraise/test/SobjectTest.java
>
> Please let me know.Thanks I'll try to take a look at it over the next
> few days, but maybe the description of the replication process as
> described above will help. I'm happy to help support the project! It
> sounds interesting.
>
> Scott
Hi scott,
I'm new here. I work with luca to this case study.
We want to share an object with users connected to the same room. So we
would like to send a single shared object message to the room's ID and
then have the server forwarding it to the other connected clients (which
will update their replicas accordingly, in our hopes). Are we right in
thinking in this way and can proceed accordingly?
Thanks in advance,
Pas.
|
|
| |
Re: Question about ECF architecture [message #620050 is a reply to message #620048] |
Fri, 11 January 2008 10:00 |
Eclipse User |
|
|
|
Originally posted by: basquale.fersini.libero.it
Scott Lewis ha scritto:
> Hi Pasquale,
>
> Pasquale wrote:
>> Scott Lewis ha scritto:
> <stuff deleted>
>> Hi scott,
>> I'm new here. I work with luca to this case study.
>> We want to share an object with users connected to the same room. So
>> we would like to send a single shared object message to the room's ID
>> and then have the server forwarding it to the other connected clients
>> (which will update their replicas accordingly, in our hopes). Are we
>> right in thinking in this way and can proceed accordingly?
>
> Yes, although it will be necessary to create an xmpp chat room (on xmpp
> server), and on the ECF-based client you will need to use an
> IChatRoomContainer (see org.eclipse.ecf.presence bundle
> presence.chatroom package).
>
> The IChatRoomContainer is implemented as an ISharedObjectContainer, so
> it should be possible to use
> IContainer.getAdapter(ISharedObjectContainer.class) to get a non-null
> reference to ISharedObjectContainer.
>
> This facility (using an ISharedobjectContainer in an XMPP chat room) has
> yet to be tested fully...but I would be willing to assist in the
> testing/any needed fixes of using the ISharedObjectContainer adapter
> within an XMPP chat room (IChatRoomContainer).
>
> Note you can also see some example usage of IChatRoomContainer in the
> org.eclipse.ecf.example.clients bundle.
>
> Please let me know as you proceed and I will try to schedule some time
> to setup some test code for the ISharedObjectContainer adapter (off of
> an IChatRoomContainer).
>
> Thanks,
>
> Scott
>
Thanks a lot for your suggestions!
Pasquale.
|
|
|
Re: Question about ECF architecture [message #620055 is a reply to message #620050] |
Fri, 11 January 2008 18:32 |
Scott Lewis Messages: 1038 Registered: July 2009 |
Senior Member |
|
|
Hi Pasquale,
I did write a little test code, and the use of shared objects in the
IChatRoomContainer for XMPP seems to be working OK. So you should
indeed be able to do this.
Note that the shared objects will *not* be created on the server (as the
Jive or other servers do know know anything of shared objects), but they
can be replicated to all clients that are in the given chat room.
I'll be adding this test to the suite of ECF tests...probably over this
coming weekend.
Scott
Pasquale wrote:
> Scott Lewis ha scritto:
>> Hi Pasquale,
>>
>> Pasquale wrote:
>>> Scott Lewis ha scritto:
>> <stuff deleted>
>>> Hi scott,
>>> I'm new here. I work with luca to this case study.
>>> We want to share an object with users connected to the same room. So
>>> we would like to send a single shared object message to the room's ID
>>> and then have the server forwarding it to the other connected clients
>>> (which will update their replicas accordingly, in our hopes). Are we
>>> right in thinking in this way and can proceed accordingly?
>>
>> Yes, although it will be necessary to create an xmpp chat room (on
>> xmpp server), and on the ECF-based client you will need to use an
>> IChatRoomContainer (see org.eclipse.ecf.presence bundle
>> presence.chatroom package).
>>
>> The IChatRoomContainer is implemented as an ISharedObjectContainer, so
>> it should be possible to use
>> IContainer.getAdapter(ISharedObjectContainer.class) to get a non-null
>> reference to ISharedObjectContainer.
>>
>> This facility (using an ISharedobjectContainer in an XMPP chat room)
>> has yet to be tested fully...but I would be willing to assist in the
>> testing/any needed fixes of using the ISharedObjectContainer adapter
>> within an XMPP chat room (IChatRoomContainer).
>>
>> Note you can also see some example usage of IChatRoomContainer in the
>> org.eclipse.ecf.example.clients bundle.
>>
>> Please let me know as you proceed and I will try to schedule some time
>> to setup some test code for the ISharedObjectContainer adapter (off of
>> an IChatRoomContainer).
>>
>> Thanks,
>>
>> Scott
>>
>
> Thanks a lot for your suggestions!
> Pasquale.
|
|
|
Re: Question about ECF architecture [message #620056 is a reply to message #620055] |
Fri, 11 January 2008 22:42 |
Eclipse User |
|
|
|
Originally posted by: basquale.fersini.libero.it
Scott Lewis ha scritto:
> Hi Pasquale,
>
> I did write a little test code, and the use of shared objects in the
> IChatRoomContainer for XMPP seems to be working OK. So you should
> indeed be able to do this.
>
I can't believe it, fantastic.
> Note that the shared objects will *not* be created on the server (as the
> Jive or other servers do know know anything of shared objects), but they
> can be replicated to all clients that are in the given chat room.
It's the same thing we have thought (luca and me). But not yet
implemented... :-(
> I'll be adding this test to the suite of ECF tests...probably over this
> coming weekend.
Wow, great Scott! sLewis for president!
> Scott
>
>
Pasquale.
|
|
| | |
|
|
Goto Forum:
Current Time: Mon Sep 23 08:49:11 GMT 2024
Powered by FUDForum. Page generated in 0.05182 seconds
|