Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » (no subject)
(no subject) [message #687228] Thu, 16 June 2011 21:26 Go to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
I have some server side code which starts a job which runs on the server and connects to the CDO server. This job should
start when the whole osgi app starts but it should get a signal when the repository is ready to connect to. When it gets
the signal it can start itself and read info from the repository. Is there a way to receive this signal?

I tried an element post processor but at that point the repository has been created but is not yet available to be used
through normal cdo session/transaction.

--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
(no subject) [message #687229 is a reply to message #687228] Thu, 16 June 2011 21:53 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
As an extra info, I tried adding a listener to the container for the event that the repository was added, but when
execute on that (and connect to the repository on that event) then I get a stackoverflowerror. So that does not seem to
be a good direction either.

gr. Martin

On 06/16/2011 11:26 PM, Martin Taal wrote:
> Hi,
> I have some server side code which starts a job which runs on the server and connects to the CDO server. This job should
> start when the whole osgi app starts but it should get a signal when the repository is ready to connect to. When it gets
> the signal it can start itself and read info from the repository. Is there a way to receive this signal?
>
> I tried an element post processor but at that point the repository has been created but is not yet available to be used
> through normal cdo session/transaction.
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
(no subject) [message #687232 is a reply to message #687229] Fri, 17 June 2011 07:16 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 16.06.2011 23:53, schrieb Martin Taal:
> Hi,
> As an extra info, I tried adding a listener to the container for the event that the repository was added, but when execute on that (and connect to the repository on that event) then I get a stackoverflowerror. So that does not seem to be a good direction either.
Hmm, I would have suggested that an IListener on the container is preferrable over an IElementProcessor. In both cases you should check isActive() on the added container element (your repository) and if it's not yet active add another listener (LifecycleEventAdapter) to that element and postpone your processing. If yu submit a bugzilla I can abstract this pattern in a new ActivationAdapter class because this looks like a common use case.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 06/16/2011 11:26 PM, Martin Taal wrote:
>> Hi,
>> I have some server side code which starts a job which runs on the server and connects to the CDO server. This job should
>> start when the whole osgi app starts but it should get a signal when the repository is ready to connect to. When it gets
>> the signal it can start itself and read info from the repository. Is there a way to receive this signal?
>>
>> I tried an element post processor but at that point the repository has been created but is not yet available to be used
>> through normal cdo session/transaction.
>>
>
>


(no subject) [message #687505 is a reply to message #687228] Thu, 16 June 2011 21:53 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
As an extra info, I tried adding a listener to the container for the event that the repository was added, but when
execute on that (and connect to the repository on that event) then I get a stackoverflowerror. So that does not seem to
be a good direction either.

gr. Martin

On 06/16/2011 11:26 PM, Martin Taal wrote:
> Hi,
> I have some server side code which starts a job which runs on the server and connects to the CDO server. This job should
> start when the whole osgi app starts but it should get a signal when the repository is ready to connect to. When it gets
> the signal it can start itself and read info from the repository. Is there a way to receive this signal?
>
> I tried an element post processor but at that point the repository has been created but is not yet available to be used
> through normal cdo session/transaction.
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
(no subject) [message #687511 is a reply to message #687229] Fri, 17 June 2011 07:16 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 16.06.2011 23:53, schrieb Martin Taal:
> Hi,
> As an extra info, I tried adding a listener to the container for the event that the repository was added, but when execute on that (and connect to the repository on that event) then I get a stackoverflowerror. So that does not seem to be a good direction either.
Hmm, I would have suggested that an IListener on the container is preferrable over an IElementProcessor. In both cases you should check isActive() on the added container element (your repository) and if it's not yet active add another listener (LifecycleEventAdapter) to that element and postpone your processing. If yu submit a bugzilla I can abstract this pattern in a new ActivationAdapter class because this looks like a common use case.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 06/16/2011 11:26 PM, Martin Taal wrote:
>> Hi,
>> I have some server side code which starts a job which runs on the server and connects to the CDO server. This job should
>> start when the whole osgi app starts but it should get a signal when the repository is ready to connect to. When it gets
>> the signal it can start itself and read info from the repository. Is there a way to receive this signal?
>>
>> I tried an element post processor but at that point the repository has been created but is not yet available to be used
>> through normal cdo session/transaction.
>>
>
>


(no subject) [message #687516 is a reply to message #687232] Fri, 17 June 2011 09:27 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Okay, I will try to add a listener directly to the container. Where do I that? Or can it be done declaratively?

gr. Martin

On 06/17/2011 09:16 AM, Eike Stepper wrote:
> Am 16.06.2011 23:53, schrieb Martin Taal:
>> Hi,
>> As an extra info, I tried adding a listener to the container for the event that the repository was added, but when
>> execute on that (and connect to the repository on that event) then I get a stackoverflowerror. So that does not seem
>> to be a good direction either.
> Hmm, I would have suggested that an IListener on the container is preferrable over an IElementProcessor. In both cases
> you should check isActive() on the added container element (your repository) and if it's not yet active add another
> listener (LifecycleEventAdapter) to that element and postpone your processing. If yu submit a bugzilla I can abstract
> this pattern in a new ActivationAdapter class because this looks like a common use case.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 06/16/2011 11:26 PM, Martin Taal wrote:
>>> Hi,
>>> I have some server side code which starts a job which runs on the server and connects to the CDO server. This job should
>>> start when the whole osgi app starts but it should get a signal when the repository is ready to connect to. When it gets
>>> the signal it can start itself and read info from the repository. Is there a way to receive this signal?
>>>
>>> I tried an element post processor but at that point the repository has been created but is not yet available to be used
>>> through normal cdo session/transaction.
>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
(no subject) [message #687520 is a reply to message #687516] Fri, 17 June 2011 20:03 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6445
Registered: July 2009
Senior Member
Am 17.06.2011 11:27, schrieb Martin Taal:
> Okay, I will try to add a listener directly to the container. Where do I that? Or can it be done declaratively?
Only programmatically I fear:

IPluginContainer.INSTANCE.addListener(new IListener() {...});

I like the idea of being able to do it declaratively, though. Can you file a bugzilla to remind me?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> gr. Martin
>
> On 06/17/2011 09:16 AM, Eike Stepper wrote:
>> Am 16.06.2011 23:53, schrieb Martin Taal:
>>> Hi,
>>> As an extra info, I tried adding a listener to the container for the event that the repository was added, but when
>>> execute on that (and connect to the repository on that event) then I get a stackoverflowerror. So that does not seem
>>> to be a good direction either.
>> Hmm, I would have suggested that an IListener on the container is preferrable over an IElementProcessor. In both cases
>> you should check isActive() on the added container element (your repository) and if it's not yet active add another
>> listener (LifecycleEventAdapter) to that element and postpone your processing. If yu submit a bugzilla I can abstract
>> this pattern in a new ActivationAdapter class because this looks like a common use case.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 06/16/2011 11:26 PM, Martin Taal wrote:
>>>> Hi,
>>>> I have some server side code which starts a job which runs on the server and connects to the CDO server. This job should
>>>> start when the whole osgi app starts but it should get a signal when the repository is ready to connect to. When it gets
>>>> the signal it can start itself and read info from the repository. Is there a way to receive this signal?
>>>>
>>>> I tried an element post processor but at that point the repository has been created but is not yet available to be used
>>>> through normal cdo session/transaction.
>>>>
>>>
>>>
>
>


Previous Topic:Model browser ala MacOSX' finder
Next Topic:(no subject)
Goto Forum:
  


Current Time: Fri Sep 20 15:56:53 GMT 2019

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

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

Back to the top