I have tested this on Equinox Kepler M5a and it works for me.
My test case is a simple extension to the Declarative Services example created
by bndtools:
package org.example;
import aQute.bnd.annotation.component.*;
@Component(immediate = true,
provide = Object.class, properties = {
"osgi.command.scope=test",
"osgi.command.function:String=" +
"testCase1|testcase2" })
public class ExampleComponent {
public String testCase1() {
return "hello from testCase1";
}
public String testcase2() {
return "hello from testcase2";
}
}
I am starting equinox using:
mkdir kepler
cd kepler
unzip ../equinox-SDK-KeplerM5a.zip
cp /path/to/org.apache.felix.scr-1.6.2.jar .
cp path/to/test.gogo.jar .
mkdir configuration
cat > configuration/config.ini
osgi.bundles.defaultStartLevel=4
osgi.noShutdown=true
eclipse.ignoreApp=true
osgi.bundles=\
../plugins/org.eclipse.equinox.console_1.0.100.v20121210-201919.jar,\
../plugins/org.apache.felix.gogo.command_0.8.0.v201108120515.jar,\
../plugins/org.apache.felix.gogo.runtime_0.8.0.v201108120515.jar,\
../plugins/org.apache.felix.gogo.shell_0.8.0.v201110170705.jar,\
../org.apache.felix.scr-1.6.2.jar,\
../test.gogo.jar
^D
java -jar plugins/org.eclipse.osgi_3.9.0.v20130128-202223.jar \
-configuration configuration -console -consoleLog
osgi> lb
START LEVEL 6
ID|State |Level|Name
0|Active | 0|OSGi System Bundle (3.9.0.v20130128-202223)
1|Active | 4|Console plug-in (1.0.100.v20121210-201919)
2|Active | 4|Apache Felix Gogo Command (0.8.0.v201108120515)
3|Active | 4|Apache Felix Gogo Runtime (0.8.0.v201108120515)
4|Active | 4|Apache Felix Gogo Shell (0.8.0.v201110170705)
5|Resolved | 4|Apache Felix Declarative Services (1.6.2)
6|Resolved | 4|test.gogo (0.0.0)
osgi> start 5
osgi> start 6
osgi> type test:
test:testcase1
test:testcase2
true
osgi> type -t testcase1
String org.example.ExampleComponent.testCase1()
true
osgi> type -t testCase2
String org.example.ExampleComponent.testcase2()
true
osgi> testcase1
hello from testCase1
osgi> testcase2
hello from testcase2
osgi> system:exit 0
--
Derek
On 20 Mar 2013, at 19:13, Cristiano Gavião <[email protected]> wrote:
> well, I'm using Gogo with Equinox Kepler. so the only explanation is that
> the problem is in the org.eclipse.equinox.console bundle.
>
> The fact is that it worked when I change the method name to all lowercase.
>
> this is the class method:
>
> @Descriptor("Run stories with an annotated embedder runner.")
> public void runstorieswithannotatedembedderrunner(@Descriptor("class
> names") String classNames) {
>
> }
>
> and this is how I register it (using DS):
>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
> immediate="true" name="Command Provider for JBehave Embedder Service">
> <implementation class="org.jbehave.osgi.commands.RunStories"/>
> <service>
> <provide interface="org.jbehave.osgi.commands.RunStories"/>
> </service>
> <reference bind="bindJbehaveExecutionService" cardinality="1..1"
> interface="org.jbehave.osgi.core.service.IJbehaveExecutionService"
> name="JBehaveService" policy="static"
> unbind="unbindJbehaveExecutionService"/>
> <property name="osgi.command.scope" type="String" value="jbehave"/>
> <property name="osgi.command.function">
> runstorieswithannotatedembedderrunner
> </property>
> </scr:component>
>
> thanks
>
> 2013/3/20 Richard S. Hall <[email protected]>
>
>> I tried and it appears to be working for me. Not sure what's up. I took
>> the Gogo Command bundle and modified frameworklevel() to be
>> frameworkLevel() and it worked. Make sure you are doing whatever it does.
>>
>> -> richard
>>
>>
>> On 3/20/13 14:18 , Cristiano Gavião wrote:
>>
>>> Hi Richard,
>>>
>>> nothing against it ignore cases.
>>>
>>> the the big problem is that it is requiring that the method name be all
>>> lowercase.
>>>
>>> it is completely ignoring this method:
>>>
>>> @Descriptor("Run stories with an annotated embedder runner.")
>>> public void runStoriesWithAnnotatedEmbedde**
>>> rRunner(@Descriptor("class
>>> names") String classNames) {
>>>
>>> }
>>>
>>> even if I register it as "**runstorieswithannotatedembedde**rrunner"
>>>
>>> 2013/3/20 Richard S. Hall <[email protected]>
>>>
>>> I think that Gogo effectively ignores case, as you can see here:
>>>>
>>>> g! lb
>>>> START LEVEL 1
>>>> ID|State |Level|Name
>>>> 0|Active | 0|System Bundle (4.3.0.SNAPSHOT)
>>>> 1|Active | 1|Apache Felix Bundle Repository (1.6.6)
>>>> 2|Active | 1|Apache Felix Gogo Command (0.12.0)
>>>> 3|Active | 1|Apache Felix Gogo Runtime (0.10.0)
>>>> 4|Active | 1|Apache Felix Gogo Shell (0.10.0)
>>>> g! LB
>>>> START LEVEL 1
>>>> ID|State |Level|Name
>>>> 0|Active | 0|System Bundle (4.3.0.SNAPSHOT)
>>>> 1|Active | 1|Apache Felix Bundle Repository (1.6.6)
>>>> 2|Active | 1|Apache Felix Gogo Command (0.12.0)
>>>> 3|Active | 1|Apache Felix Gogo Runtime (0.10.0)
>>>> 4|Active | 1|Apache Felix Gogo Shell (0.10.0)
>>>> g!
>>>>
>>>> -> richard
>>>>
>>>>
>>>> On 3/20/13 13:59 , Cristiano Gavião wrote:
>>>>
>>>> Hello,
>>>>>
>>>>> I'm trying to register some commands in GoGo but I'm get problems when
>>>>> using a method name with uppercase and lowercase:
>>>>>
>>>>> The service is being registered but the command is being created by
>>>>> gogo.
>>>>> If I remove the uppercase it handle the function properly.
>>>>>
>>>>> {org.jbehave.osgi.commands.****RunStoriesWithAnnotatedEmbedde****
>>>>> rRunner}={osgi.command.****function=[runAs],
>>>>>
>>>>> component.name=Command Provider for JBehave Embedder Service,
>>>>> component.id=3,
>>>>> osgi.command.scope=jbehave, service.id=73}
>>>>>
>>>>> Is this a bug?
>>>>>
>>>>> thanks,
>>>>>
>>>>> Cristiano
>>>>>
>>>>>
>>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail:
>>>> users-unsubscribe@felix.**apac**he.org<http://apache.org>
>>>> <users-unsubscribe@**felix.apache.org<[email protected]>
>>>>>
>>>>
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>>
>>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail:
>> users-unsubscribe@felix.**apache.org<[email protected]>
>> For additional commands, e-mail: [email protected]
>>
>>
>
>
> --
> "Tudo vale a pena se a alma não é pequena..."