You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Alexander Broekhuis <a....@gmail.com> on 2009/12/11 08:41:11 UTC

[DOSGI] ServiceListener without objectClass

Hi all,

I am trying to use a service listener that handles all imported interfaces,
without knowing what the actual interface is. To do this, I created a
service listener with the following filter: (service.imported=true).
But this doesn't work.

In the CxfFindListenerHook there is a check to see if objectClass is filled
in. If this is not the case, the discovery is not accessed to look for
remote services.
I know the imported property is only set on the imported proxy registration,
and not part of the actual remote service. So it isn't published in
discovery. This would mean that the service listener will be notified of all
remote services found in the discovery, which is exactly what I want.

Is this something I can solve differently?
If not, is this a bug/feature request?


Thanx in advance,

-- 
Met vriendelijke groet,

Alexander Broekhuis

Re: [DOSGI] ServiceListener without objectClass

Posted by David Bosschaert <da...@gmail.com>.
Hi Alexander,

The refactoring work should probably be finished some time in January.
You can certainly look at the code and provide a patch. The Discovery
code is here: http://svn.apache.org/repos/asf/cxf/dosgi/trunk/discovery/distributed/cxf-discovery
although it shares some code with the local discovery which you can
find here: http://svn.apache.org/repos/asf/cxf/dosgi/trunk/discovery/local

In the mean time you could also think about a workaround. You could,
in a separate bundle, register one or more ServiceTrackers that have
the objectClass set in their filters. This will trigger discovery and
will also inform your ServiceTrackers/ServiceListeners that don't have
their objectClass set. Once the fix is available you could simply
remove that bundle and things should continue to work... Just an idea.

Best regards,

David

2009/12/11 Alexander Broekhuis <a....@gmail.com>:
> David,
>
> I have seen the message about the remote service admin spec. Is there any
> estimate when this will be done?
>
> Currently I actually need it to do the things I want. Where do I have to
> look in the source code to get it to work like I suggested? Maybe I can
> create a patch for my specific use case.
>
> I filed a jira issue for the request:
> https://issues.apache.org/jira/browse/CXF-2580
>
> Alexander
>
> On Fri, Dec 11, 2009 at 12:37 PM, David Bosschaert <
> david.bosschaert@gmail.com> wrote:
>
>> Hi Alexander,
>>
>> Yes, at the moment the discovery implementation relies on the
>> objectClass being set. The reasoning behind this relates to
>> scalability. If you have a large distributed discovery system you
>> probably don't want to select all the available remote services in the
>> system, as that could bring in a huge amount of remote services. Since
>> objectClass is typically known to the consumer we added this as a
>> criterium.
>>
>> However, I do see that this can be useful in smaller systems. So I
>> agree that it would be worth enhancing the implementation to support
>> your use case (feel free to file a JIRA :)
>>
>> Just a note, you may have seen this message:
>>
>> http://old.nabble.com/Migrating-CXF-DOSGi-to-be-complaint-with-the-new-OSGi-Remote-Service--Admin-spec-td26645023.html
>>
>> We're currently in the process of refactoring the CXF-DOSGi
>> implementation to be compliant with the new Remote Service Admin spec.
>> I think it would be good to look at your enhancement request after
>> that refactoring is complete.
>>
>> Best regards,
>>
>> David
>>
>> 2009/12/11 Alexander Broekhuis <a....@gmail.com>:
>> > Hi all,
>> >
>> > I am trying to use a service listener that handles all imported
>> interfaces,
>> > without knowing what the actual interface is. To do this, I created a
>> > service listener with the following filter: (service.imported=true).
>> > But this doesn't work.
>> >
>> > In the CxfFindListenerHook there is a check to see if objectClass is
>> filled
>> > in. If this is not the case, the discovery is not accessed to look for
>> > remote services.
>> > I know the imported property is only set on the imported proxy
>> registration,
>> > and not part of the actual remote service. So it isn't published in
>> > discovery. This would mean that the service listener will be notified of
>> all
>> > remote services found in the discovery, which is exactly what I want.
>> >
>> > Is this something I can solve differently?
>> > If not, is this a bug/feature request?
>> >
>> >
>> > Thanx in advance,
>> >
>> > --
>> > Met vriendelijke groet,
>> >
>> > Alexander Broekhuis
>> >
>>
>
>
>
> --
> Met vriendelijke groet,
>
> Alexander Broekhuis
>

