felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r674879 [3/12] - in /felix/trunk/upnp: ./ basedriver/ basedriver/src/main/java/org/apache/felix/upnp/basedriver/ basedriver/src/main/java/org/apache/felix/upnp/basedriver/controller/ basedriver/src/main/java/org/apache/felix/upnp/basedriver...
Date Tue, 08 Jul 2008 16:59:57 GMT
Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/ListenerUnRegistration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/ListenerUnRegistration.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/ListenerUnRegistration.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/SidExipired.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/SidExipired.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/SidExipired.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/SidExipired.java Tue Jul  8 09:59:54 2008
@@ -1,44 +1,44 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.message;
-
-import org.cybergarage.upnp.Service;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class SidExipired {
-private String sid;
-private Service service;
-/**
-	 * @param sid
-	 */
-	public SidExipired(String sid,Service service) {
-		super();
-		this.sid = sid;
-		this.service=service;
-	}
-	public String getSid(){
-		return sid;
-	}
-	public Service getService(){
-		return service;
-	}
-}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.message;
+
+import org.cybergarage.upnp.Service;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class SidExipired {
+private String sid;
+private Service service;
+/**
+	 * @param sid
+	 */
+	public SidExipired(String sid,Service service) {
+		super();
+		this.sid = sid;
+		this.service=service;
+	}
+	public String getSid(){
+		return sid;
+	}
+	public Service getService(){
+		return service;
+	}
+}

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/SidExipired.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/SidExipired.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/SidExipired.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/StateChanged.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/StateChanged.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/StateChanged.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/StateChanged.java Tue Jul  8 09:59:54 2008
@@ -1,80 +1,80 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.message;
-
-import java.util.Dictionary;
-
-import org.cybergarage.upnp.Device;
-import org.cybergarage.upnp.Service;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class StateChanged {
-	private String sid;
-	private Dictionary dic;
-	private long seq;
-	private Service service;
-	private Device device;
-	/**
-	 * @param sid
-	 * @param dic
-	 * @param varName
-	 * @param varValue
-	 */
-	public StateChanged(String sid, long seq, Dictionary dic, Device device,
-			Service service) {
-		super();
-		this.sid = sid;
-		/*
-		 * this.varName = varName; this.varValue = varValue;
-		 */
-		this.dic = dic;
-		/* dic.put(this.varName, this.varValue); */
-		//this.service=service;
-		this.seq = seq;
-		this.device = device;
-		this.service = service;
-	}
-
-	public Dictionary getDictionary() {
-		return dic;
-	}
-	public String getSid() {
-		return sid;
-	}
-	/*
-	 * public String getVarName() { return varName; } public String
-	 * getVarValue() { return varValue; }
-	 */
-	public long getSeq() {
-		return seq;
-	}
-	/*
-	 * public Service getService(){ return service; }
-	 *  
-	 */
-	public String getDeviceID() {
-		return device.getUDN();
-	}
-	public String getServiceID() {
-		return service.getServiceID();
-	}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.message;
+
+import java.util.Dictionary;
+
+import org.cybergarage.upnp.Device;
+import org.cybergarage.upnp.Service;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class StateChanged {
+	private String sid;
+	private Dictionary dic;
+	private long seq;
+	private Service service;
+	private Device device;
+	/**
+	 * @param sid
+	 * @param dic
+	 * @param varName
+	 * @param varValue
+	 */
+	public StateChanged(String sid, long seq, Dictionary dic, Device device,
+			Service service) {
+		super();
+		this.sid = sid;
+		/*
+		 * this.varName = varName; this.varValue = varValue;
+		 */
+		this.dic = dic;
+		/* dic.put(this.varName, this.varValue); */
+		//this.service=service;
+		this.seq = seq;
+		this.device = device;
+		this.service = service;
+	}
+
+	public Dictionary getDictionary() {
+		return dic;
+	}
+	public String getSid() {
+		return sid;
+	}
+	/*
+	 * public String getVarName() { return varName; } public String
+	 * getVarValue() { return varValue; }
+	 */
+	public long getSeq() {
+		return seq;
+	}
+	/*
+	 * public Service getService(){ return service; }
+	 *  
+	 */
+	public String getDeviceID() {
+		return device.getUDN();
+	}
+	public String getServiceID() {
+		return service.getServiceID();
+	}
 }

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/StateChanged.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/StateChanged.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/message/StateChanged.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Listener2Sids.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Listener2Sids.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Listener2Sids.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Listener2Sids.java Tue Jul  8 09:59:54 2008
@@ -1,58 +1,58 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.structs;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.osgi.service.upnp.UPnPEventListener;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class Listener2Sids {
-	private Hashtable listenerSid;
-    
-	public Listener2Sids() {
-		this.listenerSid = new Hashtable();
-	}
-    
-	public void put(UPnPEventListener listener, String sid) {
-		if (!listenerSid.containsKey(listener)) {
-			Vector vec = new Vector();
-			vec.add(sid);
-			listenerSid.put(listener, vec);
-		} else {
-			Vector vec = (Vector) listenerSid.get(listener);
-			if (!vec.contains(sid)) {
-				vec.add(sid);
-			}
-		}
-	}
-    
-	public final void remove(UPnPEventListener listener) {
-		listenerSid.remove(listener);
-	}
-
-	public final Vector get(UPnPEventListener listener) {
-		return ((Vector) listenerSid.get(listener));
-	}
-}
-
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.structs;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.osgi.service.upnp.UPnPEventListener;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class Listener2Sids {
+	private Hashtable listenerSid;
+    
+	public Listener2Sids() {
+		this.listenerSid = new Hashtable();
+	}
+    
+	public void put(UPnPEventListener listener, String sid) {
+		if (!listenerSid.containsKey(listener)) {
+			Vector vec = new Vector();
+			vec.add(sid);
+			listenerSid.put(listener, vec);
+		} else {
+			Vector vec = (Vector) listenerSid.get(listener);
+			if (!vec.contains(sid)) {
+				vec.add(sid);
+			}
+		}
+	}
+    
+	public final void remove(UPnPEventListener listener) {
+		listenerSid.remove(listener);
+	}
+
+	public final Vector get(UPnPEventListener listener) {
+		return ((Vector) listenerSid.get(listener));
+	}
+}
+

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Listener2Sids.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Listener2Sids.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Listener2Sids.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Monitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Monitor.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Monitor.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Monitor.java Tue Jul  8 09:59:54 2008
@@ -1,234 +1,234 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.structs;
-
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.cybergarage.upnp.Service;
-
-import org.osgi.service.upnp.UPnPEventListener;
-
-import org.apache.felix.upnp.basedriver.importer.core.MyCtrlPoint;
-import org.apache.felix.upnp.basedriver.importer.core.event.message.FirstMessage;
-import org.apache.felix.upnp.basedriver.importer.core.event.message.ListenerModified;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class Monitor {
-	private Hashtable sidStateVars;
-	private SidsListenersMaps sidListSid;
-
-	public Monitor() {
-		this.sidListSid = new SidsListenersMaps();
-		this.sidStateVars = new Hashtable();
-	}
-
-	public synchronized void putStateVars(String sid, StateVarsToNotify vars) {
-		sidStateVars.put(sid, vars);
-		Vector listeners = (Vector) sidListSid.getListenersFromSid(sid);
-		if (listeners != null) {
-			sidListSid.updateListeners(sid, vars.getDeviceID(), vars.getServiceID(), vars.getDictionary());
-			sidListSid.setAlreadyFirst(sid,true);
-		} else {
-			sidListSid.setAlreadyFirst(sid, false);
-		}
-	}
-	public synchronized void updateStateVars(String sid, Dictionary dic) {
-		StateVarsToNotify vars = (StateVarsToNotify) sidStateVars.get(sid);
-		if (vars != null) {
-			vars.updateDic(dic);
-			if (sidListSid.getAlreadyFirst(sid)) {
-			    /*
-			     * Sends only the changed StateVariable
-			     */
-				sidListSid.updateListeners(sid, 
-				        vars.getDeviceID(), vars.getServiceID(), 
-				        dic);
-			} else {
-			    /*
-			     * Sends the sholw StateVariable for the service 
-			     */
-				boolean bool = sidListSid.updateListeners(sid, 
-				        vars.getDeviceID(), vars.getServiceID(), 
-				        vars.getDictionary());
-				if (bool) {
-					sidListSid.setAlreadyFirst(sid,true);
-				}
-			}
-		}
-	}
-    
-/*    
-    public synchronized StateVarsToNotify getStateVars(String sid) {
-        return (StateVarsToNotify) sidStateVars.get(sid);
-    }
-    public synchronized void removeStateVars(String sid) {
-        sidStateVars.remove(sid);
-    }
-*/
-	public synchronized void addListener(String sid, UPnPEventListener listener) {
-		StateVarsToNotify vars = (StateVarsToNotify) sidStateVars.get(sid);
-		if (vars != null) {
-		    /*
-		     * Notify the listener whit the whole StateVariables and then
-		     * the next time you send only the changed StateVariables
-		     */
-            listener.notifyUPnPEvent(vars.getDeviceID(), 
-                    vars.getServiceID(),vars.getDictionary());
-        }
-		sidListSid.putSid2Listeners(sid, listener);
-		sidListSid.putListener2Sids(listener, sid);
-	}
-
-	/**
-	 * Delete the reference to the listener from the stuctures sid2Listeners and listener2Sids.
-	 * Also if no more listner are listening for a UPnP Service that UPnP Service is unscribed.
-	 * 
-	 * @param listener The listener to delete
-	 * @param ctrl Needed for reference
-	 */
-	public synchronized void delListener(UPnPEventListener listener,
-			MyCtrlPoint ctrl/*##renew, SidRenewer sidRenewer*/) {
-        
-        //francesco-renew
-        // State variable clean up -- todo?
-        
-		Vector sids = sidListSid.getSidsFromListener(listener);
-		if (sids != null) {
-		    Iterator i = sids.iterator();
-			while(i.hasNext()){
-			    String sid = (String) i.next();
-				Vector listeners = 
-                    sidListSid.getListenersFromSid(sid);
-				listeners.remove(listener);
-				if (listeners.size() == 0) {
-					Service service = 
-                        ctrl.serviceFromSid(sid);
-					//##renew  Renewer renewer = sidRenewer.get((String) sids.elementAt(i));
-					//##renew  renewer.stop();
-					if (service != null) {
-						boolean ok = ctrl.unsubscribe(service);
-						if (!ok) {
-						    //TODO Log?s
-							service.clearSID();
-						}
-					}
-					sidListSid.setAlreadyFirst(sid,false);
-					sidStateVars.remove(sid);
-					i.remove();
-				}
-			}
-			sidListSid.removeListenerKey(listener);			
-		}
-	}
-
-	public synchronized void updateListener(ListenerModified msg,
-			SubscriptionQueue subqueue, MyCtrlPoint ctrl/*##renew, SidRenewer sidRenewer*/) {
-		UPnPEventListener listener = msg.getListener();
-		Vector newServices = msg.getNewServices();
-		Vector subscribed = new Vector();
-		Vector notSubscribed = new Vector();
-		
-		for (int i = 0; i < newServices.size(); i++) {
-			Service ser = (Service) newServices.elementAt(i);
-			if (ser.isSubscribed()) {
-				subscribed.add(ser);
-			} else {
-				notSubscribed.add(ser);
-			}
-		}
-		
-
-		Vector oldSids = sidListSid.getSidsFromListener(listener);
-        // francesco-renew
-        // check subscribed services
-		if(oldSids==null) return;
-		
-		for (int i = 0; i < notSubscribed.size(); i++) {
-			Service ser = (Service) notSubscribed.elementAt(i);
-			subqueue.enqueue(new FirstMessage(ser, listener));
-		}
-		
-		for (int i = 0; i < oldSids.size(); i++) {
-			String oldSid = (String) oldSids.elementAt(i);
-			if (!subscribed.contains(oldSid)) {
-                // francesco-renew
-                // to check -- Listner removal from sid2Listener
-                				
-				unsubscribeListenerForSid(oldSid,listener,ctrl);
-			}
-		}
-
-	}
-    
-	/**
-	 * Unregister the listener as UPnPListener for the UPnPService with
-	 * the spicfied SID
-	 * 
-     * @param sid
-     * @param listener
-     * @param ctrl
-     */
-    private void unsubscribeListenerForSid(String sid, UPnPEventListener listener, MyCtrlPoint ctrl) {
-        Vector listeners = sidListSid.getListenersFromSid(sid);
-        listeners.remove(listener);
-        if(listeners.size()==0){
-			Service service = ctrl.serviceFromSid(sid);
-			if (service != null) {
-				boolean ok = ctrl.unsubscribe(service);
-				if (!ok) {
-				    //TODO Log?
-					service.clearSID();
-				}
-			}
-			sidListSid.setAlreadyFirst(sid,false);
-			sidStateVars.remove(sid);
-		}
-        Vector sids = sidListSid.getSidsFromListener(listener);
-        sids.remove(sid);
-        if(sids.size()==0){
-            sidListSid.removeListenerKey(listener);
-        }
-    }
-
-    public synchronized void delSid(String sid) {
-		Vector listeners = sidListSid.getListenersFromSid(sid);
-		if(listeners==null)return;
-		for (int i = 0; i < listeners.size(); i++) {
-			Vector sids = sidListSid.getSidsFromListener((UPnPEventListener) listeners
-					.elementAt(i));
-			sids.remove(sid);
-		}
-		sidListSid.removeSidKey(sid);
-	}
-
-	public synchronized void clearAll(String sid, Service service) {
-		service.clearSID();
-		delSid(sid);
-		sidStateVars.remove(sid);
-	}
-
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.structs;
+
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Vector;
+
+import org.cybergarage.upnp.Service;
+
+import org.osgi.service.upnp.UPnPEventListener;
+
+import org.apache.felix.upnp.basedriver.importer.core.MyCtrlPoint;
+import org.apache.felix.upnp.basedriver.importer.core.event.message.FirstMessage;
+import org.apache.felix.upnp.basedriver.importer.core.event.message.ListenerModified;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class Monitor {
+	private Hashtable sidStateVars;
+	private SidsListenersMaps sidListSid;
+
+	public Monitor() {
+		this.sidListSid = new SidsListenersMaps();
+		this.sidStateVars = new Hashtable();
+	}
+
+	public synchronized void putStateVars(String sid, StateVarsToNotify vars) {
+		sidStateVars.put(sid, vars);
+		Vector listeners = (Vector) sidListSid.getListenersFromSid(sid);
+		if (listeners != null) {
+			sidListSid.updateListeners(sid, vars.getDeviceID(), vars.getServiceID(), vars.getDictionary());
+			sidListSid.setAlreadyFirst(sid,true);
+		} else {
+			sidListSid.setAlreadyFirst(sid, false);
+		}
+	}
+	public synchronized void updateStateVars(String sid, Dictionary dic) {
+		StateVarsToNotify vars = (StateVarsToNotify) sidStateVars.get(sid);
+		if (vars != null) {
+			vars.updateDic(dic);
+			if (sidListSid.getAlreadyFirst(sid)) {
+			    /*
+			     * Sends only the changed StateVariable
+			     */
+				sidListSid.updateListeners(sid, 
+				        vars.getDeviceID(), vars.getServiceID(), 
+				        dic);
+			} else {
+			    /*
+			     * Sends the sholw StateVariable for the service 
+			     */
+				boolean bool = sidListSid.updateListeners(sid, 
+				        vars.getDeviceID(), vars.getServiceID(), 
+				        vars.getDictionary());
+				if (bool) {
+					sidListSid.setAlreadyFirst(sid,true);
+				}
+			}
+		}
+	}
+    
+/*    
+    public synchronized StateVarsToNotify getStateVars(String sid) {
+        return (StateVarsToNotify) sidStateVars.get(sid);
+    }
+    public synchronized void removeStateVars(String sid) {
+        sidStateVars.remove(sid);
+    }
+*/
+	public synchronized void addListener(String sid, UPnPEventListener listener) {
+		StateVarsToNotify vars = (StateVarsToNotify) sidStateVars.get(sid);
+		if (vars != null) {
+		    /*
+		     * Notify the listener whit the whole StateVariables and then
+		     * the next time you send only the changed StateVariables
+		     */
+            listener.notifyUPnPEvent(vars.getDeviceID(), 
+                    vars.getServiceID(),vars.getDictionary());
+        }
+		sidListSid.putSid2Listeners(sid, listener);
+		sidListSid.putListener2Sids(listener, sid);
+	}
+
+	/**
+	 * Delete the reference to the listener from the stuctures sid2Listeners and listener2Sids.
+	 * Also if no more listner are listening for a UPnP Service that UPnP Service is unscribed.
+	 * 
+	 * @param listener The listener to delete
+	 * @param ctrl Needed for reference
+	 */
+	public synchronized void delListener(UPnPEventListener listener,
+			MyCtrlPoint ctrl/*##renew, SidRenewer sidRenewer*/) {
+        
+        //francesco-renew
+        // State variable clean up -- todo?
+        
+		Vector sids = sidListSid.getSidsFromListener(listener);
+		if (sids != null) {
+		    Iterator i = sids.iterator();
+			while(i.hasNext()){
+			    String sid = (String) i.next();
+				Vector listeners = 
+                    sidListSid.getListenersFromSid(sid);
+				listeners.remove(listener);
+				if (listeners.size() == 0) {
+					Service service = 
+                        ctrl.serviceFromSid(sid);
+					//##renew  Renewer renewer = sidRenewer.get((String) sids.elementAt(i));
+					//##renew  renewer.stop();
+					if (service != null) {
+						boolean ok = ctrl.unsubscribe(service);
+						if (!ok) {
+						    //TODO Log?s
+							service.clearSID();
+						}
+					}
+					sidListSid.setAlreadyFirst(sid,false);
+					sidStateVars.remove(sid);
+					i.remove();
+				}
+			}
+			sidListSid.removeListenerKey(listener);			
+		}
+	}
+
+	public synchronized void updateListener(ListenerModified msg,
+			SubscriptionQueue subqueue, MyCtrlPoint ctrl/*##renew, SidRenewer sidRenewer*/) {
+		UPnPEventListener listener = msg.getListener();
+		Vector newServices = msg.getNewServices();
+		Vector subscribed = new Vector();
+		Vector notSubscribed = new Vector();
+		
+		for (int i = 0; i < newServices.size(); i++) {
+			Service ser = (Service) newServices.elementAt(i);
+			if (ser.isSubscribed()) {
+				subscribed.add(ser);
+			} else {
+				notSubscribed.add(ser);
+			}
+		}
+		
+
+		Vector oldSids = sidListSid.getSidsFromListener(listener);
+        // francesco-renew
+        // check subscribed services
+		if(oldSids==null) return;
+		
+		for (int i = 0; i < notSubscribed.size(); i++) {
+			Service ser = (Service) notSubscribed.elementAt(i);
+			subqueue.enqueue(new FirstMessage(ser, listener));
+		}
+		
+		for (int i = 0; i < oldSids.size(); i++) {
+			String oldSid = (String) oldSids.elementAt(i);
+			if (!subscribed.contains(oldSid)) {
+                // francesco-renew
+                // to check -- Listner removal from sid2Listener
+                				
+				unsubscribeListenerForSid(oldSid,listener,ctrl);
+			}
+		}
+
+	}
+    
+	/**
+	 * Unregister the listener as UPnPListener for the UPnPService with
+	 * the spicfied SID
+	 * 
+     * @param sid
+     * @param listener
+     * @param ctrl
+     */
+    private void unsubscribeListenerForSid(String sid, UPnPEventListener listener, MyCtrlPoint ctrl) {
+        Vector listeners = sidListSid.getListenersFromSid(sid);
+        listeners.remove(listener);
+        if(listeners.size()==0){
+			Service service = ctrl.serviceFromSid(sid);
+			if (service != null) {
+				boolean ok = ctrl.unsubscribe(service);
+				if (!ok) {
+				    //TODO Log?
+					service.clearSID();
+				}
+			}
+			sidListSid.setAlreadyFirst(sid,false);
+			sidStateVars.remove(sid);
+		}
+        Vector sids = sidListSid.getSidsFromListener(listener);
+        sids.remove(sid);
+        if(sids.size()==0){
+            sidListSid.removeListenerKey(listener);
+        }
+    }
+
+    public synchronized void delSid(String sid) {
+		Vector listeners = sidListSid.getListenersFromSid(sid);
+		if(listeners==null)return;
+		for (int i = 0; i < listeners.size(); i++) {
+			Vector sids = sidListSid.getSidsFromListener((UPnPEventListener) listeners
+					.elementAt(i));
+			sids.remove(sid);
+		}
+		sidListSid.removeSidKey(sid);
+	}
+
+	public synchronized void clearAll(String sid, Service service) {
+		service.clearSID();
+		delSid(sid);
+		sidStateVars.remove(sid);
+	}
+
 }

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Monitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Monitor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Monitor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/NotifierQueue.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/NotifierQueue.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/NotifierQueue.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/NotifierQueue.java Tue Jul  8 09:59:54 2008
@@ -1,62 +1,62 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.structs;
-
-import java.util.Vector;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class NotifierQueue {
-	private Vector queue;
-	private boolean running = true;
-	
-	public NotifierQueue(){
-		queue=new Vector();
-	}
-	
-	public synchronized void enqueue(Object obj){
-		queue.add(obj);
-		if(queue.size() == 1){
-			notify();
-		}
-		
-	}
-	
-	public synchronized Object dequeue(){
-		while(queue.size()==0 && running){
-			try {
-				wait();
-			} catch (InterruptedException e) {
-				e.printStackTrace();
-			}
-		}
-		if (running)
-			return queue.remove(0);
-		else
-			return null;
-	}
-
-	public synchronized void close() {
-		running  = false;
-		notify();		
-	}
-
-}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.structs;
+
+import java.util.Vector;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class NotifierQueue {
+	private Vector queue;
+	private boolean running = true;
+	
+	public NotifierQueue(){
+		queue=new Vector();
+	}
+	
+	public synchronized void enqueue(Object obj){
+		queue.add(obj);
+		if(queue.size() == 1){
+			notify();
+		}
+		
+	}
+	
+	public synchronized Object dequeue(){
+		while(queue.size()==0 && running){
+			try {
+				wait();
+			} catch (InterruptedException e) {
+				e.printStackTrace();
+			}
+		}
+		if (running)
+			return queue.remove(0);
+		else
+			return null;
+	}
+
+	public synchronized void close() {
+		running  = false;
+		notify();		
+	}
+
+}

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/NotifierQueue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/NotifierQueue.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/NotifierQueue.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Sid2Listeners.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Sid2Listeners.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Sid2Listeners.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Sid2Listeners.java Tue Jul  8 09:59:54 2008
@@ -1,85 +1,85 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.structs;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.osgi.service.upnp.UPnPEventListener;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class Sid2Listeners {
-	private Hashtable sidListener;
-	private Hashtable alreadyfirst;
-    
-	public Sid2Listeners() {
-		this.sidListener = new Hashtable();
-		this.alreadyfirst = new Hashtable();
-	}
-    
-	public void put(String sid, UPnPEventListener listener) {
-		if (!sidListener.containsKey(sid)) {
-			Vector vec = new Vector();
-			vec.add(listener);
-			sidListener.put(sid, vec);
-		} else {
-			Vector vec = (Vector) sidListener.get(sid);
-			if (!vec.contains(listener)) {
-				vec.add(listener);
-			}
-		}
-	}
-
-	public final void remove(String sid) {
-		sidListener.remove(sid);
-	}
-
-	public final Vector get(String sid) {
-		return ((Vector) sidListener.get(sid));
-	}
-
-    /**
-	 * @param sid
-	 * @param dictionary
-	 */
-	public boolean updateListeners(String sid, String deviceID,String serviceID, Dictionary dictionary) {
-        
-		Vector listeners = (Vector) sidListener.get(sid);
-		if (listeners != null) {
-			for (int i = 0; i < listeners.size(); i++) {
-				UPnPEventListener listener = (UPnPEventListener) listeners.elementAt(i);
-				listener.notifyUPnPEvent(deviceID, serviceID, dictionary);
-			}
-			return true;
-		}
-		return false;
-	}
-    
-	public boolean getAlreadyFirst(String sid) {
-		return ((Boolean) alreadyfirst.get(sid)).booleanValue();
-	}
-
-    public void setAlreadyFirst(String sid, boolean bool) {
-		alreadyfirst.put(sid, new Boolean(bool));
-	}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.structs;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.osgi.service.upnp.UPnPEventListener;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class Sid2Listeners {
+	private Hashtable sidListener;
+	private Hashtable alreadyfirst;
+    
+	public Sid2Listeners() {
+		this.sidListener = new Hashtable();
+		this.alreadyfirst = new Hashtable();
+	}
+    
+	public void put(String sid, UPnPEventListener listener) {
+		if (!sidListener.containsKey(sid)) {
+			Vector vec = new Vector();
+			vec.add(listener);
+			sidListener.put(sid, vec);
+		} else {
+			Vector vec = (Vector) sidListener.get(sid);
+			if (!vec.contains(listener)) {
+				vec.add(listener);
+			}
+		}
+	}
+
+	public final void remove(String sid) {
+		sidListener.remove(sid);
+	}
+
+	public final Vector get(String sid) {
+		return ((Vector) sidListener.get(sid));
+	}
+
+    /**
+	 * @param sid
+	 * @param dictionary
+	 */
+	public boolean updateListeners(String sid, String deviceID,String serviceID, Dictionary dictionary) {
+        
+		Vector listeners = (Vector) sidListener.get(sid);
+		if (listeners != null) {
+			for (int i = 0; i < listeners.size(); i++) {
+				UPnPEventListener listener = (UPnPEventListener) listeners.elementAt(i);
+				listener.notifyUPnPEvent(deviceID, serviceID, dictionary);
+			}
+			return true;
+		}
+		return false;
+	}
+    
+	public boolean getAlreadyFirst(String sid) {
+		return ((Boolean) alreadyfirst.get(sid)).booleanValue();
+	}
+
+    public void setAlreadyFirst(String sid, boolean bool) {
+		alreadyfirst.put(sid, new Boolean(bool));
+	}
 }

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Sid2Listeners.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Sid2Listeners.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/Sid2Listeners.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidRenewer.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidRenewer.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidRenewer.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidRenewer.java Tue Jul  8 09:59:54 2008
@@ -1,50 +1,50 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.structs;
-
-
-import java.util.Hashtable;
-
-import org.apache.felix.upnp.basedriver.importer.core.event.thread.Renewer;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class SidRenewer {
-private Hashtable hash;
-
-	/**
-	 * @param hash
-	 */
-	public SidRenewer() {
-		super();
-		this.hash = new Hashtable();
-	}
-
-	public synchronized void put(String sid, Renewer renewer){
-		hash.put(sid,renewer);
-	}
-	public synchronized Renewer get(String sid){
-		return (Renewer)hash.get(sid);
-	}
-	public synchronized void remove(String sid){
-		hash.remove(sid);
-	}
-}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.structs;
+
+
+import java.util.Hashtable;
+
+import org.apache.felix.upnp.basedriver.importer.core.event.thread.Renewer;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class SidRenewer {
+private Hashtable hash;
+
+	/**
+	 * @param hash
+	 */
+	public SidRenewer() {
+		super();
+		this.hash = new Hashtable();
+	}
+
+	public synchronized void put(String sid, Renewer renewer){
+		hash.put(sid,renewer);
+	}
+	public synchronized Renewer get(String sid){
+		return (Renewer)hash.get(sid);
+	}
+	public synchronized void remove(String sid){
+		hash.remove(sid);
+	}
+}

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidRenewer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidRenewer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidRenewer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidsListenersMaps.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidsListenersMaps.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidsListenersMaps.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidsListenersMaps.java Tue Jul  8 09:59:54 2008
@@ -1,76 +1,76 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.structs;
-
-import java.util.Dictionary;
-import java.util.Vector;
-
-import org.osgi.service.upnp.UPnPEventListener;
-
-/**
- * This class contain two table:
- *  - sid2listener: have SID of Suscribed Service as key and a Vector of UPnPEventListener as value
- *  - listener2sids: have an UPnPEventListener as kay and a Vector of SID of Scriscrobed Service 
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class SidsListenersMaps {
-	private Sid2Listeners sid2Listeners;
-	private Listener2Sids listeners2Sids;
-	
-	public SidsListenersMaps(){
-		sid2Listeners=new Sid2Listeners();
-		listeners2Sids=new Listener2Sids();
-	}
-    
-    
-	/////////////////// Sid to Listeners //////////////////////////////////
-	public final void putSid2Listeners(String sid, UPnPEventListener listener) {
-		sid2Listeners.put(sid,listener);
-	}
-    public final Vector getListenersFromSid(String sid) {
-        return sid2Listeners.get(sid);
-    }
-    public final void removeSidKey(String sid) {
-        sid2Listeners.remove(sid);
-    }
-	public final boolean updateListeners(String sid, String deviceID, String serviceID,Dictionary dictionary){
-		return sid2Listeners.updateListeners(sid,deviceID,serviceID,dictionary);
-	}
-	public final boolean getAlreadyFirst(String sid) {
-		return sid2Listeners.getAlreadyFirst(sid);
-	}
-	public final void setAlreadyFirst(String sid, boolean bool) {
-		sid2Listeners.setAlreadyFirst(sid,bool);
-	}
-    
-    
-    
-    /////////////////// Listener to Sids //////////////////////////////////
-	public final void putListener2Sids(UPnPEventListener listener,String sid) {
-		listeners2Sids.put(listener,sid);
-	}
-	public final Vector getSidsFromListener(UPnPEventListener listener){
-		return listeners2Sids.get(listener);
-	}
-	public final void removeListenerKey(UPnPEventListener listener){
-		listeners2Sids.remove(listener);
-	}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.structs;
+
+import java.util.Dictionary;
+import java.util.Vector;
+
+import org.osgi.service.upnp.UPnPEventListener;
+
+/**
+ * This class contain two table:
+ *  - sid2listener: have SID of Suscribed Service as key and a Vector of UPnPEventListener as value
+ *  - listener2sids: have an UPnPEventListener as kay and a Vector of SID of Scriscrobed Service 
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class SidsListenersMaps {
+	private Sid2Listeners sid2Listeners;
+	private Listener2Sids listeners2Sids;
+	
+	public SidsListenersMaps(){
+		sid2Listeners=new Sid2Listeners();
+		listeners2Sids=new Listener2Sids();
+	}
+    
+    
+	/////////////////// Sid to Listeners //////////////////////////////////
+	public final void putSid2Listeners(String sid, UPnPEventListener listener) {
+		sid2Listeners.put(sid,listener);
+	}
+    public final Vector getListenersFromSid(String sid) {
+        return sid2Listeners.get(sid);
+    }
+    public final void removeSidKey(String sid) {
+        sid2Listeners.remove(sid);
+    }
+	public final boolean updateListeners(String sid, String deviceID, String serviceID,Dictionary dictionary){
+		return sid2Listeners.updateListeners(sid,deviceID,serviceID,dictionary);
+	}
+	public final boolean getAlreadyFirst(String sid) {
+		return sid2Listeners.getAlreadyFirst(sid);
+	}
+	public final void setAlreadyFirst(String sid, boolean bool) {
+		sid2Listeners.setAlreadyFirst(sid,bool);
+	}
+    
+    
+    
+    /////////////////// Listener to Sids //////////////////////////////////
+	public final void putListener2Sids(UPnPEventListener listener,String sid) {
+		listeners2Sids.put(listener,sid);
+	}
+	public final Vector getSidsFromListener(UPnPEventListener listener){
+		return listeners2Sids.get(listener);
+	}
+	public final void removeListenerKey(UPnPEventListener listener){
+		listeners2Sids.remove(listener);
+	}
 }

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidsListenersMaps.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidsListenersMaps.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SidsListenersMaps.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/StateVarsToNotify.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/StateVarsToNotify.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/StateVarsToNotify.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/StateVarsToNotify.java Tue Jul  8 09:59:54 2008
@@ -1,68 +1,68 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.structs;
-
-
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import org.apache.felix.upnp.basedriver.importer.core.event.message.StateChanged;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class StateVarsToNotify {
-	private Dictionary stateVars;
-	private String sid;
-	private String deviceID;
-	private String serviceID;
-    
-    //public StateVarsToNotify(String sid, String deviceID, String serviceID,Dictionary dic) {
-    public StateVarsToNotify(StateChanged msg) {
-		this.stateVars= msg.getDictionary();
-		this.sid = msg.getSid();
-		this.deviceID = msg.getDeviceID();
-		this.serviceID = msg.getServiceID();
-	}
-
-
-	public synchronized Dictionary getDictionary() {
-			return stateVars;
-	}
-    public synchronized String getSid() {
-		return sid;
-	}
-	public synchronized String getDeviceID() {
-		return deviceID;
-	}
-	public synchronized String getServiceID() {
-		return serviceID;
-	}
-    
-    
-	public void updateDic(Dictionary dic){
-		Enumeration e=dic.keys();
-		while(e.hasMoreElements()){
-			String varName=(String)e.nextElement();
-			Object varValue=dic.get(varName);
-			stateVars.put(varName,varValue);
-		}
-	}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.structs;
+
+
+import java.util.Dictionary;
+import java.util.Enumeration;
+
+import org.apache.felix.upnp.basedriver.importer.core.event.message.StateChanged;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class StateVarsToNotify {
+	private Dictionary stateVars;
+	private String sid;
+	private String deviceID;
+	private String serviceID;
+    
+    //public StateVarsToNotify(String sid, String deviceID, String serviceID,Dictionary dic) {
+    public StateVarsToNotify(StateChanged msg) {
+		this.stateVars= msg.getDictionary();
+		this.sid = msg.getSid();
+		this.deviceID = msg.getDeviceID();
+		this.serviceID = msg.getServiceID();
+	}
+
+
+	public synchronized Dictionary getDictionary() {
+			return stateVars;
+	}
+    public synchronized String getSid() {
+		return sid;
+	}
+	public synchronized String getDeviceID() {
+		return deviceID;
+	}
+	public synchronized String getServiceID() {
+		return serviceID;
+	}
+    
+    
+	public void updateDic(Dictionary dic){
+		Enumeration e=dic.keys();
+		while(e.hasMoreElements()){
+			String varName=(String)e.nextElement();
+			Object varValue=dic.get(varName);
+			stateVars.put(varName,varValue);
+		}
+	}
 }

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/StateVarsToNotify.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/StateVarsToNotify.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/StateVarsToNotify.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SubscriptionQueue.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SubscriptionQueue.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SubscriptionQueue.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SubscriptionQueue.java Tue Jul  8 09:59:54 2008
@@ -1,63 +1,63 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.structs;
-
-import java.util.Vector;
-
-
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class SubscriptionQueue {
-	private Vector queue;
-	private boolean running = true;
-	
-	public SubscriptionQueue(){
-		queue=new Vector();
-	}
-	public synchronized void enqueue(Object obj){
-		queue.add(obj);
-		if(queue.size()==1){
-			notify();
-		}
-	}
-	public synchronized Object dequeue(){
-		while(queue.size()==0 && running){
-			try {
-				wait();
-			} catch (InterruptedException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-		}
-		if (running)
-			return queue.remove(0); 
-		else		
-			return null;
-	}
-	
-	public synchronized void close() {
-		running  = false;
-		notify();		
-	}	
-	
-
-}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.structs;
+
+import java.util.Vector;
+
+
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class SubscriptionQueue {
+	private Vector queue;
+	private boolean running = true;
+	
+	public SubscriptionQueue(){
+		queue=new Vector();
+	}
+	public synchronized void enqueue(Object obj){
+		queue.add(obj);
+		if(queue.size()==1){
+			notify();
+		}
+	}
+	public synchronized Object dequeue(){
+		while(queue.size()==0 && running){
+			try {
+				wait();
+			} catch (InterruptedException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		if (running)
+			return queue.remove(0); 
+		else		
+			return null;
+	}
+	
+	public synchronized void close() {
+		running  = false;
+		notify();		
+	}	
+	
+
+}

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SubscriptionQueue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SubscriptionQueue.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/structs/SubscriptionQueue.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Notifier.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Notifier.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Notifier.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Notifier.java Tue Jul  8 09:59:54 2008
@@ -1,64 +1,64 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.thread;
-
-import org.apache.felix.upnp.basedriver.importer.core.event.message.StateChanged;
-import org.apache.felix.upnp.basedriver.importer.core.event.structs.Monitor;
-import org.apache.felix.upnp.basedriver.importer.core.event.structs.NotifierQueue;
-import org.apache.felix.upnp.basedriver.importer.core.event.structs.StateVarsToNotify;
-
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class Notifier extends Thread {
-
-	private NotifierQueue notifierQueue;
-	private Monitor monitor;
-	private boolean running = true;
-
-    public Notifier(NotifierQueue notifierQueue,Monitor monitor) {
-		super("upnp.basedriver.Notifier");
-		this.notifierQueue = notifierQueue;
-		this.monitor = monitor;
-		
-	}
-
-	public void run() {
-		while (running) {
-            StateChanged msg = (StateChanged) notifierQueue.dequeue();
-            if (running) {
-				StateVarsToNotify vars = null;
-				if (msg.getSeq() == 0) {
-					vars = new StateVarsToNotify(msg);
-					monitor.putStateVars(msg.getSid(),vars);
-				} else {
-					monitor.updateStateVars(msg.getSid(),msg.getDictionary());
-				}
-            }
-		}
-	}
-
-	public void close() {
-		running  = false;
-		notifierQueue.close();
-	}
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.thread;
+
+import org.apache.felix.upnp.basedriver.importer.core.event.message.StateChanged;
+import org.apache.felix.upnp.basedriver.importer.core.event.structs.Monitor;
+import org.apache.felix.upnp.basedriver.importer.core.event.structs.NotifierQueue;
+import org.apache.felix.upnp.basedriver.importer.core.event.structs.StateVarsToNotify;
+
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class Notifier extends Thread {
+
+	private NotifierQueue notifierQueue;
+	private Monitor monitor;
+	private boolean running = true;
+
+    public Notifier(NotifierQueue notifierQueue,Monitor monitor) {
+		super("upnp.basedriver.Notifier");
+		this.notifierQueue = notifierQueue;
+		this.monitor = monitor;
+		
+	}
+
+	public void run() {
+		while (running) {
+            StateChanged msg = (StateChanged) notifierQueue.dequeue();
+            if (running) {
+				StateVarsToNotify vars = null;
+				if (msg.getSeq() == 0) {
+					vars = new StateVarsToNotify(msg);
+					monitor.putStateVars(msg.getSid(),vars);
+				} else {
+					monitor.updateStateVars(msg.getSid(),msg.getDictionary());
+				}
+            }
+		}
+	}
+
+	public void close() {
+		running  = false;
+		notifierQueue.close();
+	}
 }

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Notifier.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Notifier.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Notifier.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Renewer.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Renewer.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Renewer.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Renewer.java Tue Jul  8 09:59:54 2008
@@ -1,83 +1,83 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.thread;
-
-
-import org.cybergarage.upnp.Service;
-
-import org.apache.felix.upnp.basedriver.importer.core.MyCtrlPoint;
-import org.apache.felix.upnp.basedriver.importer.core.event.message.SidExipired;
-import org.apache.felix.upnp.basedriver.importer.core.event.structs.SubscriptionQueue;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class Renewer extends Thread {
-	private long timeout;
-	private String sid;
-	private Service service;
-	private MyCtrlPoint ctrl;
-	private boolean bool;
-	private SubscriptionQueue subqueue;
-	private final long time_before_renew=60000;
-	/**
-	 * *
-	 * 
-	 * @param timeout
-	 * @param sid
-	 * @param service
-	 */
-    public Renewer(long timeout, String sid, Service service,
-            MyCtrlPoint ctrl,SubscriptionQueue subqueue) {
-		super("ReNewal" + sid);
-		if (timeout - time_before_renew > 0) {
-			this.timeout = timeout - time_before_renew;
-		} else {
-			this.timeout = timeout;
-		}
-		this.sid = sid;
-		this.service = service;
-		this.ctrl = ctrl;
-		bool = true;
-		this.subqueue=subqueue;
-	}
-	public void run() {
-		while (bool) {
-			try {
-				sleep(timeout);
-			} catch (InterruptedException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-			boolean ok = ctrl.subscribe(service, sid, 180000);
-			if (ok) {//renew ok
-				if (service.getTimeout() - time_before_renew > 0) {
-					timeout = service.getTimeout() - time_before_renew;
-				} else {
-					timeout = service.getTimeout();
-				}
-			} else {//renew not ok
-				bool=false;
-				subqueue.enqueue(new SidExipired(sid,service));
-			}
-		}
-	}
-
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.thread;
+
+
+import org.cybergarage.upnp.Service;
+
+import org.apache.felix.upnp.basedriver.importer.core.MyCtrlPoint;
+import org.apache.felix.upnp.basedriver.importer.core.event.message.SidExipired;
+import org.apache.felix.upnp.basedriver.importer.core.event.structs.SubscriptionQueue;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class Renewer extends Thread {
+	private long timeout;
+	private String sid;
+	private Service service;
+	private MyCtrlPoint ctrl;
+	private boolean bool;
+	private SubscriptionQueue subqueue;
+	private final long time_before_renew=60000;
+	/**
+	 * *
+	 * 
+	 * @param timeout
+	 * @param sid
+	 * @param service
+	 */
+    public Renewer(long timeout, String sid, Service service,
+            MyCtrlPoint ctrl,SubscriptionQueue subqueue) {
+		super("ReNewal" + sid);
+		if (timeout - time_before_renew > 0) {
+			this.timeout = timeout - time_before_renew;
+		} else {
+			this.timeout = timeout;
+		}
+		this.sid = sid;
+		this.service = service;
+		this.ctrl = ctrl;
+		bool = true;
+		this.subqueue=subqueue;
+	}
+	public void run() {
+		while (bool) {
+			try {
+				sleep(timeout);
+			} catch (InterruptedException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			boolean ok = ctrl.subscribe(service, sid, 180000);
+			if (ok) {//renew ok
+				if (service.getTimeout() - time_before_renew > 0) {
+					timeout = service.getTimeout() - time_before_renew;
+				} else {
+					timeout = service.getTimeout();
+				}
+			} else {//renew not ok
+				bool=false;
+				subqueue.enqueue(new SidExipired(sid,service));
+			}
+		}
+	}
+
 }

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Renewer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Renewer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/Renewer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/SubScriber.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/SubScriber.java?rev=674879&r1=674878&r2=674879&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/SubScriber.java (original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/SubScriber.java Tue Jul  8 09:59:54 2008
@@ -1,92 +1,92 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.upnp.basedriver.importer.core.event.thread;
-
-
-import org.cybergarage.upnp.Service;
-
-import org.osgi.service.log.LogService;
-
-import org.apache.felix.upnp.basedriver.Activator;
-import org.apache.felix.upnp.basedriver.importer.core.MyCtrlPoint;
-import org.apache.felix.upnp.basedriver.importer.core.event.message.FirstMessage;
-import org.apache.felix.upnp.basedriver.importer.core.event.message.ListenerModified;
-import org.apache.felix.upnp.basedriver.importer.core.event.message.ListenerUnRegistration;
-import org.apache.felix.upnp.basedriver.importer.core.event.message.SidExipired;
-import org.apache.felix.upnp.basedriver.importer.core.event.structs.Monitor;
-import org.apache.felix.upnp.basedriver.importer.core.event.structs.SubscriptionQueue;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-public class SubScriber extends Thread {
-
-	private MyCtrlPoint ctrl;
-	private SubscriptionQueue subQueue;
-    private boolean running = true;
-	private Monitor monitor;
-
-    
-    public SubScriber(MyCtrlPoint ctrl, SubscriptionQueue subQueue, Monitor monitor) {
-		super("upnp.basedriver.Subscriber");
-		this.ctrl = ctrl;
-		this.subQueue = subQueue;
-		this.monitor=monitor;
-		
-	}
-
-	public void run() {
-		while (running) {
-			Object msg = subQueue.dequeue();
-			if (running) {
-				if (msg instanceof FirstMessage) {
-					FirstMessage firstmsg = (FirstMessage) msg;
-					Service service = firstmsg.getService();
-					if (!service.isSubscribed()) {//is not subscribe
-						boolean ok = ctrl.subscribe(service,120000);
-						String sid = "";
-						if (ok) {//subcribe ok	                        
-							sid = service.getSID();
-							firstmsg.setSid(sid);                        
-							monitor.addListener(sid,firstmsg.getListener());						
-						} else {//subscribe not ok
-							Activator.logger.log(LogService.LOG_ERROR,"Sucribe failed");
-						}
-					} else {// already subscribe
-						monitor.addListener(service.getSID(),firstmsg.getListener());
-					}
-				} else if (msg instanceof ListenerModified) {
-					monitor.updateListener((ListenerModified)msg,subQueue,ctrl);
-				} else if (msg instanceof ListenerUnRegistration) {
-					ListenerUnRegistration unreg=(ListenerUnRegistration)msg;
-					monitor.delListener(unreg.getListener(),ctrl);
-				} else if(msg instanceof SidExipired){
-				    Activator.logger.WARNING("[Importer] Please report the bug. Used code - should be checked and removed");
-				}
-			}
-		}
-	}
-
-	public void close() {
-		running  = false;	
-		subQueue.close();
-	}
-
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.felix.upnp.basedriver.importer.core.event.thread;
+
+
+import org.cybergarage.upnp.Service;
+
+import org.osgi.service.log.LogService;
+
+import org.apache.felix.upnp.basedriver.Activator;
+import org.apache.felix.upnp.basedriver.importer.core.MyCtrlPoint;
+import org.apache.felix.upnp.basedriver.importer.core.event.message.FirstMessage;
+import org.apache.felix.upnp.basedriver.importer.core.event.message.ListenerModified;
+import org.apache.felix.upnp.basedriver.importer.core.event.message.ListenerUnRegistration;
+import org.apache.felix.upnp.basedriver.importer.core.event.message.SidExipired;
+import org.apache.felix.upnp.basedriver.importer.core.event.structs.Monitor;
+import org.apache.felix.upnp.basedriver.importer.core.event.structs.SubscriptionQueue;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+public class SubScriber extends Thread {
+
+	private MyCtrlPoint ctrl;
+	private SubscriptionQueue subQueue;
+    private boolean running = true;
+	private Monitor monitor;
+
+    
+    public SubScriber(MyCtrlPoint ctrl, SubscriptionQueue subQueue, Monitor monitor) {
+		super("upnp.basedriver.Subscriber");
+		this.ctrl = ctrl;
+		this.subQueue = subQueue;
+		this.monitor=monitor;
+		
+	}
+
+	public void run() {
+		while (running) {
+			Object msg = subQueue.dequeue();
+			if (running) {
+				if (msg instanceof FirstMessage) {
+					FirstMessage firstmsg = (FirstMessage) msg;
+					Service service = firstmsg.getService();
+					if (!service.isSubscribed()) {//is not subscribe
+						boolean ok = ctrl.subscribe(service,120000);
+						String sid = "";
+						if (ok) {//subcribe ok	                        
+							sid = service.getSID();
+							firstmsg.setSid(sid);                        
+							monitor.addListener(sid,firstmsg.getListener());						
+						} else {//subscribe not ok
+							Activator.logger.log(LogService.LOG_ERROR,"Sucribe failed");
+						}
+					} else {// already subscribe
+						monitor.addListener(service.getSID(),firstmsg.getListener());
+					}
+				} else if (msg instanceof ListenerModified) {
+					monitor.updateListener((ListenerModified)msg,subQueue,ctrl);
+				} else if (msg instanceof ListenerUnRegistration) {
+					ListenerUnRegistration unreg=(ListenerUnRegistration)msg;
+					monitor.delListener(unreg.getListener(),ctrl);
+				} else if(msg instanceof SidExipired){
+				    Activator.logger.WARNING("[Importer] Please report the bug. Used code - should be checked and removed");
+				}
+			}
+		}
+	}
+
+	public void close() {
+		running  = false;	
+		subQueue.close();
+	}
+
 }

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/SubScriber.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/SubScriber.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/event/thread/SubScriber.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message