I have two platforms - the host for exporting...and the server

The routine for counting the "different" devices was the following on the
server side:


public class EventListener implements UPnPEventListener {

        private ArrayList<String> knownDevs = new ArrayList<String>();
        
        @Override
        public synchronized void notifyUPnPEvent(String deviceId, String
serviceId, Dictionary events) {
                String output = "";
                output += deviceId + " " + serviceId;
                
                Enumeration eventit = events.keys();
                
                while (eventit.hasMoreElements()) {
                        String key = (String) eventit.nextElement();
                        output += key + " " + events.get(key) + "\n";
                }
                                
                if (!knownDevs.contains(deviceId)) {
                        knownDevs.add(deviceId);
                }
                System.err.println(output + "#diff Devices:" +
knownDevs.size());
                System.err.flush();
                
        }

}

Registered in the following activator:

public class Activator implements BundleActivator {

        private ServiceRegistration servReg;
        
        /*
         * (non-Javadoc)
         * @see
org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
         */
        public void start(BundleContext context) throws Exception {
                EventListener test = new EventListener();
                servReg =
context.registerService(UPnPEventListener.class.getName(), test, null);
        }

        /*
         * (non-Javadoc)
         * @see
org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
         */
        public void stop(BundleContext context) throws Exception {
                servReg.unregister();
        }

}




-----Ursprüngliche Nachricht-----
Von: Francesco Furfari [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 24. Juli 2008 15:49
An: [email protected]
Betreff: Re: AW: AW: AW: AW: AW: AW: bug in felix upnp basedriver 0.8 - and
one more addition.... forgot one thing!

No I mean the routine you use for counting the devices sending a notify.
That's, the code implementing the subscription.
basically you are running all the UPnP related code on the same felix 
runtime.

francesco


Daniel Felsing wrote:
> With listener routine you mean the UPnPEventNotifier?
> Yes...my devices are "EventSources" using the propertyChange thing
> 
> switchDev is an EventSource
> 
> I register them with the notifier in that line:
>>              notify_switch = new UPnPEventNotifier(context, this,
> switchdevswitchservice, switchDev);
> 
> 
> 
> BUT: when i startup my whole host and switch no devices the
> propertychangelistener isnt used, only when the basedriver devices state
> changes....
> but "getCurrentValue" is responsible for Retrieving the "initial" values,
or
> am i wrong? For further detail on that see my last post on the mailing
list
> i did some testing and presented you some results there.
> 
> I paste you the content of it here:
> 
> Hello,
> 
> ok what i did now was the following.
> In the upnplocalstatevariable implementations i put into getCurrentValue
> some debug code so i can see when it is called.
> 
> On the host i now exported my 17 devices to see which oft he
getCurrentValue
> methods get called.
> Only 16 devices got called! This time S20_Switch7 was missing...
> 
> Now i looked at upnp felix tester - cause that must be the device which
> should send me no events on subscription But u know what? I can subscribe
to
> the event and get the values delivered...
> 
> I thought that upon subscription of the device i should see something on
my
> hosts log window...but nothing
> 
> I rechecked upnp felix tester cause i wanted to find the actual device
which
> i am not able to subscribe..cause it must be another one then.
> 
> And now it gets funny....service/variable i cant subscribe is EXACTLY the
> device which is found before Switch7...and the the last service of it
> 
> 
> Maybe this can lead u to something?
> 
> Kind regards,
> Daniel Felsing
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to