felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabio Fonseca <fabio.l.fons...@gmail.com>
Subject Re: Felix Shell command to execute commands - concurrency issue
Date Sun, 04 Mar 2012 23:01:49 GMT

Hi Richard,

Thanks for your quick reply!

I have not implemented any asynchronous behavior neither in my command nor
in the other bundles I'm trying to start/stop, hence my question.

Perhaps I'm just not understanding how it works. Let me try to explain it
better. I have 3 bundles with one iPOJO component each. For all the 3
components I have specified in their iPOJO metadata callbacks for the
validate and invalidate transitions. So, when I start one of these
components bundle, I see a message in the screen. The same happens when I
stop its bundle. I have also put a println in my command just before it
calls the command.execute() method. So, when I execute the start or stop
command for one of these bundles, I expect to see my command message and the
validate/invalidate message in the shell console before I am able to execute
the next command in the text file.

The thing is: when I execute a series of stop commands, the messages are
displayed in the shell console in the expected order:

Executing "stop 13"
Invalidate transition for bundle 13 called!
Executing "stop 14"
Invalidate transition for bundle 14 called!
Executing "stop 15"
Invalidate transition for bundle 15 called!

However, when I execute a series of start methods I get:

Executing "start 13"
Executing "start 14"
Executing "start 15"
Validate transition for bundle 13 called!
Validate transition for bundle 14 called!
Validate transition for bundle 15 called!

Maybe the asynchrony is in the start command? Am I missing something here?

Thanks!
Fabio Fonseca

P.S.: You mentioned "the old Felix shell" in your message. Is there a new
one?


Richard S. Hall wrote:
> 
> If there is any asynchronous behavior, then it is either in your bundle 
> or the bundles you are starting, the old Felix shell is synchronous.
> 
> -> richard
> 
> p.s. You should probably do a refresh after your update.
> 
> On 3/4/12 4:48 PM, Fabio Fonseca wrote:
>> Hello!
>>
>> I'm having a problem creating one new command to the Felix Shell 1.4.2.
>> My
>> command just reads one text file and issues other commands. In my text
>> file,
>> I would have, for example:
>>
>> start 14
>> start 15
>> update 13
>> start 13
>>
>> Is is working but I'm having problems regarding the order in which these
>> command get executed. I need it to wait for the bundle 14 to be
>> effectively
>> started and only than issue the "start 15" command. But this is not
>> happening. It sounds like it is creating one thread for each line of my
>> text
>> file and they are all executing concurrently.
>>
>> To create my command I have just took a look at the source code for the
>> shell 1.4.2 and done the command.execute the same way it is been done
>> there.
>>
>> How can I make sure the command execution is done synchronously instead
>> of
>> asynchronously, as it seems to be?
>>
>> Thanks in advance!
>> Fabio Fonseca
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Felix-Shell-command-to-execute-commands---concurrency-issue-tp33440097p33440422.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message