gogo console commands

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

gogo console commands

Scott Lewis
I've created some custom gogo console commands, and they work fine on
the gogo console in felix.

When I run them on Karaf 4.2.0, however, the command handlers themselves
are executed , but I also use a
org.apache.felix.service.command.Converter so that I can return complex
types (and Lists of complex types) and have the gogo runtime call into
my Converter.format impl for formatting the instances of the complex
return types.

Using a debugger, I can see  my Converter service format method called
by the felix gogo console, but the Converter.format method is never
called in Karaf console, and no output is produced (either than my table
header line written out as String with no conversion).

Has anyone added gogo commands to Karaf that use the Converter services
to convert complex types to output strings?   Is there something else
that needs to be configured in Karaf runtime to allow this?

Thanksinadvance,

Scott

Reply | Threaded
Open this post in threaded view
|

Re: gogo console commands

João Assunção
Hi Scott,

Isn't the Converter service a recent introduction to the OSGi framework? I have the idea the Converter was introduced in OSGi core 7 (release a few weeks ago) and Karaf 4.2.0 is still using OSGi Core 5.
Maybe someone else can confirm this.

Regards,
João Assunção

Mobile: +351 916968984
Phone: +351 211933149



On Fri, May 11, 2018 at 6:23 AM, Scott Lewis <[hidden email]> wrote:
I've created some custom gogo console commands, and they work fine on
the gogo console in felix.

When I run them on Karaf 4.2.0, however, the command handlers themselves
are executed , but I also use a
org.apache.felix.service.command.Converter so that I can return complex
types (and Lists of complex types) and have the gogo runtime call into
my Converter.format impl for formatting the instances of the complex
return types.

Using a debugger, I can see  my Converter service format method called
by the felix gogo console, but the Converter.format method is never
called in Karaf console, and no output is produced (either than my table
header line written out as String with no conversion).

Has anyone added gogo commands to Karaf that use the Converter services
to convert complex types to output strings?   Is there something else
that needs to be configured in Karaf runtime to allow this?

Thanksinadvance,

Scott


Reply | Threaded
Open this post in threaded view
|

Re: gogo console commands

Achim Nierbeck
I thought 4.2 is OSGi Core 6, but besides that you're right, it's certainly not yet OSGi 7 compatible.
Also the GoGo shell isn't upgraded yet. 

regards, Achim

2018-05-11 11:02 GMT+02:00 João Assunção <[hidden email]>:
Hi Scott,

Isn't the Converter service a recent introduction to the OSGi framework? I have the idea the Converter was introduced in OSGi core 7 (release a few weeks ago) and Karaf 4.2.0 is still using OSGi Core 5.
Maybe someone else can confirm this.

Regards,
João Assunção

Mobile: +351 916968984
Phone: +351 211933149



On Fri, May 11, 2018 at 6:23 AM, Scott Lewis <[hidden email]> wrote:
I've created some custom gogo console commands, and they work fine on
the gogo console in felix.

When I run them on Karaf 4.2.0, however, the command handlers themselves
are executed , but I also use a
org.apache.felix.service.command.Converter so that I can return complex
types (and Lists of complex types) and have the gogo runtime call into
my Converter.format impl for formatting the instances of the complex
return types.

Using a debugger, I can see  my Converter service format method called
by the felix gogo console, but the Converter.format method is never
called in Karaf console, and no output is produced (either than my table
header line written out as String with no conversion).

Has anyone added gogo commands to Karaf that use the Converter services
to convert complex types to output strings?   Is there something else
that needs to be configured in Karaf runtime to allow this?

Thanksinadvance,

Scott





--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: gogo console commands

Guillaume Nodet-2
In reply to this post by Scott Lewis

It seems that the karaf console does not track felix Converter services.
Please raise a JIRA to fix that.
In the mean time you should be able to add  one explicitely from the console using:
  > $.processor addConverter $svc
Where $svc is an instance of your converter.

However, it seems there's also a regression in the console which cause return values of commands to not be printed at all, unless they are strings. See KARAF-5748 which I've just fixed.

2018-05-11 7:23 GMT+02:00 Scott Lewis <[hidden email]>:
I've created some custom gogo console commands, and they work fine on
the gogo console in felix.