Re: [DOSGI] ServiceListener without objectClass

Posted by Alexander Broekhuis <a....@gmail.com>.
David,

I have seen the message about the remote service admin spec. Is there any
estimate when this will be done?

Currently I actually need it to do the things I want. Where do I have to
look in the source code to get it to work like I suggested? Maybe I can
create a patch for my specific use case.

I filed a jira issue for the request:
https://issues.apache.org/jira/browse/CXF-2580

Alexander

On Fri, Dec 11, 2009 at 12:37 PM, David Bosschaert <
david.bosschaert@gmail.com> wrote:

> Hi Alexander,
>
> Yes, at the moment the discovery implementation relies on the
> objectClass being set. The reasoning behind this relates to
> scalability. If you have a large distributed discovery system you
> probably don't want to select all the available remote services in the
> system, as that could bring in a huge amount of remote services. Since
> objectClass is typically known to the consumer we added this as a
> criterium.
>
> However, I do see that this can be useful in smaller systems. So I
> agree that it would be worth enhancing the implementation to support
> your use case (feel free to file a JIRA :)
>
> Just a note, you may have seen this message:
>
> http://old.nabble.com/Migrating-CXF-DOSGi-to-be-complaint-with-the-new-OSGi-Remote-Service--Admin-spec-td26645023.html
>
> We're currently in the process of refactoring the CXF-DOSGi
> implementation to be compliant with the new Remote Service Admin spec.
> I think it would be good to look at your enhancement request after
> that refactoring is complete.
>
> Best regards,
>
> David
>
> 2009/12/11 Alexander Broekhuis <a....@gmail.com>:
> > Hi all,
> >
> > I am trying to use a service listener that handles all imported
> interfaces,
> > without knowing what the actual interface is. To do this, I created a
> > service listener with the following filter: (service.imported=true).
> > But this doesn't work.
> >
> > In the CxfFindListenerHook there is a check to see if objectClass is
> filled
> > in. If this is not the case, the discovery is not accessed to look for
> > remote services.
> > I know the imported property is only set on the imported proxy
> registration,
> > and not part of the actual remote service. So it isn't published in
> > discovery. This would mean that the service listener will be notified of
> all
> > remote services found in the discovery, which is exactly what I want.
> >
> > Is this something I can solve differently?
> > If not, is this a bug/feature request?
> >
> >
> > Thanx in advance,
> >
> > --
> > Met vriendelijke groet,
> >
> > Alexander Broekhuis
> >
>



-- 
Met vriendelijke groet,

Alexander Broekhuis

Re: [DOSGI] ServiceListener without objectClass

Posted by David Bosschaert <da...@gmail.com>.
Hi Alexander,

Yes, at the moment the discovery implementation relies on the
objectClass being set. The reasoning behind this relates to
scalability. If you have a large distributed discovery system you
probably don't want to select all the available remote services in the
system, as that could bring in a huge amount of remote services. Since
objectClass is typically known to the consumer we added this as a
criterium.

However, I do see that this can be useful in smaller systems. So I
agree that it would be worth enhancing the implementation to support
your use case (feel free to file a JIRA :)

Just a note, you may have seen this message:
http://old.nabble.com/Migrating-CXF-DOSGi-to-be-complaint-with-the-new-OSGi-Remote-Service--Admin-spec-td26645023.html

We're currently in the process of refactoring the CXF-DOSGi
implementation to be compliant with the new Remote Service Admin spec.
I think it would be good to look at your enhancement request after
that refactoring is complete.

Best regards,

David

2009/12/11 Alexander Broekhuis <a....@gmail.com>:
> Hi all,
>
> I am trying to use a service listener that handles all imported interfaces,
> without knowing what the actual interface is. To do this, I created a
> service listener with the following filter: (service.imported=true).
> But this doesn't work.
>
> In the CxfFindListenerHook there is a check to see if objectClass is filled
> in. If this is not the case, the discovery is not accessed to look for
> remote services.
> I know the imported property is only set on the imported proxy registration,
> and not part of the actual remote service. So it isn't published in
> discovery. This would mean that the service listener will be notified of all
> remote services found in the discovery, which is exactly what I want.
>
> Is this something I can solve differently?
> If not, is this a bug/feature request?
>
>
> Thanx in advance,
>
> --
> Met vriendelijke groet,
>
> Alexander Broekhuis
>