ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | oscar List | December 2005 Index

<--  Date Index  --> <--  Thread Index  -->

UPnPEventListener and Filter


 
I would like to listen to UPnP events coming from a Service with a given
ID. I wrote the following Java code with respect to OSGi R3 spec but I
got this exception at runtime with Domoware UPnP Base Driver 3.0.1 above
Oscar 1.0.5:

org.osgi.framework.InvalidSyntaxException: expected filtercomp
        at org.ungoverned.oscar.FilterImpl.<init>(FilterImpl.java:88)
        at
org.ungoverned.oscar.Oscar.getServiceReferences(Oscar.java:2792)
        at
org.ungoverned.oscar.BundleContextImpl.getServiceReferences(BundleContex
tImpl.java:246)
        at
it.cnr.isti.niche.osgi.upnp.basedriver.importer.core.MyCtrlPoint.service
Changed(MyCtrlPoint.java:450)
        at
org.ungoverned.oscar.util.ServiceListenerWrapper.serviceChanged(ServiceL
istenerWrapper.java:129)
        at org.ungoverned.oscar.Oscar$7.dispatch(Oscar.java:3584)
        at
org.ungoverned.oscar.util.OscarDispatchQueue.dispatch(OscarDispatchQueue
.java:92)
        at org.ungoverned.oscar.Oscar.fireServiceEvent(Oscar.java:3590)
        at org.ungoverned.oscar.Oscar.registerService(Oscar.java:2755)
        at
org.ungoverned.oscar.BundleContextImpl.registerService(BundleContextImpl
.java:143)
        at
org.ungoverned.oscar.BundleContextImpl.registerService(BundleContextImpl
.java:137)
        at
com.francetelecom.upnp.controlpoint.UPnPEventTest.test(UPnPEventTest.jav
a:1259)


Source code:
                UPnPEventListener listener = new UPnPEventListener(){
                        public void notifyUPnPEvent(String arg0, String
arg1, Dictionary arg2) {
                        }
                };
                Properties p = new Properties();
                p.put(UPnPEventListener.UPNP_FILTER, new Filter(){
                        public boolean match(ServiceReference ref) {
                                System.out.println("?????? Matching
Service Reference:" + ref);
                                return false;
                        }
                        public boolean match(Dictionary dict) {
                                boolean matchesService =
dict.get(UPnPService.ID).equals(s.getService().getId());
                                if(matchesService){
                                        return true;
                                }
                                return false;
                        }}
                );
        
context.getBundleContext().registerService(UPnPEventListener.class.getNa
me(), listener, p); // UPnPEventTest.java:1259

        



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.