Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Adding a custom command via gogo in Virgo 3(Unable to add custom command to shell)
Adding a custom command via gogo in Virgo 3 [message #816703] Fri, 09 March 2012 06:58 Go to next message
Sathyakumar Seshachalam is currently offline Sathyakumar SeshachalamFriend
Messages: 4
Registered: March 2012
Junior Member
Hi,

I am trying to create my own custom command that can be run from the gogo shell. I tried exposing a service with osgi.command.scope and osgi.command.function properties, but these are not picked by felix gogo bundles.

I assume it is because these these bundles are in kernel and not userregion. I trying importing them to no avail. Then tried copying them to pikcup folder. Shell wont even open. Want to know if this is possible at all. (Providing a custom command).

PS: Am new to Virgo

Regards
Sathya
Re: Adding a custom command via gogo in Virgo 3 [message #816708 is a reply to message #816703] Fri, 09 March 2012 07:05 Go to previous messageGo to next message
Lazar Kirchev is currently offline Lazar KirchevFriend
Messages: 30
Registered: July 2009
Location: Sofia, Bulgaria
Member
Hi,

Yes, it is possible to add new commands.
First of all, how do you create your command? You should create your own bundle, which exports the command as service. It is important to remember that the value of the property osgi.command.function should be an array of Strings.
For example, props.set("osgi.command.function", new String[]{"mycommand"});
Then you should place the bundle with the command in pickup - you don't have to copy the gogo bundles in pickup. Actually, the gogo bundles are available both in the kernel and the user regions.

Lazar
Re: Adding a custom command via gogo in Virgo 3 [message #816781 is a reply to message #816708] Fri, 09 March 2012 08:52 Go to previous messageGo to next message
Sathyakumar Seshachalam is currently offline Sathyakumar SeshachalamFriend
Messages: 4
Registered: March 2012
Junior Member
Hello Lazar,

Thanks for the reply. I did create a bundle(spring powered) that exposed a service with the properties that you'd mentioned. I have verified that service is indeed exposed with these properties when deployed. Yet I only get a "CommandNotFound" in the shell. My bundles are actually defined as part of a plan and bundle itself is placed in /repository/usr

Note that I've tested the same bundle using plain equinox (via pax-runner) with felix gogo bundles installed and have found them working there. Only seems to fail in Virgo.

I also did this - set a break point in org.apache.felix.gogo.runtime.Activator that I presume does the actual stuff behind the scenes and remote debugged virgo. I found a couple of hits for the kernel services, but my own bundle's services was never trapped by this Activator's ServiceTracker.

Regards
Sathya

[Updated on: Fri, 09 March 2012 09:28]

Report message to a moderator

Re: Adding a custom command via gogo in Virgo 3 [message #819144 is a reply to message #816781] Mon, 12 March 2012 14:55 Go to previous messageGo to next message
Sathyakumar Seshachalam is currently offline Sathyakumar SeshachalamFriend
Messages: 4
Registered: March 2012
Junior Member
Hi,
If anybody provide a pointer/idea/suggestion, will really appreciate it. My project require one of my services to be invoked via a command line, If it's not going to be feasible, I will have to look at other remoting options

Regards
Sathya
Re: Adding a custom command via gogo in Virgo 3 [message #819155 is a reply to message #819144] Mon, 12 March 2012 15:12 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Is it possible to provide a minimal version of your bundle to reproduce the problem? If so, please raise a bug. It should work no problem, so it's either a bug or a user error. Wink
Re: Adding a custom command via gogo in Virgo 3 [message #820605 is a reply to message #819155] Wed, 14 March 2012 10:29 Go to previous message
Sathyakumar Seshachalam is currently offline Sathyakumar SeshachalamFriend
Messages: 4
Registered: March 2012
Junior Member
Thanks, I filed a bug.
Previous Topic:Snaps-based app doesn't allow welcome files?
Next Topic:Deadlock detected
Goto Forum:
  


Current Time: Thu Mar 28 20:38:45 GMT 2024

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

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

Back to the top