[ 
https://issues.apache.org/jira/browse/DOSGI-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042066#comment-13042066
 ] 

Michal Kutyla edited comment on DOSGI-24 at 6/1/11 9:45 AM:
------------------------------------------------------------

It is not fixed.
It will work if service interface is extended by other INTERFACE(so does in 
example with ArrayList and Collection). 
It won't work if service interface is implemented by super CLASS.
I couldn't find example in JDK so imagine that you have:

class A extends B {...}
class B implements C {...}
interface C {...}

Now, when you call Classutils.getInterfaceClass(new A(), "C") it will return 
null.

      was (Author: fido):
    It is not fixed.
It will work if service interface is extended by other interface (so does in 
example with ArrayList and Collection). 
It won't work if service interface is implemented by super CLASS.
I couldn't find example in JDK so imagine that you have:

class A extends B {...}
class B implements C {...}
interface C {...}

Now, when you call Classutils.getInterfaceClass(new A(), "C") it will return 
null.
  
> org.apache.cxf.dosgi.dsw.ClassUtils#getInterfaceClass() method should search 
> through super class interfaces too
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: DOSGI-24
>                 URL: https://issues.apache.org/jira/browse/DOSGI-24
>             Project: CXF Distributed OSGi
>          Issue Type: Bug
>         Environment: any
>            Reporter: Sergey Bokovikov
>            Assignee: David Bosschaert
>            Priority: Minor
>             Fix For: 1.2
>
>
> ServiceHookUtils won't publish OSGi service if service interface implemented 
> by super class. For example, java.util.ArrayList instance can be published as 
> java.util.List service but not as java.util.Collections: 
>     <osgi:service interface="java.util.Collection"> <!-- can't publish-->
>         <osgi:service-properties>
>             <entry key="osgi.remote.interfaces" value="*"/>
>             <entry key="osgi.remote.configuration.type" value="pojo"/>
>             <entry key="osgi.remote.configuration.pojo.httpservice.context" 
> value="/collection"/>
>         </osgi:service-properties>
>         <bean class="java.util.ArrayList"/>
>     </osgi:service>
>     <osgi:service interface="java.util.List"> <!-- published ok-->
>         <osgi:service-properties>
>             <entry key="osgi.remote.interfaces" value="*"/>
>             <entry key="osgi.remote.configuration.type" value="pojo"/>
>             <entry key="osgi.remote.configuration.pojo.httpservice.context" 
> value="/list"/>
>         </osgi:service-properties>
>         <bean class="java.util.ArrayList"/>
>     </osgi:service>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to