You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Sam Hendley <sh...@greenenergycorp.com> on 2011/07/05 17:23:21 UTC

Re: Console extensions without blueprint

Hello, I am trying to register commands without using blueprint but I am
running into issues and I wonder if I am fighting a losing battle.

I based what I was doing on a mailing-list thread from January:
http://karaf.922171.n3.nabble.com/Console-extensions-without-blueprint-td2305019.html

I have been able to get the command somewhat registered without blueprint
but they are not functional when executed.

karaf@root> sim:list
Error executing command: Cannot coerce list() to any of []

I believe what is occurring is when blueprint processes the command-bundle
it builds a "proxy" Function object that handles the argument parsing and
handling. Is that wrapping functionality exposed outside of blueprint?

Below is the ls output of my self-publishing attempt (63) and the blueprint
created command (62).

--------------------------------------------------------------------------------------
karaf@root> ls -a 63

Reef Protocol Simulator (63) provides:
--------------------------------------
objectClass = org.totalgrid.reef.protocol.api.Protocol
protocol = benchmark
service.id = 237
----
objectClass = org.apache.felix.gogo.commands.Action
osgi.command.function = list
osgi.command.scope = sim
service.id = 238
karaf@root> ls -a 62

Reef Admin Shell Extension (62) provides:
-----------------------------------------
objectClass = org.apache.karaf.shell.console.CompletableFunction,
org.apache.felix.service.command.Function
osgi.command.function = resetdb
osgi.command.scope = reef
service.id = 172

------------------------------------------------------------------------------------------

If need be I believe I can switch everything to blueprint but if it is
possible I would like to avoid that (without re-implementing too much of the
command handling code).

Thanks,
Sam Hendley

Re: Console extensions without blueprint

Posted by mikevan <mv...@comcast.net>.

Sam, 



I would suggest attempting to implement your console extension using blueprint first to see if this fixes your issue.  With few exceptions, I've found that converting webconsole extensions from SpringDM to Blueprint to be fairly painless. 



I hope that helps. 



----- Original Message -----


From: "Sam Hendley [via Karaf]" <ml...@n3.nabble.com> 
To: "mikevan" <mv...@comcast.net> 
Sent: Tuesday, July 5, 2011 11:24:09 AM 
Subject: Re: Console extensions without blueprint 

Hello, I am trying to register commands without using blueprint but I am running into issues and I wonder if I am fighting a losing battle. 


I based what I was doing on a mailing-list thread from January:  http://karaf.922171.n3.nabble.com/Console-extensions-without-blueprint-td2305019.html 


I have been able to get the command somewhat registered without blueprint but they are not functional when executed. 




karaf@root> sim:list 
Error executing command: Cannot coerce list() to any of [] 


I believe what is occurring is when blueprint processes the command-bundle it builds a "proxy" Function object that handles the argument parsing and handling. Is that wrapping functionality exposed outside of blueprint? 


Below is the ls output of my self-publishing attempt (63) and the blueprint created command (62). 


-------------------------------------------------------------------------------------- 

karaf@root> ls -a 63 


Reef Protocol Simulator (63) provides: 
-------------------------------------- 
objectClass = org.totalgrid.reef.protocol.api.Protocol 
protocol = benchmark 
service.id = 237 
---- 
objectClass = org.apache.felix.gogo.commands.Action 
osgi.command.function = list 
osgi.command.scope = sim 
service.id = 238 
karaf@root> ls -a 62 


Reef Admin Shell Extension (62) provides: 
----------------------------------------- 
objectClass = org.apache.karaf.shell.console.CompletableFunction, org.apache.felix.service.command.Function 
osgi.command.function = resetdb 
osgi.command.scope = reef 
service.id = 172 


------------------------------------------------------------------------------------------ 


If need be I believe I can switch everything to blueprint but if it is possible I would like to avoid that (without re-implementing too much of the command handling code). 


Thanks,  
Sam Hendley 







If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/Re-Console-extensions-without-blueprint-tp3141216p3141216.html 
To start a new topic under Karaf - User, email ml-node+930749-917263437-228489@n3.nabble.com 
To unsubscribe from Karaf - User, click here .

-----
Mike Van
--
View this message in context: http://karaf.922171.n3.nabble.com/Re-Console-extensions-without-blueprint-tp3141216p3141279.html
Sent from the Karaf - User mailing list archive at Nabble.com.