When I run them on Karaf 4.2.0, however, the command handlers themselves
are executed , but I also use a
org.apache.felix.service.command.Converter so that I can return complex
types (and Lists of complex types) and have the gogo runtime call into
my Converter.format impl for formatting the instances of the complex
return types.

Using a debugger, I can see  my Converter service format method called
by the felix gogo console, but the Converter.format method is never
called in Karaf console, and no output is produced (either than my table
header line written out as String with no conversion).

Has anyone added gogo commands to Karaf that use the Converter services
to convert complex types to output strings?   Is there something else
that needs to be configured in Karaf runtime to allow this?

Thanksinadvance,

Scott




--
------------------------
Guillaume Nodet

Reply | Threaded
Open this post in threaded view
|

Re: gogo console commands

Scott Lewis
Hi Guillaume,

I've opened https://issues.apache.org/jira/browse/KARAF-5750 for tracking/calling converter services.

Thanks,

Scott


On 5/11/2018 6:22 AM, Guillaume Nodet wrote:

It seems that the karaf console does not track felix Converter services.
Please raise a JIRA to fix that.
In the mean time you should be able to add  one explicitely from the console using:
  > $.processor addConverter $svc
Where $svc is an instance of your converter.

However, it seems there's also a regression in the console which cause return values of commands to not be printed at all, unless they are strings. See KARAF-5748 which I've just fixed.

2018-05-11 7:23 GMT+02:00 Scott Lewis <[hidden email]>:
I've created some custom gogo console commands, and they work fine on
the gogo console in felix.

When I run them on Karaf 4.2.0, however, the command handlers themselves
are executed , but I also use a
org.apache.felix.service.command.Converter so that I can return complex
types (and Lists of complex types) and have the gogo runtime call into
my Converter.format impl for formatting the instances of the complex
return types.

Using a debugger, I can see  my Converter service format method called
by the felix gogo console, but the Converter.format method is never
called in Karaf console, and no output is produced (either than my table
header line written out as String with no conversion).

Has anyone added gogo commands to Karaf that use the Converter services
to convert complex types to output strings?   Is there something else
that needs to be configured in Karaf runtime to allow this?

Thanksinadvance,

Scott




--
------------------------
Guillaume Nodet


Reply | Threaded
Open this post in threaded view
|

Re: gogo console commands

jbonofre
Thanks, it sounds good to me.

Regards
JB

On 11/05/2018 17:18, Scott Lewis wrote:

> Hi Guillaume,
>
> I've opened https://issues.apache.org/jira/browse/KARAF-5750 for
> tracking/calling converter services.
>
> Thanks,
>
> Scott
>
>
> On 5/11/2018 6:22 AM, Guillaume Nodet wrote:
>>
>> It seems that the karaf console does not track felix Converter services.
>> Please raise a JIRA to fix that.
>> In the mean time you should be able to add  one explicitely from the
>> console using:
>>   > $.processoraddConverter $svc
>> Where $svc is an instance of your converter.
>>
>> However, it seems there's also a regression in the console which cause
>> return values of commands to not be printed at all, unless they are
>> strings. See KARAF-5748
>> <https://issues.apache.org/jira/browse/KARAF-5748> which I've just fixed.
>>
>> 2018-05-11 7:23 GMT+02:00 Scott Lewis <[hidden email]
>> <mailto:[hidden email]>>:
>>
>>     I've created some custom gogo console commands, and they work fine on
>>     the gogo console in felix.
>>
>>     When I run them on Karaf 4.2.0, however, the command handlers
>>     themselves
>>     are executed , but I also use a
>>     org.apache.felix.service.command.Converter so that I can return
>>     complex
>>     types (and Lists of complex types) and have the gogo runtime call into
>>     my Converter.format impl for formatting the instances of the complex
>>     return types.
>>
>>     Using a debugger, I can see  my Converter service format method
>>     called
>>     by the felix gogo console, but the Converter.format method is never
>>     called in Karaf console, and no output is produced (either than my
>>     table
>>     header line written out as String with no conversion).
>>
>>     Has anyone added gogo commands to Karaf that use the Converter
>>     services
>>     to convert complex types to output strings?   Is there something
>>     else
>>     that needs to be configured in Karaf runtime to allow this?
>>
>>     Thanksinadvance,
>>
>>     Scott
>>
>>
>>
>>
>> --
>> ------------------------
>> Guillaume Nodet
>>
>