diff --git a/upnp/samples/binarylight/pom.xml b/upnp/samples/binarylight/pom.xml
index 05279d2..ba8b09f 100644
--- a/upnp/samples/binarylight/pom.xml
+++ b/upnp/samples/binarylight/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -17,66 +17,66 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <artifactId>felix</artifactId>
-    <groupId>org.apache.felix</groupId>
-    <version>1.0.2</version>
-    <relativePath>../../../pom/pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.felix</groupId>
-  <artifactId>org.apache.felix.upnp.sample.binaryLight</artifactId>
-  <packaging>bundle</packaging>
-  <name>Apache Felix UPnP Sample Binary-Light</name>
-  <version>0.2.0-SNAPSHOT</version>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>felix</artifactId>
+    <groupId>org.apache.felix</groupId>
+    <version>1.0.2</version>
+    <relativePath>../../../pom/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.felix</groupId>
+  <artifactId>org.apache.felix.upnp.sample.binaryLight</artifactId>
+  <packaging>bundle</packaging>
+  <name>Apache Felix UPnP Sample Binary-Light</name>
+  <version>0.2.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
         <version>1.4.0</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-Name>${pom.name}</Bundle-Name>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-Name>${pom.name}</Bundle-Name>
             <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
-            <Bundle-Author>Matteo Demuru &lt;demuru@apache.org&gt;,Francesco Furfari &lt;furfari@apache.org&gt;,Stefano "Kismet" Lenzi &lt;lenzi@apache.org&gt;</Bundle-Author>
-            <Bundle-Description>Standardized BinaryLight DCPs to test UPnP Base Driver</Bundle-Description>
-            <Bundle-SymbolicName>org.apache.felix.upnp.sample.binaryLight</Bundle-SymbolicName>
-            <Bundle-Activator>org.apache.felix.upnp.sample.binaryLight.Activator</Bundle-Activator>
-            <Private-Package>org.apache.felix.upnp.sample.binaryLight.*</Private-Package>
-            <Import-Package>*</Import-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
+            <Bundle-Author>Matteo Demuru &lt;demuru@apache.org&gt;,Francesco Furfari &lt;furfari@apache.org&gt;,Stefano "Kismet" Lenzi &lt;lenzi@apache.org&gt;</Bundle-Author>
+            <Bundle-Description>Standardized BinaryLight DCPs to test UPnP Base Driver</Bundle-Description>
+            <Bundle-SymbolicName>org.apache.felix.upnp.sample.binaryLight</Bundle-SymbolicName>
+            <Bundle-Activator>org.apache.felix.upnp.sample.binaryLight.Activator</Bundle-Activator>
+            <Private-Package>org.apache.felix.upnp.sample.binaryLight.*</Private-Package>
+            <Import-Package>*</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>1.1.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
       <version>1.0.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>javax.servlet</artifactId>
-      <version>1.0.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.upnp.extra</artifactId>
-      <version>0.3.0-SNAPSHOT</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-</project>
-
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>javax.servlet</artifactId>
+      <version>1.0.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.upnp.extra</artifactId>
+      <version>0.3.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>
+
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/LightModel.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/LightModel.java
index 374cc20..d48d2d3 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/LightModel.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/LightModel.java
@@ -1,113 +1,113 @@
-/* 
- * 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.sample.binaryLight;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-
-import org.apache.felix.upnp.extra.util.EventSource;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class LightModel implements EventSource{
-	
-	private boolean status = false;
-	private boolean target = false;
-	private boolean failure = false;
-	private PropertyChangeSupport propertySupport = new PropertyChangeSupport(this);
-	
-	public LightModel(){	
-	}
-	
-	public void addPropertyChangeListener(PropertyChangeListener listener){
-		propertySupport.addPropertyChangeListener(listener);
-	}
-	
-	public void removePropertyChangeListener(PropertyChangeListener listener){
-		propertySupport.removePropertyChangeListener(listener);
-	}
-	public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
-		propertySupport.addPropertyChangeListener(propertyName,listener);
-	}
-
-	public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
-		propertySupport.removePropertyChangeListener(propertyName,listener);
-	}
-	
-	public void doSwitch(boolean value){
-		if (value) switchOn();
-		else switchOff();
-	}
-	
-	public void switchOn(){
-		target = true;
-		if(! failure) {
-			boolean oldStatus = status;
-			status = true;
-			propertySupport.firePropertyChange("Status",oldStatus,status);
-		}
-	}
-	
-	public void switchOff(){
-		target = false;
-		if(! failure) {
-			boolean oldStatus = status;
-			status = false;
-			propertySupport.firePropertyChange("Status",oldStatus,status);
-		}
-	}
-	
-	public void setFailure(boolean value){
-		failure = value;
-		if (failure){
-			status = false;
-		}
-		else {
-			if (target)		{
-				status = true;
-			}
-			else{
-				status = false;
-			}
-		}
-		propertySupport.firePropertyChange("Status",!status,status);
-		propertySupport.firePropertyChange("Failure",!failure,failure);
-	}
-	
-
-	/**
-	 * @return
-	 */
-	public boolean getTarget() {
-		return target;
-	}
-
-	/**
-	 * @return
-	 */
-	public boolean getStatus() {
-		return status;
-	}
-
-
-
-}
+/* 
+ * 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.sample.binaryLight;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+import org.apache.felix.upnp.extra.util.EventSource;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class LightModel implements EventSource{
+	
+	private boolean status = false;
+	private boolean target = false;
+	private boolean failure = false;
+	private PropertyChangeSupport propertySupport = new PropertyChangeSupport(this);
+	
+	public LightModel(){	
+	}
+	
+	public void addPropertyChangeListener(PropertyChangeListener listener){
+		propertySupport.addPropertyChangeListener(listener);
+	}
+	
+	public void removePropertyChangeListener(PropertyChangeListener listener){
+		propertySupport.removePropertyChangeListener(listener);
+	}
+	public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+		propertySupport.addPropertyChangeListener(propertyName,listener);
+	}
+
+	public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+		propertySupport.removePropertyChangeListener(propertyName,listener);
+	}
+	
+	public void doSwitch(boolean value){
+		if (value) switchOn();
+		else switchOff();
+	}
+	
+	public void switchOn(){
+		target = true;
+		if(! failure) {
+			boolean oldStatus = status;
+			status = true;
+			propertySupport.firePropertyChange("Status",oldStatus,status);
+		}
+	}
+	
+	public void switchOff(){
+		target = false;
+		if(! failure) {
+			boolean oldStatus = status;
+			status = false;
+			propertySupport.firePropertyChange("Status",oldStatus,status);
+		}
+	}
+	
+	public void setFailure(boolean value){
+		failure = value;
+		if (failure){
+			status = false;
+		}
+		else {
+			if (target)		{
+				status = true;
+			}
+			else{
+				status = false;
+			}
+		}
+		propertySupport.firePropertyChange("Status",!status,status);
+		propertySupport.firePropertyChange("Failure",!failure,failure);
+	}
+	
+
+	/**
+	 * @return
+	 */
+	public boolean getTarget() {
+		return target;
+	}
+
+	/**
+	 * @return
+	 */
+	public boolean getStatus() {
+		return status;
+	}
+
+
+
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/LightUI.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/LightUI.java
index 2e56106..02238cc 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/LightUI.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/LightUI.java
@@ -1,185 +1,185 @@
-/* 
- * 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.sample.binaryLight;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.net.URL;
-
-import javax.swing.AbstractAction;
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-
-import org.osgi.framework.BundleException;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class LightUI extends JFrame implements PropertyChangeListener {
-    private final static ImageIcon LIGHT_ON = LightUI.loadIcon("LightOn.gif","ON");
-    private final static ImageIcon LIGHT_OFF = LightUI.loadIcon("LightOff.gif","OFF");
-    private final static ImageIcon LIGHT_FAIL = LightUI.loadIcon("LightFail.gif","FAILURE");
-	private final JLabel label = new JLabel();
-    private LightModel model;
-	private JButton btnSwitch;
-	private JButton btnFailure;
-   
-	public LightUI(LightModel model)   {
-		super("Felix UPnP BinaryLight");
-		this.model = model;
-		setSize(150,150);
-		JPanel panel = new JPanel(new BorderLayout());
-		panel.add(doMainPanel(),BorderLayout.CENTER);
-		panel.add(doControlPanel(),BorderLayout.SOUTH);
-		getContentPane().add(panel);
-		model.addPropertyChangeListener(this);
-
-		addWindowListener(new WindowAdapter(){
-			public void windowClosing(WindowEvent e) 
-			{
-				try {
-					Activator.context.getBundle().stop();
-				} catch (BundleException ex) {
-					ex.printStackTrace();
-				}
-			}
-		});			
-	       try {
-	            URL eventIconUrl = LightUI.class.getResource("images/logo.gif");           
-	            ImageIcon icon=  new ImageIcon(eventIconUrl,"logo");
-	            setIconImage(icon.getImage());
-	       }
-	        catch (Exception ex){
-	                System.out.println("Resource: IMAGES/logo.gif not found : " + ex.toString());
-	        }
-	
-		pack();
-		setVisible(true);
-    }
-	
-	private JPanel doMainPanel(){
-		JPanel panel = new JPanel();
-		label.setIcon(LIGHT_OFF);
-		//label.setSize(new Dimension(32,32));
-	    label.addMouseListener(new MouseAdapter(){          
-	          public void mouseClicked(MouseEvent e){
-	            if (SwingUtilities.isLeftMouseButton(e)){
-	              if (e.getClickCount()==1){
-	              Icon icon = label.getIcon();
-	              if (icon == LIGHT_ON)
-	                  model.switchOff();
-	              else 
-	                  model.switchOn();
-	              }
-	            }
-	          }
-	    });
-	    panel.add(label);
-	    return panel;
-	}
-	          
-	private JPanel doControlPanel(){
-		JPanel panel = new JPanel();
-		btnSwitch = new JButton("On");
-		btnFailure = new JButton("Break");
-		panel.add(btnSwitch);
-		panel.add(btnFailure);
-		
-		btnSwitch.addActionListener(new AbstractAction(){
-			public void actionPerformed(ActionEvent e) {
-				if (btnSwitch.getText().equals("On")){
-					btnSwitch.setText("Off");
-	                model.switchOn();
-				}else {
-					btnSwitch.setText("On");
-	                model.switchOff();					
-				}
-			}			
-		});
-		
-		btnFailure.addActionListener(new AbstractAction(){
-			public void actionPerformed(ActionEvent e) {
-				if (btnFailure.getText().equals("Break")){
-					btnFailure.setText("Repair");
-					btnSwitch.setEnabled(false);
-	                model.setFailure(true);
-				} else {
-					btnFailure.setText("Break");
-					btnSwitch.setEnabled(true);
-	                model.setFailure(false);					
-				}
-			}			
-		});
-		
-		return panel;
-	}
-	
-    public  static ImageIcon loadIcon(String path,String title)
-    {
-        try {
-            URL eventIconUrl = LightUI.class.getResource("images/" + path);
-            return new ImageIcon(eventIconUrl,title);
-        }
-        catch (Exception ex){
-			System.out.println("Resource:" + path + " not found : " + ex.toString());
-            return null;
-        }
-    }
-
-	/* (non-Javadoc)
-	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
-	 */
-    public void propertyChange(PropertyChangeEvent evt) {
-    	String property = evt.getPropertyName();
-    	boolean value = ((Boolean) evt.getNewValue()).booleanValue();
-    	System.out.println("BinaryLight property::"+property + " changed to:" +  value);
-        	if (property.equals("Status")){
-    		if (value){
-    			label.setIcon(LIGHT_ON);
-    			btnSwitch.setText("Off");
-    		}
-    		else{
-    			label.setIcon(LIGHT_OFF);
-    			btnSwitch.setText("On");
-    		}
-    	}
-    	else if (property.equals("Failure")){            
-    		if (value)
-    			label.setIcon(LIGHT_FAIL);
-    	}
-    	getContentPane().validate();
-    	repaint();
-
-	}
-
-	
-}
+/* 
+ * 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.sample.binaryLight;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.net.URL;
+
+import javax.swing.AbstractAction;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+import org.osgi.framework.BundleException;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class LightUI extends JFrame implements PropertyChangeListener {
+    private final static ImageIcon LIGHT_ON = LightUI.loadIcon("LightOn.gif","ON");
+    private final static ImageIcon LIGHT_OFF = LightUI.loadIcon("LightOff.gif","OFF");
+    private final static ImageIcon LIGHT_FAIL = LightUI.loadIcon("LightFail.gif","FAILURE");
+	private final JLabel label = new JLabel();
+    private LightModel model;
+	private JButton btnSwitch;
+	private JButton btnFailure;
+   
+	public LightUI(LightModel model)   {
+		super("Felix UPnP BinaryLight");
+		this.model = model;
+		setSize(150,150);
+		JPanel panel = new JPanel(new BorderLayout());
+		panel.add(doMainPanel(),BorderLayout.CENTER);
+		panel.add(doControlPanel(),BorderLayout.SOUTH);
+		getContentPane().add(panel);
+		model.addPropertyChangeListener(this);
+
+		addWindowListener(new WindowAdapter(){
+			public void windowClosing(WindowEvent e) 
+			{
+				try {
+					Activator.context.getBundle().stop();
+				} catch (BundleException ex) {
+					ex.printStackTrace();
+				}
+			}
+		});			
+	       try {
+	            URL eventIconUrl = LightUI.class.getResource("images/logo.gif");           
+	            ImageIcon icon=  new ImageIcon(eventIconUrl,"logo");
+	            setIconImage(icon.getImage());
+	       }
+	        catch (Exception ex){
+	                System.out.println("Resource: IMAGES/logo.gif not found : " + ex.toString());
+	        }
+	
+		pack();
+		setVisible(true);
+    }
+	
+	private JPanel doMainPanel(){
+		JPanel panel = new JPanel();
+		label.setIcon(LIGHT_OFF);
+		//label.setSize(new Dimension(32,32));
+	    label.addMouseListener(new MouseAdapter(){          
+	          public void mouseClicked(MouseEvent e){
+	            if (SwingUtilities.isLeftMouseButton(e)){
+	              if (e.getClickCount()==1){
+	              Icon icon = label.getIcon();
+	              if (icon == LIGHT_ON)
+	                  model.switchOff();
+	              else 
+	                  model.switchOn();
+	              }
+	            }
+	          }
+	    });
+	    panel.add(label);
+	    return panel;
+	}
+	          
+	private JPanel doControlPanel(){
+		JPanel panel = new JPanel();
+		btnSwitch = new JButton("On");
+		btnFailure = new JButton("Break");
+		panel.add(btnSwitch);
+		panel.add(btnFailure);
+		
+		btnSwitch.addActionListener(new AbstractAction(){
+			public void actionPerformed(ActionEvent e) {
+				if (btnSwitch.getText().equals("On")){
+					btnSwitch.setText("Off");
+	                model.switchOn();
+				}else {
+					btnSwitch.setText("On");
+	                model.switchOff();					
+				}
+			}			
+		});
+		
+		btnFailure.addActionListener(new AbstractAction(){
+			public void actionPerformed(ActionEvent e) {
+				if (btnFailure.getText().equals("Break")){
+					btnFailure.setText("Repair");
+					btnSwitch.setEnabled(false);
+	                model.setFailure(true);
+				} else {
+					btnFailure.setText("Break");
+					btnSwitch.setEnabled(true);
+	                model.setFailure(false);					
+				}
+			}			
+		});
+		
+		return panel;
+	}
+	
+    public  static ImageIcon loadIcon(String path,String title)
+    {
+        try {
+            URL eventIconUrl = LightUI.class.getResource("images/" + path);
+            return new ImageIcon(eventIconUrl,title);
+        }
+        catch (Exception ex){
+			System.out.println("Resource:" + path + " not found : " + ex.toString());
+            return null;
+        }
+    }
+
+	/* (non-Javadoc)
+	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+	 */
+    public void propertyChange(PropertyChangeEvent evt) {
+    	String property = evt.getPropertyName();
+    	boolean value = ((Boolean) evt.getNewValue()).booleanValue();
+    	System.out.println("BinaryLight property::"+property + " changed to:" +  value);
+        	if (property.equals("Status")){
+    		if (value){
+    			label.setIcon(LIGHT_ON);
+    			btnSwitch.setText("Off");
+    		}
+    		else{
+    			label.setIcon(LIGHT_OFF);
+    			btnSwitch.setText("On");
+    		}
+    	}
+    	else if (property.equals("Failure")){            
+    		if (value)
+    			label.setIcon(LIGHT_FAIL);
+    	}
+    	getContentPane().validate();
+    	repaint();
+
+	}
+
+	
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/GetStatusAction.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/GetStatusAction.java
index 9b19b6a..06744ff 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/GetStatusAction.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/GetStatusAction.java
@@ -1,93 +1,93 @@
-/* 
- * 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.sample.binaryLight.actions;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-import org.apache.felix.upnp.sample.binaryLight.LightModel;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class GetStatusAction implements UPnPAction {
-
-	final private String NAME = "GetStatus";
-	final private String RESULT_STATUS = "ResultStatus";
-	final private String[] OUT_ARG_NAMES = new String[]{RESULT_STATUS};
-	private UPnPStateVariable state;
-	private LightModel model;
-	
-	
-	public GetStatusAction(LightModel model,UPnPStateVariable state){
-		this.state = state;
-		this.model=model;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
-	 */
-	public String getReturnArgumentName() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
-	 */
-	public String[] getInputArgumentNames() {
-		
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
-	 */
-	public String[] getOutputArgumentNames() {
-		return OUT_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String argumentName) {
-		return state;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
-	 */
-	public Dictionary invoke(Dictionary args) throws Exception {
-		boolean status = model.getStatus();
-		Hashtable result = new Hashtable();
-		result.put(RESULT_STATUS,new Boolean(status));
-		return result;
-	}
-}
+/* 
+ * 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.sample.binaryLight.actions;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+import org.apache.felix.upnp.sample.binaryLight.LightModel;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class GetStatusAction implements UPnPAction {
+
+	final private String NAME = "GetStatus";
+	final private String RESULT_STATUS = "ResultStatus";
+	final private String[] OUT_ARG_NAMES = new String[]{RESULT_STATUS};
+	private UPnPStateVariable state;
+	private LightModel model;
+	
+	
+	public GetStatusAction(LightModel model,UPnPStateVariable state){
+		this.state = state;
+		this.model=model;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
+	 */
+	public String getReturnArgumentName() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
+	 */
+	public String[] getInputArgumentNames() {
+		
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
+	 */
+	public String[] getOutputArgumentNames() {
+		return OUT_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String argumentName) {
+		return state;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary args) throws Exception {
+		boolean status = model.getStatus();
+		Hashtable result = new Hashtable();
+		result.put(RESULT_STATUS,new Boolean(status));
+		return result;
+	}
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/GetTargetAction.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/GetTargetAction.java
index b40d2ef..8529ab3 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/GetTargetAction.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/GetTargetAction.java
@@ -1,93 +1,93 @@
-/* 
- * 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.sample.binaryLight.actions;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-import org.apache.felix.upnp.sample.binaryLight.LightModel;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class GetTargetAction implements UPnPAction {
-
-	final private String NAME = "GetTarget";
-	final private String RET_TARGET_VALUE = "RetTargetValue";
-	final private String[] OUT_ARG_NAMES = new String[]{RET_TARGET_VALUE};
-	private UPnPStateVariable state;
-	private LightModel model;
-	
-	
-	public GetTargetAction(LightModel model,UPnPStateVariable state){
-		this.state = state;
-		this.model=model;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
-	 */
-	public String getReturnArgumentName() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
-	 */
-	public String[] getInputArgumentNames() {
-		
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
-	 */
-	public String[] getOutputArgumentNames() {
-		return OUT_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String argumentName) {
-		return state;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
-	 */
-	public Dictionary invoke(Dictionary args) throws Exception {
-		boolean target = model.getTarget();
-		Hashtable result = new Hashtable();
-		result.put(RET_TARGET_VALUE,new Boolean(target));
-		return result;
-	}
-}
+/* 
+ * 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.sample.binaryLight.actions;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+import org.apache.felix.upnp.sample.binaryLight.LightModel;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class GetTargetAction implements UPnPAction {
+
+	final private String NAME = "GetTarget";
+	final private String RET_TARGET_VALUE = "RetTargetValue";
+	final private String[] OUT_ARG_NAMES = new String[]{RET_TARGET_VALUE};
+	private UPnPStateVariable state;
+	private LightModel model;
+	
+	
+	public GetTargetAction(LightModel model,UPnPStateVariable state){
+		this.state = state;
+		this.model=model;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
+	 */
+	public String getReturnArgumentName() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
+	 */
+	public String[] getInputArgumentNames() {
+		
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
+	 */
+	public String[] getOutputArgumentNames() {
+		return OUT_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String argumentName) {
+		return state;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary args) throws Exception {
+		boolean target = model.getTarget();
+		Hashtable result = new Hashtable();
+		result.put(RET_TARGET_VALUE,new Boolean(target));
+		return result;
+	}
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/SetTargetAction.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/SetTargetAction.java
index cac1e44..ebf4677 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/SetTargetAction.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/actions/SetTargetAction.java
@@ -1,90 +1,90 @@
-/* 
- * 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.sample.binaryLight.actions;
-
-import java.util.Dictionary;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-import org.apache.felix.upnp.sample.binaryLight.LightModel;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class SetTargetAction implements UPnPAction {
-
-	final private String NAME = "SetTarget";
-	final private String NEW_TARGET_VALUE = "NewTargetValue";
-	final private String[] IN_ARG_NAMES = new String[]{NEW_TARGET_VALUE};
-	private UPnPStateVariable state;
-	private LightModel model;
-	
-	
-	public SetTargetAction(LightModel model,UPnPStateVariable state){
-		this.state = state;
-		this.model=model;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
-	 */
-	public String getReturnArgumentName() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
-	 */
-	public String[] getInputArgumentNames() {
-		return IN_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
-	 */
-	public String[] getOutputArgumentNames() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String argumentName) {
-		return state;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
-	 */
-	public Dictionary invoke(Dictionary args) throws Exception {
-		Boolean value = (Boolean) args.get(NEW_TARGET_VALUE);
-		model.doSwitch(value.booleanValue());
-		return null;
-	}
-}
+/* 
+ * 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.sample.binaryLight.actions;
+
+import java.util.Dictionary;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+import org.apache.felix.upnp.sample.binaryLight.LightModel;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class SetTargetAction implements UPnPAction {
+
+	final private String NAME = "SetTarget";
+	final private String NEW_TARGET_VALUE = "NewTargetValue";
+	final private String[] IN_ARG_NAMES = new String[]{NEW_TARGET_VALUE};
+	private UPnPStateVariable state;
+	private LightModel model;
+	
+	
+	public SetTargetAction(LightModel model,UPnPStateVariable state){
+		this.state = state;
+		this.model=model;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
+	 */
+	public String getReturnArgumentName() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
+	 */
+	public String[] getInputArgumentNames() {
+		return IN_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
+	 */
+	public String[] getOutputArgumentNames() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String argumentName) {
+		return state;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary args) throws Exception {
+		Boolean value = (Boolean) args.get(NEW_TARGET_VALUE);
+		model.doSwitch(value.booleanValue());
+		return null;
+	}
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/devices/LightDevice.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/devices/LightDevice.java
index 7065d42..c99bb9b 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/devices/LightDevice.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/devices/LightDevice.java
@@ -1,146 +1,146 @@
-/* 
- * 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.sample.binaryLight.devices;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Dictionary;
-import java.util.Properties;
-import java.util.Random;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.service.upnp.UPnPDevice;
-import org.osgi.service.upnp.UPnPIcon;
-import org.osgi.service.upnp.UPnPService;
-
-import org.apache.felix.upnp.extra.util.UPnPEventNotifier;
-import org.apache.felix.upnp.sample.binaryLight.LightModel;
-import org.apache.felix.upnp.sample.binaryLight.LightUI;
-import org.apache.felix.upnp.sample.binaryLight.icons.LightIcon;
-import org.apache.felix.upnp.sample.binaryLight.services.PowerSwitchService;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class LightDevice implements UPnPDevice {
-
-	final private String DEVICE_ID = "uuid:Felix-BinaryLight+" +Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());
-	private BundleContext context;
-	private LightModel model;
-	private LightUI ui;
-	private PowerSwitchService powerSwitch;
-	private UPnPService[] services;
-	private Dictionary dictionary;
-	private UPnPEventNotifier notifier;
-	
-	public LightDevice(BundleContext context) {
-		this.context=context;
-		model = new LightModel();
-		ui = new LightUI(model);
-		powerSwitch = new PowerSwitchService(model);
-		services = new UPnPService[]{powerSwitch};
-		setupDeviceProperties();
-		buildEventNotifyer();
-	}
-
-	public LightModel getModel(){
-		return model;
-	}
-	/**
-	 * 
-	 */
-	private void buildEventNotifyer() {
-		notifier = new UPnPEventNotifier(context,this,powerSwitch,model);
-	}
-
-	private void setupDeviceProperties(){
-		dictionary = new Properties();
-		dictionary.put(UPnPDevice.UPNP_EXPORT,"");
-		dictionary.put(
-		        org.osgi.service
-		        	.device.Constants.DEVICE_CATEGORY,
-	        	new String[]{UPnPDevice.DEVICE_CATEGORY}
-	        );
-		//dictionary.put(UPnPDevice.DEVICE_CATEGORY,new String[]{UPnPDevice.DEVICE_CATEGORY});
-		dictionary.put(UPnPDevice.FRIENDLY_NAME,"Felix OSGi-UPnP BinaryLight");
-		dictionary.put(UPnPDevice.MANUFACTURER,"Apache Software Foundation");
-		dictionary.put(UPnPDevice.MANUFACTURER_URL,"http://felix.apache.org");
-		dictionary.put(UPnPDevice.MODEL_DESCRIPTION,"A BinaryLight device to test OSGi to UPnP service export");
-		dictionary.put(UPnPDevice.MODEL_NAME,"Lucciola");
-		dictionary.put(UPnPDevice.MODEL_NUMBER,"1.0");
-		dictionary.put(UPnPDevice.MODEL_URL,"http://felix.apache.org/site/upnp-examples.html");
-		String port = context.getProperty("org.osgi.service.http.port");
-        InetAddress inet;
-		try {
-			inet = InetAddress.getLocalHost();
-	        String hostname = inet.getHostName();
-            //String hostname = inet.getHostAddress();
-		dictionary.put(UPnPDevice.PRESENTATION_URL,"http://"+hostname + ":"+port+"/upnp/binaryLight/");
-		} catch (UnknownHostException e) {
-			System.out.println("Warning: enable to cacth localhost name");
-		}
-		dictionary.put(UPnPDevice.SERIAL_NUMBER,"123456789");
-		dictionary.put(UPnPDevice.TYPE,"urn:schemas-upnp-org:device:BinaryLight:1");
-		dictionary.put(UPnPDevice.UDN,DEVICE_ID);
-		//dictionary.put(UPnPDevice.ID,dictionary.get(UPnPDevice.UDN));
-		dictionary.put(UPnPDevice.UPC,"1213456789");
-	}
-	
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getService(java.lang.String)
-	 */
-	public UPnPService getService(String serviceId) {
-		if  (serviceId.equals(powerSwitch.getId())) return powerSwitch;
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getServices()
-	 */
-	public UPnPService[] getServices() {
-		return services;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
-	 */
-	public UPnPIcon[] getIcons(String locale) {
-		UPnPIcon icon = new LightIcon();
-		return new UPnPIcon[]{icon} ;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getDescriptions(java.lang.String)
-	 */
-	public Dictionary getDescriptions(String locale) {
-		return dictionary;
-	}
-
-	/**
-	 * 
-	 */
-	public void close() {
-		ui.dispose();
-		notifier.destroy();
-	}
-	
-}
+/* 
+ * 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.sample.binaryLight.devices;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Dictionary;
+import java.util.Properties;
+import java.util.Random;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.upnp.UPnPDevice;
+import org.osgi.service.upnp.UPnPIcon;
+import org.osgi.service.upnp.UPnPService;
+
+import org.apache.felix.upnp.extra.util.UPnPEventNotifier;
+import org.apache.felix.upnp.sample.binaryLight.LightModel;
+import org.apache.felix.upnp.sample.binaryLight.LightUI;
+import org.apache.felix.upnp.sample.binaryLight.icons.LightIcon;
+import org.apache.felix.upnp.sample.binaryLight.services.PowerSwitchService;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class LightDevice implements UPnPDevice {
+
+	final private String DEVICE_ID = "uuid:Felix-BinaryLight+" +Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());
+	private BundleContext context;
+	private LightModel model;
+	private LightUI ui;
+	private PowerSwitchService powerSwitch;
+	private UPnPService[] services;
+	private Dictionary dictionary;
+	private UPnPEventNotifier notifier;
+	
+	public LightDevice(BundleContext context) {
+		this.context=context;
+		model = new LightModel();
+		ui = new LightUI(model);
+		powerSwitch = new PowerSwitchService(model);
+		services = new UPnPService[]{powerSwitch};
+		setupDeviceProperties();
+		buildEventNotifyer();
+	}
+
+	public LightModel getModel(){
+		return model;
+	}
+	/**
+	 * 
+	 */
+	private void buildEventNotifyer() {
+		notifier = new UPnPEventNotifier(context,this,powerSwitch,model);
+	}
+
+	private void setupDeviceProperties(){
+		dictionary = new Properties();
+		dictionary.put(UPnPDevice.UPNP_EXPORT,"");
+		dictionary.put(
+		        org.osgi.service
+		        	.device.Constants.DEVICE_CATEGORY,
+	        	new String[]{UPnPDevice.DEVICE_CATEGORY}
+	        );
+		//dictionary.put(UPnPDevice.DEVICE_CATEGORY,new String[]{UPnPDevice.DEVICE_CATEGORY});
+		dictionary.put(UPnPDevice.FRIENDLY_NAME,"Felix OSGi-UPnP BinaryLight");
+		dictionary.put(UPnPDevice.MANUFACTURER,"Apache Software Foundation");
+		dictionary.put(UPnPDevice.MANUFACTURER_URL,"http://felix.apache.org");
+		dictionary.put(UPnPDevice.MODEL_DESCRIPTION,"A BinaryLight device to test OSGi to UPnP service export");
+		dictionary.put(UPnPDevice.MODEL_NAME,"Lucciola");
+		dictionary.put(UPnPDevice.MODEL_NUMBER,"1.0");
+		dictionary.put(UPnPDevice.MODEL_URL,"http://felix.apache.org/site/upnp-examples.html");
+		String port = context.getProperty("org.osgi.service.http.port");
+        InetAddress inet;
+		try {
+			inet = InetAddress.getLocalHost();
+	        String hostname = inet.getHostName();
+            //String hostname = inet.getHostAddress();
+		dictionary.put(UPnPDevice.PRESENTATION_URL,"http://"+hostname + ":"+port+"/upnp/binaryLight/");
+		} catch (UnknownHostException e) {
+			System.out.println("Warning: enable to cacth localhost name");
+		}
+		dictionary.put(UPnPDevice.SERIAL_NUMBER,"123456789");
+		dictionary.put(UPnPDevice.TYPE,"urn:schemas-upnp-org:device:BinaryLight:1");
+		dictionary.put(UPnPDevice.UDN,DEVICE_ID);
+		//dictionary.put(UPnPDevice.ID,dictionary.get(UPnPDevice.UDN));
+		dictionary.put(UPnPDevice.UPC,"1213456789");
+	}
+	
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getService(java.lang.String)
+	 */
+	public UPnPService getService(String serviceId) {
+		if  (serviceId.equals(powerSwitch.getId())) return powerSwitch;
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getServices()
+	 */
+	public UPnPService[] getServices() {
+		return services;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
+	 */
+	public UPnPIcon[] getIcons(String locale) {
+		UPnPIcon icon = new LightIcon();
+		return new UPnPIcon[]{icon} ;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getDescriptions(java.lang.String)
+	 */
+	public Dictionary getDescriptions(String locale) {
+		return dictionary;
+	}
+
+	/**
+	 * 
+	 */
+	public void close() {
+		ui.dispose();
+		notifier.destroy();
+	}
+	
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/icons/LightIcon.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/icons/LightIcon.java
index 6f54e3b..75171b0 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/icons/LightIcon.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/icons/LightIcon.java
@@ -1,73 +1,73 @@
-/* 
- * 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.sample.binaryLight.icons;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.osgi.service.upnp.UPnPIcon;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class LightIcon implements UPnPIcon {
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getMimeType()
-	 */
-	public String getMimeType() {
-		return "image/gif";
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getWidth()
-	 */
-	public int getWidth() {
-		return 32;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getHeight()
-	 */
-	public int getHeight() {
-		return 32;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getSize()
-	 */
-	public int getSize() {
-		return 1072;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getDepth()
-	 */
-	public int getDepth() {
-		return 16;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getInputStream()
-	 */
-	public InputStream getInputStream() throws IOException {
-		return LightIcon.class.getResourceAsStream("images/LightOn.gif");
-	}
-}
+/* 
+ * 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.sample.binaryLight.icons;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.osgi.service.upnp.UPnPIcon;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class LightIcon implements UPnPIcon {
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getMimeType()
+	 */
+	public String getMimeType() {
+		return "image/gif";
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getWidth()
+	 */
+	public int getWidth() {
+		return 32;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getHeight()
+	 */
+	public int getHeight() {
+		return 32;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getSize()
+	 */
+	public int getSize() {
+		return 1072;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getDepth()
+	 */
+	public int getDepth() {
+		return 16;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getInputStream()
+	 */
+	public InputStream getInputStream() throws IOException {
+		return LightIcon.class.getResourceAsStream("images/LightOn.gif");
+	}
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/services/PowerSwitchService.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/services/PowerSwitchService.java
index c4fc2ac..7904c05 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/services/PowerSwitchService.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/services/PowerSwitchService.java
@@ -1,118 +1,118 @@
-/* 
- * 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.sample.binaryLight.services;
-
-import java.util.HashMap;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPService;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-import org.apache.felix.upnp.sample.binaryLight.LightModel;
-import org.apache.felix.upnp.sample.binaryLight.actions.GetStatusAction;
-import org.apache.felix.upnp.sample.binaryLight.actions.GetTargetAction;
-import org.apache.felix.upnp.sample.binaryLight.actions.SetTargetAction;
-import org.apache.felix.upnp.sample.binaryLight.statevariables.StatusStateVariable;
-import org.apache.felix.upnp.sample.binaryLight.statevariables.TargetStateVariable;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class PowerSwitchService implements UPnPService{
-	
-	final private String SERVICE_ID = "urn:upnp-org:serviceId:SwitchPower:1";
-	final private String SERVICE_TYPE = "urn:schemas-upnp-org:service:SwitchPower:1";
-	final private String VERSION ="1";
-
-	private LightModel model;
-	private UPnPStateVariable status,target;
-	private UPnPStateVariable[] states;
-	private HashMap actions = new HashMap();
-	
-	
-	public PowerSwitchService(LightModel model){
-		this.model = model;
-		status = new StatusStateVariable(model);
-		target = new TargetStateVariable();
-		this.states = new UPnPStateVariable[]{status,target};
-		
-		UPnPAction setTarget = new SetTargetAction(model,target);
-		UPnPAction getTarget = new GetTargetAction(model,target);
-		UPnPAction getStatus = new GetStatusAction(model,status);
-		actions.put(setTarget.getName(),setTarget);
-		actions.put(getTarget.getName(),getTarget);
-		actions.put(getStatus.getName(),getStatus);
-		
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getId()
-	 */
-	public String getId() {
-		return SERVICE_ID;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getType()
-	 */
-	public String getType() {
-		return SERVICE_TYPE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getVersion()
-	 */
-	public String getVersion() {
-		return VERSION;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getAction(java.lang.String)
-	 */
-	public UPnPAction getAction(String name) {
-		return (UPnPAction)actions.get(name);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getActions()
-	 */
-	public UPnPAction[] getActions() {
-		return (UPnPAction[])(actions.values()).toArray(new UPnPAction[]{});
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getStateVariables()
-	 */
-	public UPnPStateVariable[] getStateVariables() {
-		return states;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String name) {
-		if (name.equals("Status"))
-			return status;
-		else if (name.equals("Target"))
-			return target;
-		else return null;
-	}
-}
+/* 
+ * 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.sample.binaryLight.services;
+
+import java.util.HashMap;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPService;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+import org.apache.felix.upnp.sample.binaryLight.LightModel;
+import org.apache.felix.upnp.sample.binaryLight.actions.GetStatusAction;
+import org.apache.felix.upnp.sample.binaryLight.actions.GetTargetAction;
+import org.apache.felix.upnp.sample.binaryLight.actions.SetTargetAction;
+import org.apache.felix.upnp.sample.binaryLight.statevariables.StatusStateVariable;
+import org.apache.felix.upnp.sample.binaryLight.statevariables.TargetStateVariable;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class PowerSwitchService implements UPnPService{
+	
+	final private String SERVICE_ID = "urn:upnp-org:serviceId:SwitchPower:1";
+	final private String SERVICE_TYPE = "urn:schemas-upnp-org:service:SwitchPower:1";
+	final private String VERSION ="1";
+
+	private LightModel model;
+	private UPnPStateVariable status,target;
+	private UPnPStateVariable[] states;
+	private HashMap actions = new HashMap();
+	
+	
+	public PowerSwitchService(LightModel model){
+		this.model = model;
+		status = new StatusStateVariable(model);
+		target = new TargetStateVariable();
+		this.states = new UPnPStateVariable[]{status,target};
+		
+		UPnPAction setTarget = new SetTargetAction(model,target);
+		UPnPAction getTarget = new GetTargetAction(model,target);
+		UPnPAction getStatus = new GetStatusAction(model,status);
+		actions.put(setTarget.getName(),setTarget);
+		actions.put(getTarget.getName(),getTarget);
+		actions.put(getStatus.getName(),getStatus);
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getId()
+	 */
+	public String getId() {
+		return SERVICE_ID;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getType()
+	 */
+	public String getType() {
+		return SERVICE_TYPE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getVersion()
+	 */
+	public String getVersion() {
+		return VERSION;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getAction(java.lang.String)
+	 */
+	public UPnPAction getAction(String name) {
+		return (UPnPAction)actions.get(name);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getActions()
+	 */
+	public UPnPAction[] getActions() {
+		return (UPnPAction[])(actions.values()).toArray(new UPnPAction[]{});
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getStateVariables()
+	 */
+	public UPnPStateVariable[] getStateVariables() {
+		return states;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String name) {
+		if (name.equals("Status"))
+			return status;
+		else if (name.equals("Target"))
+			return target;
+		else return null;
+	}
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/statevariables/StatusStateVariable.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/statevariables/StatusStateVariable.java
index f28ea45..38c5f63 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/statevariables/StatusStateVariable.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/statevariables/StatusStateVariable.java
@@ -1,102 +1,102 @@
-/* 
- * 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.sample.binaryLight.statevariables;
-import org.osgi.service.upnp.UPnPLocalStateVariable;
-
-import org.apache.felix.upnp.sample.binaryLight.LightModel;
-
-public class StatusStateVariable implements UPnPLocalStateVariable{
-	
-	final private String NAME = "Status";
-	final private Boolean DEFAULT_VALUE = Boolean.FALSE;
-	private LightModel model;
-	
-	
-	public StatusStateVariable(LightModel model){
-		this.model= model;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
-	 */
-	public Class getJavaDataType() {
-		return Boolean.class;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
-	 */
-	public String getUPnPDataType() {
-		return TYPE_BOOLEAN;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
-	 */
-	public Object getDefaultValue() {
-		return DEFAULT_VALUE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
-	 */
-	public String[] getAllowedValues() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
-	 */
-	public Number getMinimum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
-	 */
-	public Number getMaximum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
-	 */
-	public Number getStep() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
-	 */
-	public boolean sendsEvents() {
-		return true;
-	}
-
-	public Object getCurrentValue() {
-		return new Boolean(model.getStatus());
-	}
-}
+/* 
+ * 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.sample.binaryLight.statevariables;
+import org.osgi.service.upnp.UPnPLocalStateVariable;
+
+import org.apache.felix.upnp.sample.binaryLight.LightModel;
+
+public class StatusStateVariable implements UPnPLocalStateVariable{
+	
+	final private String NAME = "Status";
+	final private Boolean DEFAULT_VALUE = Boolean.FALSE;
+	private LightModel model;
+	
+	
+	public StatusStateVariable(LightModel model){
+		this.model= model;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
+	 */
+	public Class getJavaDataType() {
+		return Boolean.class;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
+	 */
+	public String getUPnPDataType() {
+		return TYPE_BOOLEAN;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
+	 */
+	public Object getDefaultValue() {
+		return DEFAULT_VALUE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
+	 */
+	public String[] getAllowedValues() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
+	 */
+	public Number getMinimum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
+	 */
+	public Number getMaximum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
+	 */
+	public Number getStep() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
+	 */
+	public boolean sendsEvents() {
+		return true;
+	}
+
+	public Object getCurrentValue() {
+		return new Boolean(model.getStatus());
+	}
+}
diff --git a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/statevariables/TargetStateVariable.java b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/statevariables/TargetStateVariable.java
index cfa8918..c99a983 100644
--- a/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/statevariables/TargetStateVariable.java
+++ b/upnp/samples/binarylight/src/main/java/org/apache/felix/upnp/sample/binaryLight/statevariables/TargetStateVariable.java
@@ -1,94 +1,94 @@
-/* 
- * 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.sample.binaryLight.statevariables;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-public class TargetStateVariable implements UPnPStateVariable{
-	
-	final private String NAME = "Target";
-	final private Boolean DEFAULT_VALUE = Boolean.FALSE;
-	
-	
-	public TargetStateVariable(){
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
-	 */
-	public Class getJavaDataType() {
-		return Boolean.class;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
-	 */
-	public String getUPnPDataType() {
-		return TYPE_BOOLEAN;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
-	 */
-	public Object getDefaultValue() {
-		return DEFAULT_VALUE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
-	 */
-	public String[] getAllowedValues() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
-	 */
-	public Number getMinimum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
-	 */
-	public Number getMaximum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
-	 */
-	public Number getStep() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
-	 */
-	public boolean sendsEvents() {
-		return false;
-	}
-}
+/* 
+ * 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.sample.binaryLight.statevariables;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+public class TargetStateVariable implements UPnPStateVariable{
+	
+	final private String NAME = "Target";
+	final private Boolean DEFAULT_VALUE = Boolean.FALSE;
+	
+	
+	public TargetStateVariable(){
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
+	 */
+	public Class getJavaDataType() {
+		return Boolean.class;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
+	 */
+	public String getUPnPDataType() {
+		return TYPE_BOOLEAN;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
+	 */
+	public Object getDefaultValue() {
+		return DEFAULT_VALUE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
+	 */
+	public String[] getAllowedValues() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
+	 */
+	public Number getMinimum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
+	 */
+	public Number getMaximum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
+	 */
+	public Number getStep() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
+	 */
+	public boolean sendsEvents() {
+		return false;
+	}
+}
diff --git a/upnp/samples/clock/pom.xml b/upnp/samples/clock/pom.xml
index cdbbdb3..bd219df 100644
--- a/upnp/samples/clock/pom.xml
+++ b/upnp/samples/clock/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -17,60 +17,60 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <artifactId>felix</artifactId>
-    <groupId>org.apache.felix</groupId>
-    <version>1.0.2</version>
-    <relativePath>../../../pom/pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.felix</groupId>
-  <artifactId>org.apache.felix.upnp.sample.clock</artifactId>
-  <packaging>bundle</packaging>
-  <name>Apache Felix UPnP Sample Clock</name>
-  <version>0.2.0-SNAPSHOT</version>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>felix</artifactId>
+    <groupId>org.apache.felix</groupId>
+    <version>1.0.2</version>
+    <relativePath>../../../pom/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.felix</groupId>
+  <artifactId>org.apache.felix.upnp.sample.clock</artifactId>
+  <packaging>bundle</packaging>
+  <name>Apache Felix UPnP Sample Clock</name>
+  <version>0.2.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
         <version>1.4.0</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-Name>${pom.name}</Bundle-Name>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-Name>${pom.name}</Bundle-Name>
             <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
-            <Bundle-Author>Matteo Demuru &lt;demuru@apache.org&gt;,Francesco Furfari &lt;furfari@apache.org&gt;,Stefano "Kismet" Lenzi &lt;lenzi@apache.org&gt;</Bundle-Author>
-            <Bundle-Description>CyberLink Clock clone to test UPnPBase driver</Bundle-Description>
-            <Bundle-SymbolicName>org.apache.felix.upnp.sample.clock</Bundle-SymbolicName>
-            <Bundle-Activator>org.apache.felix.upnp.sample.clock.Activator</Bundle-Activator>
-            <Private-Package>org.apache.felix.upnp.sample.clock.*</Private-Package>
-            <Import-Package>*</Import-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
+            <Bundle-Author>Matteo Demuru &lt;demuru@apache.org&gt;,Francesco Furfari &lt;furfari@apache.org&gt;,Stefano "Kismet" Lenzi &lt;lenzi@apache.org&gt;</Bundle-Author>
+            <Bundle-Description>CyberLink Clock clone to test UPnPBase driver</Bundle-Description>
+            <Bundle-SymbolicName>org.apache.felix.upnp.sample.clock</Bundle-SymbolicName>
+            <Bundle-Activator>org.apache.felix.upnp.sample.clock.Activator</Bundle-Activator>
+            <Private-Package>org.apache.felix.upnp.sample.clock.*</Private-Package>
+            <Import-Package>*</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>1.1.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
       <version>1.0.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.upnp.extra</artifactId>
-      <version>0.3.0-SNAPSHOT</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-</project>
-
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.upnp.extra</artifactId>
+      <version>0.3.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>
+
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/Clock.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/Clock.java
index fffbc77..ef69110 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/Clock.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/Clock.java
@@ -1,156 +1,156 @@
-/* 
- * 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.sample.clock;
-
-import java.util.Calendar;
-
-public class Clock
-{
-	private Calendar cal;
-
-	public Clock(Calendar cal)
-	{
-		this.cal = cal;
-	}
-
-	public Calendar getCalendar()
-	{
-		return cal;
-	}
-
-	////////////////////////////////////////////////
-	//	Time
-	////////////////////////////////////////////////
-
-	public int getHour()
-	{
-		return getCalendar().get(Calendar.HOUR);
-	}
-
-	public int getMinute()
-	{
-		return getCalendar().get(Calendar.MINUTE);
-	}
-
-	public int getSecond()
-	{
-		return getCalendar().get(Calendar.SECOND);
-	}
-	
-	////////////////////////////////////////////////
-	//	paint
-	////////////////////////////////////////////////
-
-	public final static Clock getInstance()
-	{
-		return new Clock(Calendar.getInstance());
-	}
-
-	////////////////////////////////////////////////
-	//	getDateString
-	////////////////////////////////////////////////
-
-	public final static String toClockString(int value)
-	{
-		if (value < 10)
-			return "0" + Integer.toString(value);
-		return Integer.toString(value);
-	}
-
-	private final static String MONTH_STRING[] = {
-		"Jan",
-		"Feb",
-		"Mar",
-		"Apr",
-		"May",
-		"Jun",
-		"Jul",
-		"Aug",
-		"Sep",
-		"Oct",
-		"Nov",
-		"Dec",
-	};
-
-	public final static String toMonthString(int value)
-	{
-		value -= Calendar.JANUARY;
-		if (0 <= value && value < 12)
-			return MONTH_STRING[value];
-		return "";
-	}
-	
-	private final static String WEEK_STRING[] = {
-		"Sun",
-		"Mon",
-		"Tue",
-		"Wed",
-		"Thu",
-		"Fri",
-		"Sat",
-	};
-
-	public final static String toWeekString(int value)
-	{
-		value -= Calendar.SUNDAY;
-		if (0 <= value && value < 7)
-			return WEEK_STRING[value];
-		return "";
-	}
-	
-	public String getDateString()
-	{
-		Calendar cal = getCalendar();
-		return
-			toWeekString(cal.get(Calendar.DAY_OF_WEEK)) +", " + 
-			toMonthString(cal.get(Calendar.MONTH)) + " " +
-			Integer.toString(cal.get(Calendar.DATE)) + ", " +
-			toClockString(cal.get(Calendar.YEAR) % 100);
-	}
-
-	////////////////////////////////////////////////
-	//	getTimeString
-	////////////////////////////////////////////////
-	
-	public String getTimeString()
-	{
-		Calendar cal = getCalendar();
-		return
-			toClockString(cal.get(Calendar.HOUR)) +
-			(((cal.get(Calendar.SECOND) % 2) == 0) ? ":" : " ") +
-			toClockString(cal.get(Calendar.MINUTE));
-	}
-
-	////////////////////////////////////////////////
-	//	toString
-	////////////////////////////////////////////////
-
-	public String toString()
-	{
-		Calendar cal = getCalendar();
-		return
-			getDateString() + ", " +
-			toClockString(cal.get(Calendar.HOUR)) + ":" +
-			toClockString(cal.get(Calendar.MINUTE)) + ":" +
-			toClockString(cal.get(Calendar.SECOND));
-	}
-		
-}
-
+/* 
+ * 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.sample.clock;
+
+import java.util.Calendar;
+
+public class Clock
+{
+	private Calendar cal;
+
+	public Clock(Calendar cal)
+	{
+		this.cal = cal;
+	}
+
+	public Calendar getCalendar()
+	{
+		return cal;
+	}
+
+	////////////////////////////////////////////////
+	//	Time
+	////////////////////////////////////////////////
+
+	public int getHour()
+	{
+		return getCalendar().get(Calendar.HOUR);
+	}
+
+	public int getMinute()
+	{
+		return getCalendar().get(Calendar.MINUTE);
+	}
+
+	public int getSecond()
+	{
+		return getCalendar().get(Calendar.SECOND);
+	}
+	
+	////////////////////////////////////////////////
+	//	paint
+	////////////////////////////////////////////////
+
+	public final static Clock getInstance()
+	{
+		return new Clock(Calendar.getInstance());
+	}
+
+	////////////////////////////////////////////////
+	//	getDateString
+	////////////////////////////////////////////////
+
+	public final static String toClockString(int value)
+	{
+		if (value < 10)
+			return "0" + Integer.toString(value);
+		return Integer.toString(value);
+	}
+
+	private final static String MONTH_STRING[] = {
+		"Jan",
+		"Feb",
+		"Mar",
+		"Apr",
+		"May",
+		"Jun",
+		"Jul",
+		"Aug",
+		"Sep",
+		"Oct",
+		"Nov",
+		"Dec",
+	};
+
+	public final static String toMonthString(int value)
+	{
+		value -= Calendar.JANUARY;
+		if (0 <= value && value < 12)
+			return MONTH_STRING[value];
+		return "";
+	}
+	
+	private final static String WEEK_STRING[] = {
+		"Sun",
+		"Mon",
+		"Tue",
+		"Wed",
+		"Thu",
+		"Fri",
+		"Sat",
+	};
+
+	public final static String toWeekString(int value)
+	{
+		value -= Calendar.SUNDAY;
+		if (0 <= value && value < 7)
+			return WEEK_STRING[value];
+		return "";
+	}
+	
+	public String getDateString()
+	{
+		Calendar cal = getCalendar();
+		return
+			toWeekString(cal.get(Calendar.DAY_OF_WEEK)) +", " + 
+			toMonthString(cal.get(Calendar.MONTH)) + " " +
+			Integer.toString(cal.get(Calendar.DATE)) + ", " +
+			toClockString(cal.get(Calendar.YEAR) % 100);
+	}
+
+	////////////////////////////////////////////////
+	//	getTimeString
+	////////////////////////////////////////////////
+	
+	public String getTimeString()
+	{
+		Calendar cal = getCalendar();
+		return
+			toClockString(cal.get(Calendar.HOUR)) +
+			(((cal.get(Calendar.SECOND) % 2) == 0) ? ":" : " ") +
+			toClockString(cal.get(Calendar.MINUTE));
+	}
+
+	////////////////////////////////////////////////
+	//	toString
+	////////////////////////////////////////////////
+
+	public String toString()
+	{
+		Calendar cal = getCalendar();
+		return
+			getDateString() + ", " +
+			toClockString(cal.get(Calendar.HOUR)) + ":" +
+			toClockString(cal.get(Calendar.MINUTE)) + ":" +
+			toClockString(cal.get(Calendar.SECOND));
+	}
+		
+}
+
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockDevice.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockDevice.java
index cbce196..fac9bb0 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockDevice.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockDevice.java
@@ -1,142 +1,142 @@
-/* 
- * 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.sample.clock;
-
-
-import java.beans.PropertyChangeEvent;
-import java.util.Calendar;
-import java.util.Dictionary;
-import java.util.Properties;
-import java.util.Random;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.service.upnp.UPnPDevice;
-import org.osgi.service.upnp.UPnPIcon;
-import org.osgi.service.upnp.UPnPService;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-import org.apache.felix.upnp.extra.util.UPnPEventNotifier;
-
-public class ClockDevice implements UPnPDevice {
-
-	final private String DEVICE_ID = "uuid:Felix-Clock+"+Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());
-	private BundleContext context;
-	private TimerService timerService;
-	private UPnPService[] services;
-	private Dictionary dictionary;
-	public static UPnPEventNotifier notifier = null;
-	
-	public ClockDevice(BundleContext context) {
-		this.context=context;
-		timerService = new TimerService();
-		services = new UPnPService[]{timerService};
-		setupDeviceProperties();
-		buildEventNotifyer();
-	}
-
-	/**
-	 * 
-	 */
-	private void buildEventNotifyer() {
-		 notifier = new UPnPEventNotifier(context,this,timerService);
-	}
-
-	private void setupDeviceProperties(){
-		dictionary = new Properties();
-		dictionary.put(UPnPDevice.UPNP_EXPORT,"");
-		dictionary.put(
-		        org.osgi.service
-		        	.device.Constants.DEVICE_CATEGORY,
-	        	new String[]{UPnPDevice.DEVICE_CATEGORY}
-	        );
-		//dictionary.put(UPnPDevice.DEVICE_CATEGORY,new String[]{UPnPDevice.DEVICE_CATEGORY});
-		dictionary.put(UPnPDevice.FRIENDLY_NAME,"Felix OSGi-UPnP Clock");
-		dictionary.put(UPnPDevice.MANUFACTURER,"Apache Software Foundation");
-		dictionary.put(UPnPDevice.MANUFACTURER_URL,"http://felix.apache.org");
-		dictionary.put(UPnPDevice.MODEL_DESCRIPTION,"A CyberLink Clock device clone to test OSGi to UPnP service export");
-		dictionary.put(UPnPDevice.MODEL_NAME,"DolceDormire");
-		dictionary.put(UPnPDevice.MODEL_NUMBER,"1.0");
-		dictionary.put(UPnPDevice.MODEL_URL,"http://felix.apache.org/site/upnp-examples.html");
-		//dictionary.put(UPnPDevice.PRESENTATION_URL,"http://felix.apache.org/dolceDormire/presentation");
-		dictionary.put(UPnPDevice.SERIAL_NUMBER,"123456789");
-		dictionary.put(UPnPDevice.TYPE,"urn:schemas-upnp-org:device:clock:1");
-		dictionary.put(UPnPDevice.UDN,DEVICE_ID);
-		//dictionary.put(UPnPDevice.ID,dictionary.get(UPnPDevice.UDN));
-		dictionary.put(UPnPDevice.UPC,"1213456789");
-	}
-	
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getService(java.lang.String)
-	 */
-	public UPnPService getService(String serviceId) {
-		if  (serviceId.equals(timerService.getId())) return timerService;
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getServices()
-	 */
-	public UPnPService[] getServices() {
-		return services;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
-	 */
-	public UPnPIcon[] getIcons(String locale) {
-		UPnPIcon icon = new ClockIcon();
-		return new UPnPIcon[]{icon} ;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getDescriptions(java.lang.String)
-	 */
-	public Dictionary getDescriptions(String locale) {
-		return dictionary;
-	}
-
-	/**
-	 * 
-	 */
-	public void start() {
-		// TODO Auto-generated method stub
-		
-	}
-
-	/**
-	 * 
-	 */
-	public void stop() {
-		notifier.destroy();	
-	}
-
-	/**
-	 * 
-	 */
-	public void update() {
-		Clock clock = Clock.getInstance();
-		Calendar cal = clock.getCalendar();
-        long time = cal.getTime().getTime();
-        UPnPStateVariable variable =  timerService.getStateVariable("Time");
-		notifier.propertyChange(new PropertyChangeEvent(variable,"Time",new Long(time-1000),new Long(time)));
-	}
-	
-}
+/* 
+ * 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.sample.clock;
+
+
+import java.beans.PropertyChangeEvent;
+import java.util.Calendar;
+import java.util.Dictionary;
+import java.util.Properties;
+import java.util.Random;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.upnp.UPnPDevice;
+import org.osgi.service.upnp.UPnPIcon;
+import org.osgi.service.upnp.UPnPService;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+import org.apache.felix.upnp.extra.util.UPnPEventNotifier;
+
+public class ClockDevice implements UPnPDevice {
+
+	final private String DEVICE_ID = "uuid:Felix-Clock+"+Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());
+	private BundleContext context;
+	private TimerService timerService;
+	private UPnPService[] services;
+	private Dictionary dictionary;
+	public static UPnPEventNotifier notifier = null;
+	
+	public ClockDevice(BundleContext context) {
+		this.context=context;
+		timerService = new TimerService();
+		services = new UPnPService[]{timerService};
+		setupDeviceProperties();
+		buildEventNotifyer();
+	}
+
+	/**
+	 * 
+	 */
+	private void buildEventNotifyer() {
+		 notifier = new UPnPEventNotifier(context,this,timerService);
+	}
+
+	private void setupDeviceProperties(){
+		dictionary = new Properties();
+		dictionary.put(UPnPDevice.UPNP_EXPORT,"");
+		dictionary.put(
+		        org.osgi.service
+		        	.device.Constants.DEVICE_CATEGORY,
+	        	new String[]{UPnPDevice.DEVICE_CATEGORY}
+	        );
+		//dictionary.put(UPnPDevice.DEVICE_CATEGORY,new String[]{UPnPDevice.DEVICE_CATEGORY});
+		dictionary.put(UPnPDevice.FRIENDLY_NAME,"Felix OSGi-UPnP Clock");
+		dictionary.put(UPnPDevice.MANUFACTURER,"Apache Software Foundation");
+		dictionary.put(UPnPDevice.MANUFACTURER_URL,"http://felix.apache.org");
+		dictionary.put(UPnPDevice.MODEL_DESCRIPTION,"A CyberLink Clock device clone to test OSGi to UPnP service export");
+		dictionary.put(UPnPDevice.MODEL_NAME,"DolceDormire");
+		dictionary.put(UPnPDevice.MODEL_NUMBER,"1.0");
+		dictionary.put(UPnPDevice.MODEL_URL,"http://felix.apache.org/site/upnp-examples.html");
+		//dictionary.put(UPnPDevice.PRESENTATION_URL,"http://felix.apache.org/dolceDormire/presentation");
+		dictionary.put(UPnPDevice.SERIAL_NUMBER,"123456789");
+		dictionary.put(UPnPDevice.TYPE,"urn:schemas-upnp-org:device:clock:1");
+		dictionary.put(UPnPDevice.UDN,DEVICE_ID);
+		//dictionary.put(UPnPDevice.ID,dictionary.get(UPnPDevice.UDN));
+		dictionary.put(UPnPDevice.UPC,"1213456789");
+	}
+	
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getService(java.lang.String)
+	 */
+	public UPnPService getService(String serviceId) {
+		if  (serviceId.equals(timerService.getId())) return timerService;
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getServices()
+	 */
+	public UPnPService[] getServices() {
+		return services;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
+	 */
+	public UPnPIcon[] getIcons(String locale) {
+		UPnPIcon icon = new ClockIcon();
+		return new UPnPIcon[]{icon} ;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getDescriptions(java.lang.String)
+	 */
+	public Dictionary getDescriptions(String locale) {
+		return dictionary;
+	}
+
+	/**
+	 * 
+	 */
+	public void start() {
+		// TODO Auto-generated method stub
+		
+	}
+
+	/**
+	 * 
+	 */
+	public void stop() {
+		notifier.destroy();	
+	}
+
+	/**
+	 * 
+	 */
+	public void update() {
+		Clock clock = Clock.getInstance();
+		Calendar cal = clock.getCalendar();
+        long time = cal.getTime().getTime();
+        UPnPStateVariable variable =  timerService.getStateVariable("Time");
+		notifier.propertyChange(new PropertyChangeEvent(variable,"Time",new Long(time-1000),new Long(time)));
+	}
+	
+}
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockFrame.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockFrame.java
index aa19acb..4adeff2 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockFrame.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockFrame.java
@@ -1,123 +1,123 @@
-/* 
- * 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.sample.clock;
-
-import java.awt.BorderLayout;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.net.URL;
-
-import javax.swing.ImageIcon;
-import javax.swing.JFrame;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-
-public class ClockFrame extends JFrame implements Runnable 
-{
-	private final static String TITLE = "Felix UPnP Clock";
-	private ClockDevice clockDev;
-	private ClockPane clockPane;
-	
-	public ClockFrame(final BundleContext context)
-	{
-		super(TITLE);
-		try {
-			clockDev = new ClockDevice( context);
-		}
-		catch (Exception e) {
-			System.out.println(e);
-		}
-				
-		getContentPane().setLayout(new BorderLayout());
-
-		clockPane = new ClockPane();		
-		getContentPane().add(clockPane, BorderLayout.CENTER);
-
-		addWindowListener(new WindowAdapter(){
-			public void windowClosing(WindowEvent e) 
-			{
-				try {
-					context.getBundle().stop();
-				} catch (BundleException ex) {
-					ex.printStackTrace();
-				}
-			}
-		});			
-	       try {
-	            URL eventIconUrl = ClockFrame.class.getResource("images/logo.gif");           
-	            ImageIcon icon=  new ImageIcon(eventIconUrl,"logo");
-	            setIconImage(icon.getImage());
-	       }
-	        catch (Exception ex){
-	                System.out.println("Resource: IMAGES/logo.gif not found : " + ex.toString());
-	        }
-		
-		pack();
-		setVisible(true);
-	}
-
-	public ClockPane getClockPanel()
-	{
-		return clockPane;
-	}
-
-	public ClockDevice getClockDevice()
-	{
-		return clockDev;
-	}
-		
-	////////////////////////////////////////////////
-	//	run	
-	////////////////////////////////////////////////
-
-	private Thread timerThread = null;
-		
-	public void run()
-	{
-		Thread thisThread = Thread.currentThread();
-
-		while (timerThread == thisThread) {
-			getClockDevice().update();
-			getClockPanel().repaint();
-			try {
-				Thread.sleep(1000);
-			}
-			catch(InterruptedException e) {}
-		}
-	}
-	
-	public void start()
-	{
-		clockDev.start();
-		
-		timerThread = new Thread(this,"upnp.sample.clock.ClockFrame");
-		timerThread.start();
-	}
-	
-	public void stop()
-	{
-		clockDev.stop();
-		timerThread = null;
-		dispose();
-	}
-
-}
-
+/* 
+ * 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.sample.clock;
+
+import java.awt.BorderLayout;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URL;
+
+import javax.swing.ImageIcon;
+import javax.swing.JFrame;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+public class ClockFrame extends JFrame implements Runnable 
+{
+	private final static String TITLE = "Felix UPnP Clock";
+	private ClockDevice clockDev;
+	private ClockPane clockPane;
+	
+	public ClockFrame(final BundleContext context)
+	{
+		super(TITLE);
+		try {
+			clockDev = new ClockDevice( context);
+		}
+		catch (Exception e) {
+			System.out.println(e);
+		}
+				
+		getContentPane().setLayout(new BorderLayout());
+
+		clockPane = new ClockPane();		
+		getContentPane().add(clockPane, BorderLayout.CENTER);
+
+		addWindowListener(new WindowAdapter(){
+			public void windowClosing(WindowEvent e) 
+			{
+				try {
+					context.getBundle().stop();
+				} catch (BundleException ex) {
+					ex.printStackTrace();
+				}
+			}
+		});			
+	       try {
+	            URL eventIconUrl = ClockFrame.class.getResource("images/logo.gif");           
+	            ImageIcon icon=  new ImageIcon(eventIconUrl,"logo");
+	            setIconImage(icon.getImage());
+	       }
+	        catch (Exception ex){
+	                System.out.println("Resource: IMAGES/logo.gif not found : " + ex.toString());
+	        }
+		
+		pack();
+		setVisible(true);
+	}
+
+	public ClockPane getClockPanel()
+	{
+		return clockPane;
+	}
+
+	public ClockDevice getClockDevice()
+	{
+		return clockDev;
+	}
+		
+	////////////////////////////////////////////////
+	//	run	
+	////////////////////////////////////////////////
+
+	private Thread timerThread = null;
+		
+	public void run()
+	{
+		Thread thisThread = Thread.currentThread();
+
+		while (timerThread == thisThread) {
+			getClockDevice().update();
+			getClockPanel().repaint();
+			try {
+				Thread.sleep(1000);
+			}
+			catch(InterruptedException e) {}
+		}
+	}
+	
+	public void start()
+	{
+		clockDev.start();
+		
+		timerThread = new Thread(this,"upnp.sample.clock.ClockFrame");
+		timerThread.start();
+	}
+	
+	public void stop()
+	{
+		clockDev.stop();
+		timerThread = null;
+		dispose();
+	}
+
+}
+
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockIcon.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockIcon.java
index f97d539..764ed1e 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockIcon.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockIcon.java
@@ -1,69 +1,69 @@
-/* 
- * 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.sample.clock;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.osgi.service.upnp.UPnPIcon;
-
-public class ClockIcon implements UPnPIcon {
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getMimeType()
-	 */
-	public String getMimeType() {
-		return "image/gif";
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getWidth()
-	 */
-	public int getWidth() {
-		return 32;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getHeight()
-	 */
-	public int getHeight() {
-		return 32;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getSize()
-	 */
-	public int getSize() {
-		return 0;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getDepth()
-	 */
-	public int getDepth() {
-		return 16;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getInputStream()
-	 */
-	public InputStream getInputStream() throws IOException {
-		return ClockIcon.class.getResourceAsStream("images/clock.gif");
-	}
-}
+/* 
+ * 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.sample.clock;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.osgi.service.upnp.UPnPIcon;
+
+public class ClockIcon implements UPnPIcon {
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getMimeType()
+	 */
+	public String getMimeType() {
+		return "image/gif";
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getWidth()
+	 */
+	public int getWidth() {
+		return 32;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getHeight()
+	 */
+	public int getHeight() {
+		return 32;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getSize()
+	 */
+	public int getSize() {
+		return 0;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getDepth()
+	 */
+	public int getDepth() {
+		return 16;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getInputStream()
+	 */
+	public InputStream getInputStream() throws IOException {
+		return ClockIcon.class.getResourceAsStream("images/clock.gif");
+	}
+}
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockPane.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockPane.java
index 9cc5c0c..25b931e 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockPane.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ClockPane.java
@@ -1,212 +1,212 @@
-/* 
- * 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.sample.clock;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.BufferedImage;
-
-import javax.imageio.ImageIO;
-import javax.swing.JPanel;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class ClockPane extends JPanel  // MouseListener
-{
-	public ClockPane()
-	{
-		loadImage();
-		initPanel();
-	}
-
-	////////////////////////////////////////////////
-	//	Background
-	////////////////////////////////////////////////
-	
-
-	private BufferedImage panelmage;
-	
-	private void loadImage()
-	{
-		
-		try {
-			panelmage = ImageIO.read(ClockPane.class.getResourceAsStream("images/clock.jpg"));
-		}
-		catch (Exception e) {
-			System.out.println(e);
-		}
-	}
-
-	private BufferedImage getPaneImage()
-	{
-		return panelmage;
-	}
-
-	////////////////////////////////////////////////
-	//	Background
-	////////////////////////////////////////////////
-
-	private void initPanel()
-	{
-		BufferedImage panelmage = getPaneImage();
-		setPreferredSize(new Dimension(panelmage.getWidth(), panelmage.getHeight()));
-	}
-
-	////////////////////////////////////////////////
-	//	Font
-	////////////////////////////////////////////////
-
-	private final static String DEFAULT_FONT_NAME = "Lucida Console";
-	private final static int DEFAULT_TIME_FONT_SIZE = 60;
-	private final static int DEFAULT_DATE_FONT_SIZE = 18;
-	private final static int DEFAULT_SECOND_BLOCK_HEIGHT = 8;
-	private final static int DEFAULT_SECOND_BLOCK_FONT_SIZE = 10;
-
-	private Font timeFont = null;
-	private Font dateFont = null;
-	private Font secondFont = null;
-
-	private Font getFont(Graphics g, int size)
-	{
-		Font font = new Font(DEFAULT_FONT_NAME, Font.PLAIN, size);
-		if (font != null)
-			return font;
-		return g.getFont();
-	}
-		
-	private Font getTimeFont(Graphics g)
-	{
-		if (timeFont == null)
-			timeFont = getFont(g, DEFAULT_TIME_FONT_SIZE);
-		return timeFont;
-	}
-
-	private Font getDateFont(Graphics g)
-	{
-		if (dateFont == null)
-			dateFont = getFont(g, DEFAULT_DATE_FONT_SIZE);
-		return dateFont;
-	}
-
-	private Font getSecondFont(Graphics g)
-	{
-		if (secondFont == null)
-			secondFont = getFont(g, DEFAULT_SECOND_BLOCK_FONT_SIZE);
-		return secondFont;
-	}
-
-	////////////////////////////////////////////////
-	//	paint
-	////////////////////////////////////////////////
-
-	private void drawClockInfo(Graphics g)
-	{
-		Clock clock = Clock.getInstance();
-		
-		int winWidth = getWidth();
-		int winHeight = getHeight();
-		
-		g.setColor(Color.BLACK);
-		
-		//// Time String ////
-		
-		String timeStr = clock.getTimeString();
-
-		Font timeFont = getTimeFont(g);
-		g.setFont(timeFont);
-
-		FontMetrics timeFontMetric = g.getFontMetrics();
-		Rectangle2D timeStrBounds = timeFontMetric.getStringBounds(timeStr, g);
-
-		int timeStrWidth = (int)timeStrBounds.getWidth();		
-		int timeStrHeight = (int)timeStrBounds.getHeight();
-		int timeStrX = (winWidth-timeStrWidth)/2;
-		int timeStrY = (winHeight+timeStrHeight)/2;
-		int timeStrOffset = timeStrHeight/8/2;
-		g.drawString(
-			timeStr,
-			timeStrX,
-			timeStrY);
-
-		//// Date String ////
-
-		String dateStr = clock.getDateString();
-
-		Font dateFont = getDateFont(g);
-		g.setFont(dateFont);
-
-		FontMetrics dateFontMetric = g.getFontMetrics();
-		Rectangle2D dateStrBounds = dateFontMetric.getStringBounds(dateStr, g);
-
-		g.drawString(
-			dateStr,
-			(winWidth-(int)dateStrBounds.getWidth())/2,
-			timeStrY-timeStrHeight-timeStrOffset);
-
-		//// Second Bar ////
-		
-		Font secFont = getSecondFont(g);
-		g.setFont(secFont);
-		int sec = clock.getSecond();
-		int secBarBlockSize = timeStrWidth / 60;
-		int secBarBlockY = timeStrY + timeStrOffset;
-		for (int n=0; n<sec; n++) {
-			int x = timeStrX + (secBarBlockSize*n);
-			g.fillRect(
-				x,
-				secBarBlockY,
-				secBarBlockSize-1,
-				DEFAULT_SECOND_BLOCK_HEIGHT);
-		}
-		if (sec != 0 && (sec % 10) == 0) {
-			int x = timeStrX + (secBarBlockSize*sec);
-			g.drawString(
-				Integer.toString(sec),
-				x + secBarBlockSize,
-				secBarBlockY + DEFAULT_SECOND_BLOCK_HEIGHT);
-		}
-	}
-
-	private void clear(Graphics g)
-	{
-		g.setColor(Color.GRAY);
-		g.clearRect(0, 0, getWidth(), getHeight());
-	}
-	
-
-	private void drawPanelImage(Graphics g)
-	{
-		g.drawImage(getPaneImage(), 0, 0, null);
-	}
-		
-	public void paint(Graphics g)
-	{
-		clear(g);
-		drawPanelImage(g);
-		drawClockInfo(g);
-	}
-}
-
+/* 
+ * 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.sample.clock;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import javax.imageio.ImageIO;
+import javax.swing.JPanel;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class ClockPane extends JPanel  // MouseListener
+{
+	public ClockPane()
+	{
+		loadImage();
+		initPanel();
+	}
+
+	////////////////////////////////////////////////
+	//	Background
+	////////////////////////////////////////////////
+	
+
+	private BufferedImage panelmage;
+	
+	private void loadImage()
+	{
+		
+		try {
+			panelmage = ImageIO.read(ClockPane.class.getResourceAsStream("images/clock.jpg"));
+		}
+		catch (Exception e) {
+			System.out.println(e);
+		}
+	}
+
+	private BufferedImage getPaneImage()
+	{
+		return panelmage;
+	}
+
+	////////////////////////////////////////////////
+	//	Background
+	////////////////////////////////////////////////
+
+	private void initPanel()
+	{
+		BufferedImage panelmage = getPaneImage();
+		setPreferredSize(new Dimension(panelmage.getWidth(), panelmage.getHeight()));
+	}
+
+	////////////////////////////////////////////////
+	//	Font
+	////////////////////////////////////////////////
+
+	private final static String DEFAULT_FONT_NAME = "Lucida Console";
+	private final static int DEFAULT_TIME_FONT_SIZE = 60;
+	private final static int DEFAULT_DATE_FONT_SIZE = 18;
+	private final static int DEFAULT_SECOND_BLOCK_HEIGHT = 8;
+	private final static int DEFAULT_SECOND_BLOCK_FONT_SIZE = 10;
+
+	private Font timeFont = null;
+	private Font dateFont = null;
+	private Font secondFont = null;
+
+	private Font getFont(Graphics g, int size)
+	{
+		Font font = new Font(DEFAULT_FONT_NAME, Font.PLAIN, size);
+		if (font != null)
+			return font;
+		return g.getFont();
+	}
+		
+	private Font getTimeFont(Graphics g)
+	{
+		if (timeFont == null)
+			timeFont = getFont(g, DEFAULT_TIME_FONT_SIZE);
+		return timeFont;
+	}
+
+	private Font getDateFont(Graphics g)
+	{
+		if (dateFont == null)
+			dateFont = getFont(g, DEFAULT_DATE_FONT_SIZE);
+		return dateFont;
+	}
+
+	private Font getSecondFont(Graphics g)
+	{
+		if (secondFont == null)
+			secondFont = getFont(g, DEFAULT_SECOND_BLOCK_FONT_SIZE);
+		return secondFont;
+	}
+
+	////////////////////////////////////////////////
+	//	paint
+	////////////////////////////////////////////////
+
+	private void drawClockInfo(Graphics g)
+	{
+		Clock clock = Clock.getInstance();
+		
+		int winWidth = getWidth();
+		int winHeight = getHeight();
+		
+		g.setColor(Color.BLACK);
+		
+		//// Time String ////
+		
+		String timeStr = clock.getTimeString();
+
+		Font timeFont = getTimeFont(g);
+		g.setFont(timeFont);
+
+		FontMetrics timeFontMetric = g.getFontMetrics();
+		Rectangle2D timeStrBounds = timeFontMetric.getStringBounds(timeStr, g);
+
+		int timeStrWidth = (int)timeStrBounds.getWidth();		
+		int timeStrHeight = (int)timeStrBounds.getHeight();
+		int timeStrX = (winWidth-timeStrWidth)/2;
+		int timeStrY = (winHeight+timeStrHeight)/2;
+		int timeStrOffset = timeStrHeight/8/2;
+		g.drawString(
+			timeStr,
+			timeStrX,
+			timeStrY);
+
+		//// Date String ////
+
+		String dateStr = clock.getDateString();
+
+		Font dateFont = getDateFont(g);
+		g.setFont(dateFont);
+
+		FontMetrics dateFontMetric = g.getFontMetrics();
+		Rectangle2D dateStrBounds = dateFontMetric.getStringBounds(dateStr, g);
+
+		g.drawString(
+			dateStr,
+			(winWidth-(int)dateStrBounds.getWidth())/2,
+			timeStrY-timeStrHeight-timeStrOffset);
+
+		//// Second Bar ////
+		
+		Font secFont = getSecondFont(g);
+		g.setFont(secFont);
+		int sec = clock.getSecond();
+		int secBarBlockSize = timeStrWidth / 60;
+		int secBarBlockY = timeStrY + timeStrOffset;
+		for (int n=0; n<sec; n++) {
+			int x = timeStrX + (secBarBlockSize*n);
+			g.fillRect(
+				x,
+				secBarBlockY,
+				secBarBlockSize-1,
+				DEFAULT_SECOND_BLOCK_HEIGHT);
+		}
+		if (sec != 0 && (sec % 10) == 0) {
+			int x = timeStrX + (secBarBlockSize*sec);
+			g.drawString(
+				Integer.toString(sec),
+				x + secBarBlockSize,
+				secBarBlockY + DEFAULT_SECOND_BLOCK_HEIGHT);
+		}
+	}
+
+	private void clear(Graphics g)
+	{
+		g.setColor(Color.GRAY);
+		g.clearRect(0, 0, getWidth(), getHeight());
+	}
+	
+
+	private void drawPanelImage(Graphics g)
+	{
+		g.drawImage(getPaneImage(), 0, 0, null);
+	}
+		
+	public void paint(Graphics g)
+	{
+		clear(g);
+		drawPanelImage(g);
+		drawClockInfo(g);
+	}
+}
+
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/GetTimeAction.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/GetTimeAction.java
index f2f4abb..db32b79 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/GetTimeAction.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/GetTimeAction.java
@@ -1,89 +1,89 @@
-/* 
- * 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.sample.clock;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class GetTimeAction implements UPnPAction {
-
-	final private String NAME = "GetTime";
-	final private String RESULT_STATUS = "CurrentTime";
-	final private String[] OUT_ARG_NAMES = new String[]{RESULT_STATUS};
-	private TimeStateVariable time;
-	
-	
-	public GetTimeAction(TimeStateVariable time){
-		this.time = time;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
-	 */
-	public String getReturnArgumentName() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
-	 */
-	public String[] getInputArgumentNames() {
-		
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
-	 */
-	public String[] getOutputArgumentNames() {
-		return OUT_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String argumentName) {
-		return time;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
-	 */
-	public Dictionary invoke(Dictionary args) throws Exception {
-		String value = time.getCurrentTime();
-		Hashtable result = new Hashtable();
-		result.put(RESULT_STATUS,value);
-		return result;
-	}
-}
+/* 
+ * 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.sample.clock;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class GetTimeAction implements UPnPAction {
+
+	final private String NAME = "GetTime";
+	final private String RESULT_STATUS = "CurrentTime";
+	final private String[] OUT_ARG_NAMES = new String[]{RESULT_STATUS};
+	private TimeStateVariable time;
+	
+	
+	public GetTimeAction(TimeStateVariable time){
+		this.time = time;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
+	 */
+	public String getReturnArgumentName() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
+	 */
+	public String[] getInputArgumentNames() {
+		
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
+	 */
+	public String[] getOutputArgumentNames() {
+		return OUT_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String argumentName) {
+		return time;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary args) throws Exception {
+		String value = time.getCurrentTime();
+		Hashtable result = new Hashtable();
+		result.put(RESULT_STATUS,value);
+		return result;
+	}
+}
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ResultStateVariable.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ResultStateVariable.java
index 2fd6795..3c936db 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ResultStateVariable.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/ResultStateVariable.java
@@ -1,96 +1,96 @@
-/* 
- * 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.sample.clock;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-public class ResultStateVariable implements UPnPStateVariable{
-	
-	final private String NAME = "Result";
-	final private String DEFAULT_VALUE = "";
-	private Clock clock;
-	
-	
-	public ResultStateVariable(){
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
-	 */
-	public Class getJavaDataType() {
-		return String.class;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
-	 */
-	public String getUPnPDataType() {
-		return TYPE_STRING;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
-	 */
-	public Object getDefaultValue() {
-		return DEFAULT_VALUE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
-	 */
-	public String[] getAllowedValues() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
-	 */
-	public Number getMinimum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
-	 */
-	public Number getMaximum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
-	 */
-	public Number getStep() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
-	 */
-	public boolean sendsEvents() {
-		return false;
-	}
-	
-}
+/* 
+ * 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.sample.clock;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+public class ResultStateVariable implements UPnPStateVariable{
+	
+	final private String NAME = "Result";
+	final private String DEFAULT_VALUE = "";
+	private Clock clock;
+	
+	
+	public ResultStateVariable(){
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
+	 */
+	public Class getJavaDataType() {
+		return String.class;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
+	 */
+	public String getUPnPDataType() {
+		return TYPE_STRING;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
+	 */
+	public Object getDefaultValue() {
+		return DEFAULT_VALUE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
+	 */
+	public String[] getAllowedValues() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
+	 */
+	public Number getMinimum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
+	 */
+	public Number getMaximum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
+	 */
+	public Number getStep() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
+	 */
+	public boolean sendsEvents() {
+		return false;
+	}
+	
+}
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/SetTimeAction.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/SetTimeAction.java
index 752028e..69183eb 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/SetTimeAction.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/SetTimeAction.java
@@ -1,97 +1,97 @@
-/* 
- * 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.sample.clock;
-
-import java.beans.PropertyChangeEvent;
-import java.util.Dictionary;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class SetTimeAction implements UPnPAction {
-
-	final private String NAME = "SetTime";
-	final private String NEW_TIME_VALUE = "NewTime";
-	final private String NEW_RESULT_VALUE = "Result";
-	final private String[] IN_ARG_NAMES = new String[]{NEW_TIME_VALUE};
-	final private String[] OUT_ARG_NAMES = new String[]{NEW_RESULT_VALUE};
-	private UPnPStateVariable time,result;
-	
-	
-	public SetTimeAction(UPnPStateVariable time,UPnPStateVariable result){
-		this.time = time;
-		this.result=result;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
-	 */
-	public String getReturnArgumentName() {
-		return "Result";
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
-	 */
-	public String[] getInputArgumentNames() {
-		return IN_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
-	 */
-	public String[] getOutputArgumentNames() {
-		return OUT_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String argumentName) {
-		if (argumentName.equals("NewTime")) return time;
-		else if (argumentName.equals("Result")) return result;
-		else return null;
-	}
-
-	/* (non-Javadoc)
-	 * 
-	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
-	 */
-	public Dictionary invoke(Dictionary args) throws Exception {
-		Long newValue = (Long) args.get(NEW_TIME_VALUE);
-        Long oldValue = (Long) ((TimeStateVariable) time).getCurrentValue();
-		((TimeStateVariable) time).setCurrentTime(newValue.longValue());
-        ClockDevice.notifier.propertyChange(new PropertyChangeEvent(time,"Time",oldValue,newValue));        
-		args.remove(NEW_TIME_VALUE);
-		args.put(NEW_RESULT_VALUE,((TimeStateVariable) time).getCurrentTime());
-		return args;
-	}
-}
+/* 
+ * 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.sample.clock;
+
+import java.beans.PropertyChangeEvent;
+import java.util.Dictionary;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class SetTimeAction implements UPnPAction {
+
+	final private String NAME = "SetTime";
+	final private String NEW_TIME_VALUE = "NewTime";
+	final private String NEW_RESULT_VALUE = "Result";
+	final private String[] IN_ARG_NAMES = new String[]{NEW_TIME_VALUE};
+	final private String[] OUT_ARG_NAMES = new String[]{NEW_RESULT_VALUE};
+	private UPnPStateVariable time,result;
+	
+	
+	public SetTimeAction(UPnPStateVariable time,UPnPStateVariable result){
+		this.time = time;
+		this.result=result;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
+	 */
+	public String getReturnArgumentName() {
+		return "Result";
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
+	 */
+	public String[] getInputArgumentNames() {
+		return IN_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
+	 */
+	public String[] getOutputArgumentNames() {
+		return OUT_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String argumentName) {
+		if (argumentName.equals("NewTime")) return time;
+		else if (argumentName.equals("Result")) return result;
+		else return null;
+	}
+
+	/* (non-Javadoc)
+	 * 
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary args) throws Exception {
+		Long newValue = (Long) args.get(NEW_TIME_VALUE);
+        Long oldValue = (Long) ((TimeStateVariable) time).getCurrentValue();
+		((TimeStateVariable) time).setCurrentTime(newValue.longValue());
+        ClockDevice.notifier.propertyChange(new PropertyChangeEvent(time,"Time",oldValue,newValue));        
+		args.remove(NEW_TIME_VALUE);
+		args.put(NEW_RESULT_VALUE,((TimeStateVariable) time).getCurrentTime());
+		return args;
+	}
+}
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/TimeStateVariable.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/TimeStateVariable.java
index 6985f0f..3a49517 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/TimeStateVariable.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/TimeStateVariable.java
@@ -1,110 +1,110 @@
-/* 
- * 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.sample.clock;
-import java.util.Date;
-
-import org.osgi.service.upnp.UPnPLocalStateVariable;
-
-public class TimeStateVariable implements UPnPLocalStateVariable{
-	
-	final private String NAME = "Time";
-	final private String DEFAULT_VALUE = "";
-	private Clock clock;
-	
-	
-	public TimeStateVariable(){
-		clock = Clock.getInstance();
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
-	 */
-	public Class getJavaDataType() {
-		return Long.class;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
-	 */
-	public String getUPnPDataType() {
-		return TYPE_TIME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
-	 */
-	public Object getDefaultValue() {
-		return DEFAULT_VALUE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
-	 */
-	public String[] getAllowedValues() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
-	 */
-	public Number getMinimum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
-	 */
-	public Number getMaximum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
-	 */
-	public Number getStep() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
-	 */
-	public boolean sendsEvents() {
-		return true;
-	}
-	
-	public String getCurrentTime(){
-		return clock.getTimeString();
-	}
-	
-	public void setCurrentTime(long milliseconds){        
-		clock.getCalendar().setTime(new Date(milliseconds));
-	}
-
-	public Object getCurrentValue() {
-		return new Long(clock.getCalendar().getTime().getTime());
-	}
-}
+/* 
+ * 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.sample.clock;
+import java.util.Date;
+
+import org.osgi.service.upnp.UPnPLocalStateVariable;
+
+public class TimeStateVariable implements UPnPLocalStateVariable{
+	
+	final private String NAME = "Time";
+	final private String DEFAULT_VALUE = "";
+	private Clock clock;
+	
+	
+	public TimeStateVariable(){
+		clock = Clock.getInstance();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
+	 */
+	public Class getJavaDataType() {
+		return Long.class;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
+	 */
+	public String getUPnPDataType() {
+		return TYPE_TIME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
+	 */
+	public Object getDefaultValue() {
+		return DEFAULT_VALUE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
+	 */
+	public String[] getAllowedValues() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
+	 */
+	public Number getMinimum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
+	 */
+	public Number getMaximum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
+	 */
+	public Number getStep() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
+	 */
+	public boolean sendsEvents() {
+		return true;
+	}
+	
+	public String getCurrentTime(){
+		return clock.getTimeString();
+	}
+	
+	public void setCurrentTime(long milliseconds){        
+		clock.getCalendar().setTime(new Date(milliseconds));
+	}
+
+	public Object getCurrentValue() {
+		return new Long(clock.getCalendar().getTime().getTime());
+	}
+}
diff --git a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/TimerService.java b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/TimerService.java
index 76edcaa..ef92ead 100644
--- a/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/TimerService.java
+++ b/upnp/samples/clock/src/main/java/org/apache/felix/upnp/sample/clock/TimerService.java
@@ -1,106 +1,106 @@
-/* 
- * 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.sample.clock;
-
-import java.util.HashMap;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPService;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class TimerService implements UPnPService {
-	final private String SERVICE_ID = "urn:schemas-upnp-org:serviceId:timer:1";
-	final private String SERVICE_TYPE = "urn:schemas-upnp-org:service:timer:1";
-	final private String VERSION ="1";
-
-	private UPnPStateVariable time,result;
-	private UPnPStateVariable[] states;
-	private HashMap actions = new HashMap();
-	
-	
-	public TimerService(){
-		time = new TimeStateVariable();
-		result = new ResultStateVariable();
-		this.states = new UPnPStateVariable[]{time,result};
-		
-		UPnPAction setTime= new SetTimeAction(time,result);
-		UPnPAction getTime = new GetTimeAction((TimeStateVariable)time);
-		actions.put(setTime.getName(),setTime);
-		actions.put(getTime.getName(),getTime);
-		
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getId()
-	 */
-	public String getId() {
-		return SERVICE_ID;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getType()
-	 */
-	public String getType() {
-		return SERVICE_TYPE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getVersion()
-	 */
-	public String getVersion() {
-		return VERSION;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getAction(java.lang.String)
-	 */
-	public UPnPAction getAction(String name) {
-		return (UPnPAction)actions.get(name);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getActions()
-	 */
-	public UPnPAction[] getActions() {
-		return (UPnPAction[])(actions.values()).toArray(new UPnPAction[]{});
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getStateVariables()
-	 */
-	public UPnPStateVariable[] getStateVariables() {
-		return states;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String name) {
-		if (name.equals("Time"))
-			return time;
-		else if (name.equals("Result"))
-			return result;
-		else return null;
-	}
-}
+/* 
+ * 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.sample.clock;
+
+import java.util.HashMap;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPService;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class TimerService implements UPnPService {
+	final private String SERVICE_ID = "urn:schemas-upnp-org:serviceId:timer:1";
+	final private String SERVICE_TYPE = "urn:schemas-upnp-org:service:timer:1";
+	final private String VERSION ="1";
+
+	private UPnPStateVariable time,result;
+	private UPnPStateVariable[] states;
+	private HashMap actions = new HashMap();
+	
+	
+	public TimerService(){
+		time = new TimeStateVariable();
+		result = new ResultStateVariable();
+		this.states = new UPnPStateVariable[]{time,result};
+		
+		UPnPAction setTime= new SetTimeAction(time,result);
+		UPnPAction getTime = new GetTimeAction((TimeStateVariable)time);
+		actions.put(setTime.getName(),setTime);
+		actions.put(getTime.getName(),getTime);
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getId()
+	 */
+	public String getId() {
+		return SERVICE_ID;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getType()
+	 */
+	public String getType() {
+		return SERVICE_TYPE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getVersion()
+	 */
+	public String getVersion() {
+		return VERSION;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getAction(java.lang.String)
+	 */
+	public UPnPAction getAction(String name) {
+		return (UPnPAction)actions.get(name);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getActions()
+	 */
+	public UPnPAction[] getActions() {
+		return (UPnPAction[])(actions.values()).toArray(new UPnPAction[]{});
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getStateVariables()
+	 */
+	public UPnPStateVariable[] getStateVariables() {
+		return states;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String name) {
+		if (name.equals("Time"))
+			return time;
+		else if (name.equals("Result"))
+			return result;
+		else return null;
+	}
+}
diff --git a/upnp/samples/pom.xml b/upnp/samples/pom.xml
index 05aa0f6..c54df7b 100644
--- a/upnp/samples/pom.xml
+++ b/upnp/samples/pom.xml
@@ -16,46 +16,46 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project>
-  <parent>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>felix</artifactId>
-    <version>1.0.2</version>
-    <relativePath>../../pom/pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>pom</packaging>
-  <name>Apache Felix UPnP Examples: Build</name>
-  <artifactId>upnp.examples.build</artifactId>
-  <version>0.9.0-SNAPSHOT</version>
-
-  <profiles>
-    <profile>
-      <id>packaging-bundle</id>
-      <activation>
-        <property>
-          <name>packaging</name>
-          <value>bundle</value>
-        </property>
-      </activation>
-      <modules>
-          <module>binarylight</module>
-          <module>clock</module>
-          <module>tv</module>
-      </modules>
-    </profile>
-    <profile>
-      <id>default</id>
-      <activation>
-        <property>
-          <name>!packaging</name>
-        </property>
-      </activation>
-      <modules>
-          <module>binarylight</module>
-          <module>clock</module>
-          <module>tv</module>
-      </modules>
-    </profile>
-  </profiles>
-</project>
+<project>
+  <parent>
+    <groupId>org.apache.felix</groupId>
+    <artifactId>felix</artifactId>
+    <version>1.0.2</version>
+    <relativePath>../../pom/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>pom</packaging>
+  <name>Apache Felix UPnP Examples: Build</name>
+  <artifactId>upnp.examples.build</artifactId>
+  <version>0.9.0-SNAPSHOT</version>
+
+  <profiles>
+    <profile>
+      <id>packaging-bundle</id>
+      <activation>
+        <property>
+          <name>packaging</name>
+          <value>bundle</value>
+        </property>
+      </activation>
+      <modules>
+          <module>binarylight</module>
+          <module>clock</module>
+          <module>tv</module>
+      </modules>
+    </profile>
+    <profile>
+      <id>default</id>
+      <activation>
+        <property>
+          <name>!packaging</name>
+        </property>
+      </activation>
+      <modules>
+          <module>binarylight</module>
+          <module>clock</module>
+          <module>tv</module>
+      </modules>
+    </profile>
+  </profiles>
+</project>
diff --git a/upnp/samples/tv/pom.xml b/upnp/samples/tv/pom.xml
index 8e546c9..2386e4f 100644
--- a/upnp/samples/tv/pom.xml
+++ b/upnp/samples/tv/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -17,60 +17,60 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <artifactId>felix</artifactId>
-    <groupId>org.apache.felix</groupId>
-    <version>1.0.2</version>
-    <relativePath>../../../pom/pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.felix</groupId>
-  <artifactId>org.apache.felix.upnp.sample.tv</artifactId>
-  <packaging>bundle</packaging>
-  <name>Apache Felix UPnP Sample TV</name>
-  <version>0.2.0-SNAPSHOT</version>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>felix</artifactId>
+    <groupId>org.apache.felix</groupId>
+    <version>1.0.2</version>
+    <relativePath>../../../pom/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.felix</groupId>
+  <artifactId>org.apache.felix.upnp.sample.tv</artifactId>
+  <packaging>bundle</packaging>
+  <name>Apache Felix UPnP Sample TV</name>
+  <version>0.2.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
         <version>1.4.0</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-Name>${pom.name}</Bundle-Name>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-Name>${pom.name}</Bundle-Name>
             <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
-            <Bundle-Author>Matteo Demuru &lt;demuru@apache.org&gt;,Francesco Furfari &lt;furfari@apache.org&gt;,Stefano "Kismet" Lenzi &lt;lenzi@apache.org&gt;</Bundle-Author>
-            <Bundle-Description>CyberLink Tv clone to test UPnPBase driver</Bundle-Description>
-            <Bundle-SymbolicName>org.apache.felix.upnp.sample.tv</Bundle-SymbolicName>
-            <Bundle-Activator>org.apache.felix.upnp.sample.tv.Activator</Bundle-Activator>
-            <Private-Package>org.apache.felix.upnp.sample.tv.*</Private-Package>
-            <Import-Package>*</Import-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
+            <Bundle-Author>Matteo Demuru &lt;demuru@apache.org&gt;,Francesco Furfari &lt;furfari@apache.org&gt;,Stefano "Kismet" Lenzi &lt;lenzi@apache.org&gt;</Bundle-Author>
+            <Bundle-Description>CyberLink Tv clone to test UPnPBase driver</Bundle-Description>
+            <Bundle-SymbolicName>org.apache.felix.upnp.sample.tv</Bundle-SymbolicName>
+            <Bundle-Activator>org.apache.felix.upnp.sample.tv.Activator</Bundle-Activator>
+            <Private-Package>org.apache.felix.upnp.sample.tv.*</Private-Package>
+            <Import-Package>*</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>1.1.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
       <version>1.0.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.upnp.extra</artifactId>
-      <version>0.3.0-SNAPSHOT</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-</project>
-
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.upnp.extra</artifactId>
+      <version>0.3.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>
+
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/GetPowerAction.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/GetPowerAction.java
index 3c786df..5106e1d 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/GetPowerAction.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/GetPowerAction.java
@@ -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.sample.tv;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-public class GetPowerAction implements UPnPAction {
-
-	final private String NAME = "GetPower";
-	final private String RESULT_STATUS = "Power";
-	final private String[] OUT_ARG_NAMES = new String[]{RESULT_STATUS};
-	private PowerStateVariable power;
-	
-	
-	public GetPowerAction(PowerStateVariable power){
-		this.power = power;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
-	 */
-	public String getReturnArgumentName() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
-	 */
-	public String[] getInputArgumentNames() {
-		
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
-	 */
-	public String[] getOutputArgumentNames() {
-		return OUT_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String argumentName) {
-		return power;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
-	 */
-	public Dictionary invoke(Dictionary args) throws Exception {
-		Boolean value = power.getCurrentPower();
-		Hashtable result = new Hashtable();
-		result.put(RESULT_STATUS,value);
-		return result;
-	}
-}
+/* 
+ * 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.sample.tv;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+public class GetPowerAction implements UPnPAction {
+
+	final private String NAME = "GetPower";
+	final private String RESULT_STATUS = "Power";
+	final private String[] OUT_ARG_NAMES = new String[]{RESULT_STATUS};
+	private PowerStateVariable power;
+	
+	
+	public GetPowerAction(PowerStateVariable power){
+		this.power = power;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
+	 */
+	public String getReturnArgumentName() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
+	 */
+	public String[] getInputArgumentNames() {
+		
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
+	 */
+	public String[] getOutputArgumentNames() {
+		return OUT_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String argumentName) {
+		return power;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary args) throws Exception {
+		Boolean value = power.getCurrentPower();
+		Hashtable result = new Hashtable();
+		result.put(RESULT_STATUS,value);
+		return result;
+	}
+}
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/PowerService.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/PowerService.java
index 347d9fc..2352dde 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/PowerService.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/PowerService.java
@@ -1,103 +1,103 @@
-/* 
- * 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.sample.tv;
-
-import java.util.HashMap;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPService;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-public class PowerService implements UPnPService {
-	final private String SERVICE_ID = "urn:schemas-upnp-org:serviceId:power:1";
-	final private String SERVICE_TYPE = "urn:schemas-upnp-org:service:power:1";
-	final private String VERSION ="1";
-
-	private PowerStateVariable power;
-	private ResultStateVariable result;
-	private UPnPStateVariable[] states;
-	private HashMap actions = new HashMap();
-	
-	
-	public PowerService(){
-		power = new PowerStateVariable();
-		result = new ResultStateVariable();
-		this.states = new UPnPStateVariable[]{power,result};
-		
-		UPnPAction setPower= new SetPowerAction(power,result);
-		UPnPAction getPower = new GetPowerAction(power);
-		actions.put(setPower.getName(),setPower);
-		actions.put(getPower.getName(),getPower);
-		
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getId()
-	 */
-	public String getId() {
-		return SERVICE_ID;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getType()
-	 */
-	public String getType() {
-		return SERVICE_TYPE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getVersion()
-	 */
-	public String getVersion() {
-		return VERSION;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getAction(java.lang.String)
-	 */
-	public UPnPAction getAction(String name) {
-		return (UPnPAction)actions.get(name);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getActions()
-	 */
-	public UPnPAction[] getActions() {
-		return (UPnPAction[])(actions.values()).toArray(new UPnPAction[]{});
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getStateVariables()
-	 */
-	public UPnPStateVariable[] getStateVariables() {
-		return states;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPService#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String name) {
-		if (name.equals("Power"))
-			return power;
-		else if (name.equals("Result"))
-			return result;
-		else return null;
-	}
-}
+/* 
+ * 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.sample.tv;
+
+import java.util.HashMap;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPService;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+public class PowerService implements UPnPService {
+	final private String SERVICE_ID = "urn:schemas-upnp-org:serviceId:power:1";
+	final private String SERVICE_TYPE = "urn:schemas-upnp-org:service:power:1";
+	final private String VERSION ="1";
+
+	private PowerStateVariable power;
+	private ResultStateVariable result;
+	private UPnPStateVariable[] states;
+	private HashMap actions = new HashMap();
+	
+	
+	public PowerService(){
+		power = new PowerStateVariable();
+		result = new ResultStateVariable();
+		this.states = new UPnPStateVariable[]{power,result};
+		
+		UPnPAction setPower= new SetPowerAction(power,result);
+		UPnPAction getPower = new GetPowerAction(power);
+		actions.put(setPower.getName(),setPower);
+		actions.put(getPower.getName(),getPower);
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getId()
+	 */
+	public String getId() {
+		return SERVICE_ID;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getType()
+	 */
+	public String getType() {
+		return SERVICE_TYPE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getVersion()
+	 */
+	public String getVersion() {
+		return VERSION;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getAction(java.lang.String)
+	 */
+	public UPnPAction getAction(String name) {
+		return (UPnPAction)actions.get(name);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getActions()
+	 */
+	public UPnPAction[] getActions() {
+		return (UPnPAction[])(actions.values()).toArray(new UPnPAction[]{});
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getStateVariables()
+	 */
+	public UPnPStateVariable[] getStateVariables() {
+		return states;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPService#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String name) {
+		if (name.equals("Power"))
+			return power;
+		else if (name.equals("Result"))
+			return result;
+		else return null;
+	}
+}
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/PowerStateVariable.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/PowerStateVariable.java
index ef66bc0..1507bb8 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/PowerStateVariable.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/PowerStateVariable.java
@@ -1,120 +1,120 @@
-/* 
- * 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.sample.tv;
-import java.beans.PropertyChangeEvent;
-
-import org.osgi.service.upnp.UPnPLocalStateVariable;
-
-import org.apache.felix.upnp.extra.util.UPnPEventNotifier;
-
-public class PowerStateVariable implements UPnPLocalStateVariable {
-	
-	final private String NAME = "Power";
-	final private Boolean DEFAULT_VALUE = Boolean.FALSE;
-	private UPnPEventNotifier notifier;
-	private Boolean power = Boolean.FALSE;
-	
-	public PowerStateVariable(){
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
-	 */
-	public Class getJavaDataType() {
-		return Boolean.class;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
-	 */
-	public String getUPnPDataType() {
-		return TYPE_BOOLEAN;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
-	 */
-	public Object getDefaultValue() {
-		return DEFAULT_VALUE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
-	 */
-	public String[] getAllowedValues() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
-	 */
-	public Number getMinimum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
-	 */
-	public Number getMaximum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
-	 */
-	public Number getStep() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
-	 */
-	public boolean sendsEvents() {
-		return true;
-	}
-	
-	public Boolean getCurrentPower(){
-		return power;
-	}
-	
-	public void setPower(Boolean value){
-		if (!value.equals(power)) {
-			Boolean oldValue = power;
-			power = value;
-			if (notifier != null)
-			notifier.propertyChange(new PropertyChangeEvent(this,"Power",oldValue,value));
-		}
-	}
-
-	public void setNotifier(UPnPEventNotifier notifier){
-		this.notifier = notifier;
-	}
-
-    public Object getCurrentValue() {
-         return power;
-    }
-}
+/* 
+ * 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.sample.tv;
+import java.beans.PropertyChangeEvent;
+
+import org.osgi.service.upnp.UPnPLocalStateVariable;
+
+import org.apache.felix.upnp.extra.util.UPnPEventNotifier;
+
+public class PowerStateVariable implements UPnPLocalStateVariable {
+	
+	final private String NAME = "Power";
+	final private Boolean DEFAULT_VALUE = Boolean.FALSE;
+	private UPnPEventNotifier notifier;
+	private Boolean power = Boolean.FALSE;
+	
+	public PowerStateVariable(){
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
+	 */
+	public Class getJavaDataType() {
+		return Boolean.class;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
+	 */
+	public String getUPnPDataType() {
+		return TYPE_BOOLEAN;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
+	 */
+	public Object getDefaultValue() {
+		return DEFAULT_VALUE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
+	 */
+	public String[] getAllowedValues() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
+	 */
+	public Number getMinimum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
+	 */
+	public Number getMaximum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
+	 */
+	public Number getStep() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
+	 */
+	public boolean sendsEvents() {
+		return true;
+	}
+	
+	public Boolean getCurrentPower(){
+		return power;
+	}
+	
+	public void setPower(Boolean value){
+		if (!value.equals(power)) {
+			Boolean oldValue = power;
+			power = value;
+			if (notifier != null)
+			notifier.propertyChange(new PropertyChangeEvent(this,"Power",oldValue,value));
+		}
+	}
+
+	public void setNotifier(UPnPEventNotifier notifier){
+		this.notifier = notifier;
+	}
+
+    public Object getCurrentValue() {
+         return power;
+    }
+}
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/ResultStateVariable.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/ResultStateVariable.java
index a50ef03..b64ac28 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/ResultStateVariable.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/ResultStateVariable.java
@@ -1,95 +1,95 @@
-/* 
- * 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.sample.tv;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-public class ResultStateVariable implements UPnPStateVariable{
-	
-	final private String NAME = "Result";
-	final private Boolean DEFAULT_VALUE = Boolean.FALSE;
-	
-	
-	public ResultStateVariable(){
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
-	 */
-	public Class getJavaDataType() {
-		return Boolean.class;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
-	 */
-	public String getUPnPDataType() {
-		return TYPE_BOOLEAN;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
-	 */
-	public Object getDefaultValue() {
-		return DEFAULT_VALUE;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
-	 */
-	public String[] getAllowedValues() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
-	 */
-	public Number getMinimum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
-	 */
-	public Number getMaximum() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
-	 */
-	public Number getStep() {
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
-	 */
-	public boolean sendsEvents() {
-		return false;
-	}
-	
-}
+/* 
+ * 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.sample.tv;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+public class ResultStateVariable implements UPnPStateVariable{
+	
+	final private String NAME = "Result";
+	final private Boolean DEFAULT_VALUE = Boolean.FALSE;
+	
+	
+	public ResultStateVariable(){
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getJavaDataType()
+	 */
+	public Class getJavaDataType() {
+		return Boolean.class;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getUPnPDataType()
+	 */
+	public String getUPnPDataType() {
+		return TYPE_BOOLEAN;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getDefaultValue()
+	 */
+	public Object getDefaultValue() {
+		return DEFAULT_VALUE;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getAllowedValues()
+	 */
+	public String[] getAllowedValues() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMinimum()
+	 */
+	public Number getMinimum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getMaximum()
+	 */
+	public Number getMaximum() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#getStep()
+	 */
+	public Number getStep() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPStateVariable#sendsEvents()
+	 */
+	public boolean sendsEvents() {
+		return false;
+	}
+	
+}
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/SetPowerAction.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/SetPowerAction.java
index 30d67ff..909bdc8 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/SetPowerAction.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/SetPowerAction.java
@@ -1,91 +1,91 @@
-/* 
- * 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.sample.tv;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.osgi.service.upnp.UPnPAction;
-import org.osgi.service.upnp.UPnPStateVariable;
-
-public class SetPowerAction implements UPnPAction {
-
-	final private String NAME = "SetPower";
-	final private String NEW_TIME_VALUE = "Power";
-	final private String NEW_RESULT_VALUE = "Result";
-	final private String[] IN_ARG_NAMES = new String[]{NEW_TIME_VALUE};
-	final private String[] OUT_ARG_NAMES = new String[]{NEW_RESULT_VALUE};
-	private PowerStateVariable power;
-	private ResultStateVariable result;
-	
-	
-	public SetPowerAction(PowerStateVariable power,ResultStateVariable result){
-		this.power = power;
-		this.result=result;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getName()
-	 */
-	public String getName() {
-		return NAME;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
-	 */
-	public String getReturnArgumentName() {
-		return "Result";
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
-	 */
-	public String[] getInputArgumentNames() {
-		return IN_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
-	 */
-	public String[] getOutputArgumentNames() {
-		return OUT_ARG_NAMES;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
-	 */
-	public UPnPStateVariable getStateVariable(String argumentName) {
-		if (argumentName.equals("Power")) return power;
-		else if (argumentName.equals("Result")) return result;
-		else return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
-	 */
-	public Dictionary invoke(Dictionary args) throws Exception {
-		Boolean value = (Boolean) args.get(NEW_TIME_VALUE);
-		power.setPower(value);
-		Hashtable result = new Hashtable();
-		result.put(NEW_RESULT_VALUE,Boolean.TRUE);
-		return result;
-	}
-}
+/* 
+ * 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.sample.tv;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.service.upnp.UPnPAction;
+import org.osgi.service.upnp.UPnPStateVariable;
+
+public class SetPowerAction implements UPnPAction {
+
+	final private String NAME = "SetPower";
+	final private String NEW_TIME_VALUE = "Power";
+	final private String NEW_RESULT_VALUE = "Result";
+	final private String[] IN_ARG_NAMES = new String[]{NEW_TIME_VALUE};
+	final private String[] OUT_ARG_NAMES = new String[]{NEW_RESULT_VALUE};
+	private PowerStateVariable power;
+	private ResultStateVariable result;
+	
+	
+	public SetPowerAction(PowerStateVariable power,ResultStateVariable result){
+		this.power = power;
+		this.result=result;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getName()
+	 */
+	public String getName() {
+		return NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getReturnArgumentName()
+	 */
+	public String getReturnArgumentName() {
+		return "Result";
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getInputArgumentNames()
+	 */
+	public String[] getInputArgumentNames() {
+		return IN_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getOutputArgumentNames()
+	 */
+	public String[] getOutputArgumentNames() {
+		return OUT_ARG_NAMES;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#getStateVariable(java.lang.String)
+	 */
+	public UPnPStateVariable getStateVariable(String argumentName) {
+		if (argumentName.equals("Power")) return power;
+		else if (argumentName.equals("Result")) return result;
+		else return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
+	 */
+	public Dictionary invoke(Dictionary args) throws Exception {
+		Boolean value = (Boolean) args.get(NEW_TIME_VALUE);
+		power.setPower(value);
+		Hashtable result = new Hashtable();
+		result.put(NEW_RESULT_VALUE,Boolean.TRUE);
+		return result;
+	}
+}
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvDevice.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvDevice.java
index e7b70ae..f5a0d02 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvDevice.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvDevice.java
@@ -1,319 +1,319 @@
-/* 
- * 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.sample.tv;
-
-import java.awt.Component;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Dictionary;
-import java.util.Properties;
-import java.util.Random;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.upnp.UPnPDevice;
-import org.osgi.service.upnp.UPnPEventListener;
-import org.osgi.service.upnp.UPnPIcon;
-import org.osgi.service.upnp.UPnPService;
-
-import org.apache.felix.upnp.extra.util.UPnPEventNotifier;
-import org.apache.felix.upnp.extra.util.UPnPSubscriber;
-
-public class TvDevice implements UPnPDevice,UPnPEventListener,ServiceListener  {
-	
-	final private String DEVICE_ID = "uuid:Felix-TV+" +Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());
-	private final static String CLOCK_DEVICE_TYPE = "urn:schemas-upnp-org:device:clock:1";
-	private final static String TIME_SERVICE_TYPE = "urn:schemas-upnp-org:service:timer:1";
-	
-	private final static String LIGHT_DEVICE_TYPE = "urn:schemas-upnp-org:device:light:1";
-	private final static String POWER_SERVICE_TYPE = "urn:schemas-upnp-org:service:power:1";
-
-	private final static String AIRCON_DEVICE_TYPE = "urn:schemas-upnp-org:device:aircon:1";
-	private final static String TEMP_SERVICE_TYPE = "urn:schemas-upnp-org:service:temp:1";
-	
-	private final static String WASHER_DEVICE_TYPE = "urn:schemas-upnp-org:device:washer:1";
-	private final static String STATUS_SERVICE_TYPE = "urn:schemas-upnp-org:service:state:1";
-
-	private final String devicesFilter = 
-		"(&"+
-			"("+Constants.OBJECTCLASS+"="+UPnPDevice.class.getName()+"))";
-			/*"(|("+UPnPDevice.TYPE+"="+ CLOCK_SERVICE_TYPE+")"+
-				"("+UPnPDevice.TYPE+"="+ LIGHT_SERVICE_TYPE+")"+
-				"("+UPnPDevice.TYPE+"="+ AIRCON_SERVICE_TYPE+")"+
-				"("+UPnPDevice.TYPE+"="+ WASHER_SERVICE_TYPE+")))";*/
-
-	private BundleContext context;
-	private PowerService powerService;
-	private UPnPService[] services;
-	private Dictionary dictionary;
-	private UPnPEventNotifier notifier;
-	private PowerStateVariable powerState;
-
-	public TvDevice() {
-		powerService = new PowerService();
-		services = new UPnPService[]{powerService};
-		powerState = (PowerStateVariable) powerService.getStateVariable("Power");
-		setupDeviceProperties();
-		buildEventNotifyer();
-		try {
-			Activator.context.addServiceListener(this,devicesFilter);
-		} catch (InvalidSyntaxException e) {
-			System.out.println(e);		
-		}
-	}
-
-	/**
-	 * 
-	 */
-	private void buildEventNotifyer() {
-		notifier = new UPnPEventNotifier(Activator.context,this,powerService);
-		powerState.setNotifier(notifier);
-	}
-
-	private void setupDeviceProperties(){
-		dictionary = new Properties();
-		dictionary.put(UPnPDevice.UPNP_EXPORT,"");
-		//org.osgi.service.device.Constants.DEVICE_CATEGORY
-		//dictionary.put("DEVICE_CATEGORY","UPnP");
-		dictionary.put(
-	        org.osgi.service
-	        	.device.Constants.DEVICE_CATEGORY,
-        	new String[]{UPnPDevice.DEVICE_CATEGORY}
-        );
-		dictionary.put(UPnPDevice.FRIENDLY_NAME,"Felix Sample Tv");
-		dictionary.put(UPnPDevice.MANUFACTURER,"Apache Software Foundation");
-		dictionary.put(UPnPDevice.MANUFACTURER_URL,"http://felix.apache.org");
-		dictionary.put(UPnPDevice.MODEL_DESCRIPTION,"A CyberLink Tv device clone to test OSGi to UPnP service import");
-		dictionary.put(UPnPDevice.MODEL_NAME,"BimbiTv");
-		dictionary.put(UPnPDevice.MODEL_NUMBER,"1.0");
-		dictionary.put(UPnPDevice.MODEL_URL,"http://felix.apache.org/site/upnp-examples.html");
-		//dictionary.put(UPnPDevice.PRESENTATION_URL,"http://felix.apache.org/BimbiTv/presentation");
-		dictionary.put(UPnPDevice.SERIAL_NUMBER,"123456789");
-		dictionary.put(UPnPDevice.TYPE,"urn:schemas-upnp-org:device:tv:1");
-		dictionary.put(UPnPDevice.UDN,DEVICE_ID);
-		//dictionary.put(UPnPDevice.ID,dictionary.get(UPnPDevice.UDN));
-		dictionary.put(UPnPDevice.UPC,"1213456789");
-	}
-	
-	
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getService(java.lang.String)
-	 */
-	public UPnPService getService(String serviceId) {
-		if  (serviceId.equals(powerService.getId())) return powerService;
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getServices()
-	 */
-	public UPnPService[] getServices() {
-		return services;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
-	 */
-	public UPnPIcon[] getIcons(String locale) {
-		UPnPIcon icon = new TvIcon();
-		return new UPnPIcon[]{icon} ;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPDevice#getDescriptions(java.lang.String)
-	 */
-	public Dictionary getDescriptions(String locale) {
-		return dictionary;
-	}
-
-
-
-	////////////////////////////////////////////////
-	//	Component
-	////////////////////////////////////////////////
-
-	private Component comp;
-	
-	public void setComponent(Component comp)
-	{
-		this.comp = comp;	
-	}
-	
-	public Component getComponent()
-	{
-		return comp;
-	}
-	
-	////////////////////////////////////////////////
-	//	on/off
-	////////////////////////////////////////////////
-
-	private boolean onFlag = false;
-	
-	public void on()
-	{
-		powerState.setPower(Boolean.TRUE);
-		doSubscribe();
-	}
-
-	public boolean isOn()
-	{ 
-		return powerState.getCurrentPower().booleanValue();
-	}
-	public void off()
-	{
-		powerState.setPower(Boolean.FALSE);
-		undoSubscribe();
-	}
-
-
-	////////////////////////////////////////////////
-	//	Clock
-	////////////////////////////////////////////////
-
-	private String clockTime = ""; 
-	
-	public String getClockTime()
-	{
-		return clockTime;	
-	}
-	
-	////////////////////////////////////////////////
-	//	Aircon
-	////////////////////////////////////////////////
-
-	private String airconTemp = ""; 
-	
-	public String getAirconTempture()
-	{
-		return airconTemp;	
-	}
-
-	////////////////////////////////////////////////
-	//	Message
-	////////////////////////////////////////////////
-
-	private String message = ""; 
-	
-	public void setMessage(String msg)
-	{
-		message = msg;
-	}
-	
-	public String getMessage()
-	{
-		return message;
-	}
-	
-
-	////////////////////////////////////////////////
-	//	Subscribe
-	////////////////////////////////////////////////
-	
-	private UPnPSubscriber subscriber;
-	
-	public void doSubscribe()
-	{
-		subscriber = new UPnPSubscriber(Activator.context,this);
-		subscriber.subscribeEveryServiceType(CLOCK_DEVICE_TYPE, TIME_SERVICE_TYPE);
-		subscriber.subscribeEveryServiceType(AIRCON_DEVICE_TYPE, TEMP_SERVICE_TYPE);
-		subscriber.subscribeEveryServiceType(LIGHT_DEVICE_TYPE, POWER_SERVICE_TYPE);
-		subscriber.subscribeEveryServiceType(WASHER_DEVICE_TYPE, STATUS_SERVICE_TYPE);
-	}
-	
-	public void undoSubscribe(){
-		subscriber.unsubscribeAll();
-	}
-	
-	ArrayList LinkedDevices = new ArrayList();
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPEventListener#notifyUPnPEvent(java.lang.String, java.lang.String, java.util.Dictionary)
-	 */
-	public void notifyUPnPEvent(String deviceId, String serviceId, Dictionary events) {
-		if( !LinkedDevices.contains(deviceId))
-			LinkedDevices.add(deviceId);
-		if (deviceId.indexOf("Clock") != -1){
-				Long time = (Long) events.get("Time");
-				clockTime = new Date(time.longValue()).toString();				
-		}
-		else if (deviceId.indexOf("AirCon") != -1)
-				airconTemp = (String) events.get("Temp");
-		else if (deviceId.indexOf("Washer") != -1)
-				message = (String) events.get("State");
-		else if (deviceId.indexOf("Light") != -1)
-				message = (String) events.get("Power");
- 
-		comp.repaint();
-	}
-
-
-	////////////////////////////////////////////////
-	//	start/stop
-	////////////////////////////////////////////////
-	
-	public void start()
-	{
-		on();
-	}
-
-	public void stop()
-	{
-		((PowerStateVariable) powerService.getStateVariable("Power")).setNotifier(null);
-		notifier.destroy();
-		off();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent)
-	 */
-	public void serviceChanged(ServiceEvent event) {
-		switch(event.getType()){
-			case ServiceEvent.REGISTERED:{
-			};break;
-			
-			case ServiceEvent.MODIFIED:{				
-			};break;
-			
-			case ServiceEvent.UNREGISTERING:{	
-				ServiceReference sr = event.getServiceReference();
-				String UDN = (String)sr.getProperty(UPnPDevice.ID);
-				if (UDN != null){
-					if (LinkedDevices.contains(UDN)) {
-						if (UDN.indexOf("Clock") != -1)
-								clockTime = "";
-						else if (UDN.indexOf("AirCon") != -1)
-								airconTemp = "";
-						else if (UDN.indexOf("Washer") != -1)
-								message = "";
-						else if (UDN.indexOf("Light") != -1)
-								message = "";
-					}
-				}
-				comp.repaint();
-		 	};break;
-		}
-	}
-
-}
-
+/* 
+ * 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.sample.tv;
+
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Dictionary;
+import java.util.Properties;
+import java.util.Random;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.upnp.UPnPDevice;
+import org.osgi.service.upnp.UPnPEventListener;
+import org.osgi.service.upnp.UPnPIcon;
+import org.osgi.service.upnp.UPnPService;
+
+import org.apache.felix.upnp.extra.util.UPnPEventNotifier;
+import org.apache.felix.upnp.extra.util.UPnPSubscriber;
+
+public class TvDevice implements UPnPDevice,UPnPEventListener,ServiceListener  {
+	
+	final private String DEVICE_ID = "uuid:Felix-TV+" +Integer.toHexString(new Random(System.currentTimeMillis()).nextInt());
+	private final static String CLOCK_DEVICE_TYPE = "urn:schemas-upnp-org:device:clock:1";
+	private final static String TIME_SERVICE_TYPE = "urn:schemas-upnp-org:service:timer:1";
+	
+	private final static String LIGHT_DEVICE_TYPE = "urn:schemas-upnp-org:device:light:1";
+	private final static String POWER_SERVICE_TYPE = "urn:schemas-upnp-org:service:power:1";
+
+	private final static String AIRCON_DEVICE_TYPE = "urn:schemas-upnp-org:device:aircon:1";
+	private final static String TEMP_SERVICE_TYPE = "urn:schemas-upnp-org:service:temp:1";
+	
+	private final static String WASHER_DEVICE_TYPE = "urn:schemas-upnp-org:device:washer:1";
+	private final static String STATUS_SERVICE_TYPE = "urn:schemas-upnp-org:service:state:1";
+
+	private final String devicesFilter = 
+		"(&"+
+			"("+Constants.OBJECTCLASS+"="+UPnPDevice.class.getName()+"))";
+			/*"(|("+UPnPDevice.TYPE+"="+ CLOCK_SERVICE_TYPE+")"+
+				"("+UPnPDevice.TYPE+"="+ LIGHT_SERVICE_TYPE+")"+
+				"("+UPnPDevice.TYPE+"="+ AIRCON_SERVICE_TYPE+")"+
+				"("+UPnPDevice.TYPE+"="+ WASHER_SERVICE_TYPE+")))";*/
+
+	private BundleContext context;
+	private PowerService powerService;
+	private UPnPService[] services;
+	private Dictionary dictionary;
+	private UPnPEventNotifier notifier;
+	private PowerStateVariable powerState;
+
+	public TvDevice() {
+		powerService = new PowerService();
+		services = new UPnPService[]{powerService};
+		powerState = (PowerStateVariable) powerService.getStateVariable("Power");
+		setupDeviceProperties();
+		buildEventNotifyer();
+		try {
+			Activator.context.addServiceListener(this,devicesFilter);
+		} catch (InvalidSyntaxException e) {
+			System.out.println(e);		
+		}
+	}
+
+	/**
+	 * 
+	 */
+	private void buildEventNotifyer() {
+		notifier = new UPnPEventNotifier(Activator.context,this,powerService);
+		powerState.setNotifier(notifier);
+	}
+
+	private void setupDeviceProperties(){
+		dictionary = new Properties();
+		dictionary.put(UPnPDevice.UPNP_EXPORT,"");
+		//org.osgi.service.device.Constants.DEVICE_CATEGORY
+		//dictionary.put("DEVICE_CATEGORY","UPnP");
+		dictionary.put(
+	        org.osgi.service
+	        	.device.Constants.DEVICE_CATEGORY,
+        	new String[]{UPnPDevice.DEVICE_CATEGORY}
+        );
+		dictionary.put(UPnPDevice.FRIENDLY_NAME,"Felix Sample Tv");
+		dictionary.put(UPnPDevice.MANUFACTURER,"Apache Software Foundation");
+		dictionary.put(UPnPDevice.MANUFACTURER_URL,"http://felix.apache.org");
+		dictionary.put(UPnPDevice.MODEL_DESCRIPTION,"A CyberLink Tv device clone to test OSGi to UPnP service import");
+		dictionary.put(UPnPDevice.MODEL_NAME,"BimbiTv");
+		dictionary.put(UPnPDevice.MODEL_NUMBER,"1.0");
+		dictionary.put(UPnPDevice.MODEL_URL,"http://felix.apache.org/site/upnp-examples.html");
+		//dictionary.put(UPnPDevice.PRESENTATION_URL,"http://felix.apache.org/BimbiTv/presentation");
+		dictionary.put(UPnPDevice.SERIAL_NUMBER,"123456789");
+		dictionary.put(UPnPDevice.TYPE,"urn:schemas-upnp-org:device:tv:1");
+		dictionary.put(UPnPDevice.UDN,DEVICE_ID);
+		//dictionary.put(UPnPDevice.ID,dictionary.get(UPnPDevice.UDN));
+		dictionary.put(UPnPDevice.UPC,"1213456789");
+	}
+	
+	
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getService(java.lang.String)
+	 */
+	public UPnPService getService(String serviceId) {
+		if  (serviceId.equals(powerService.getId())) return powerService;
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getServices()
+	 */
+	public UPnPService[] getServices() {
+		return services;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
+	 */
+	public UPnPIcon[] getIcons(String locale) {
+		UPnPIcon icon = new TvIcon();
+		return new UPnPIcon[]{icon} ;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPDevice#getDescriptions(java.lang.String)
+	 */
+	public Dictionary getDescriptions(String locale) {
+		return dictionary;
+	}
+
+
+
+	////////////////////////////////////////////////
+	//	Component
+	////////////////////////////////////////////////
+
+	private Component comp;
+	
+	public void setComponent(Component comp)
+	{
+		this.comp = comp;	
+	}
+	
+	public Component getComponent()
+	{
+		return comp;
+	}
+	
+	////////////////////////////////////////////////
+	//	on/off
+	////////////////////////////////////////////////
+
+	private boolean onFlag = false;
+	
+	public void on()
+	{
+		powerState.setPower(Boolean.TRUE);
+		doSubscribe();
+	}
+
+	public boolean isOn()
+	{ 
+		return powerState.getCurrentPower().booleanValue();
+	}
+	public void off()
+	{
+		powerState.setPower(Boolean.FALSE);
+		undoSubscribe();
+	}
+
+
+	////////////////////////////////////////////////
+	//	Clock
+	////////////////////////////////////////////////
+
+	private String clockTime = ""; 
+	
+	public String getClockTime()
+	{
+		return clockTime;	
+	}
+	
+	////////////////////////////////////////////////
+	//	Aircon
+	////////////////////////////////////////////////
+
+	private String airconTemp = ""; 
+	
+	public String getAirconTempture()
+	{
+		return airconTemp;	
+	}
+
+	////////////////////////////////////////////////
+	//	Message
+	////////////////////////////////////////////////
+
+	private String message = ""; 
+	
+	public void setMessage(String msg)
+	{
+		message = msg;
+	}
+	
+	public String getMessage()
+	{
+		return message;
+	}
+	
+
+	////////////////////////////////////////////////
+	//	Subscribe
+	////////////////////////////////////////////////
+	
+	private UPnPSubscriber subscriber;
+	
+	public void doSubscribe()
+	{
+		subscriber = new UPnPSubscriber(Activator.context,this);
+		subscriber.subscribeEveryServiceType(CLOCK_DEVICE_TYPE, TIME_SERVICE_TYPE);
+		subscriber.subscribeEveryServiceType(AIRCON_DEVICE_TYPE, TEMP_SERVICE_TYPE);
+		subscriber.subscribeEveryServiceType(LIGHT_DEVICE_TYPE, POWER_SERVICE_TYPE);
+		subscriber.subscribeEveryServiceType(WASHER_DEVICE_TYPE, STATUS_SERVICE_TYPE);
+	}
+	
+	public void undoSubscribe(){
+		subscriber.unsubscribeAll();
+	}
+	
+	ArrayList LinkedDevices = new ArrayList();
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPEventListener#notifyUPnPEvent(java.lang.String, java.lang.String, java.util.Dictionary)
+	 */
+	public void notifyUPnPEvent(String deviceId, String serviceId, Dictionary events) {
+		if( !LinkedDevices.contains(deviceId))
+			LinkedDevices.add(deviceId);
+		if (deviceId.indexOf("Clock") != -1){
+				Long time = (Long) events.get("Time");
+				clockTime = new Date(time.longValue()).toString();				
+		}
+		else if (deviceId.indexOf("AirCon") != -1)
+				airconTemp = (String) events.get("Temp");
+		else if (deviceId.indexOf("Washer") != -1)
+				message = (String) events.get("State");
+		else if (deviceId.indexOf("Light") != -1)
+				message = (String) events.get("Power");
+ 
+		comp.repaint();
+	}
+
+
+	////////////////////////////////////////////////
+	//	start/stop
+	////////////////////////////////////////////////
+	
+	public void start()
+	{
+		on();
+	}
+
+	public void stop()
+	{
+		((PowerStateVariable) powerService.getStateVariable("Power")).setNotifier(null);
+		notifier.destroy();
+		off();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent)
+	 */
+	public void serviceChanged(ServiceEvent event) {
+		switch(event.getType()){
+			case ServiceEvent.REGISTERED:{
+			};break;
+			
+			case ServiceEvent.MODIFIED:{				
+			};break;
+			
+			case ServiceEvent.UNREGISTERING:{	
+				ServiceReference sr = event.getServiceReference();
+				String UDN = (String)sr.getProperty(UPnPDevice.ID);
+				if (UDN != null){
+					if (LinkedDevices.contains(UDN)) {
+						if (UDN.indexOf("Clock") != -1)
+								clockTime = "";
+						else if (UDN.indexOf("AirCon") != -1)
+								airconTemp = "";
+						else if (UDN.indexOf("Washer") != -1)
+								message = "";
+						else if (UDN.indexOf("Light") != -1)
+								message = "";
+					}
+				}
+				comp.repaint();
+		 	};break;
+		}
+	}
+
+}
+
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvFrame.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvFrame.java
index 1bafddc..0d50cbf 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvFrame.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvFrame.java
@@ -1,123 +1,123 @@
-/* 
- * 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.sample.tv;
-
-import java.awt.BorderLayout;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.net.URL;
-
-import javax.swing.ImageIcon;
-import javax.swing.JFrame;
-
-import org.osgi.framework.BundleException;
-
-public class TvFrame extends JFrame implements Runnable 
-{
-	private final static String TITLE = "Felix UpnP TV";
-	
-	private TvDevice tvDev;
-	private TvPane tvPane;
-	
-	public TvFrame()
-	{
-		super(TITLE);
-
-		tvDev = new TvDevice();
-
-		getContentPane().setLayout(new BorderLayout());
-
-		tvPane = new TvPane();
-		tvDev.setComponent(tvPane);
-		tvPane.setDevice(tvDev);
-		getContentPane().add(tvPane, BorderLayout.CENTER);
-
-		addWindowListener(new WindowAdapter(){
-			public void windowClosing(WindowEvent e) 
-			{
-				try {
-					Activator.context.getBundle().stop();
-				} catch (BundleException ex) {
-					ex.printStackTrace();
-				}
-			}
-		});			
-		
-	       try {
-	            URL eventIconUrl = TvFrame.class.getResource("images/logo.gif");           
-	            ImageIcon icon=  new ImageIcon(eventIconUrl,"logo");
-	            setIconImage(icon.getImage());
-	       }
-	        catch (Exception ex){
-	                System.out.println("Resource: IMAGES/logo.gif not found : " + ex.toString());
-	        }
-	        
-		pack();
-		setVisible(true);
-	}
-
-	public TvPane getTvPanel()
-	{
-		return tvPane;
-	}
-
-	public TvDevice getTvDevice()
-	{
-		return tvDev;
-	}
-		
-	////////////////////////////////////////////////
-	//	run	
-	////////////////////////////////////////////////
-
-	private Thread timerThread = null;
-		
-	public void run()
-	{
-		Thread thisThread = Thread.currentThread();
-
-		while (timerThread == thisThread) {
-			tvDev.setMessage("");
-			tvPane.repaint();
-			try {
-				Thread.sleep(1000*5);
-			}
-			catch(InterruptedException e) {}
-		}
-	}
-	
-	public void start()
-	{
-		tvDev.start();
-		
-		timerThread = new Thread(this,"upnp.sample.tv.TVFrame");
-		timerThread.start();
-	}
-	
-	public void stop()
-	{
-		tvDev.stop();
-		timerThread = null;
-		dispose();
-	}
-
-
-}
-
+/* 
+ * 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.sample.tv;
+
+import java.awt.BorderLayout;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URL;
+
+import javax.swing.ImageIcon;
+import javax.swing.JFrame;
+
+import org.osgi.framework.BundleException;
+
+public class TvFrame extends JFrame implements Runnable 
+{
+	private final static String TITLE = "Felix UpnP TV";
+	
+	private TvDevice tvDev;
+	private TvPane tvPane;
+	
+	public TvFrame()
+	{
+		super(TITLE);
+
+		tvDev = new TvDevice();
+
+		getContentPane().setLayout(new BorderLayout());
+
+		tvPane = new TvPane();
+		tvDev.setComponent(tvPane);
+		tvPane.setDevice(tvDev);
+		getContentPane().add(tvPane, BorderLayout.CENTER);
+
+		addWindowListener(new WindowAdapter(){
+			public void windowClosing(WindowEvent e) 
+			{
+				try {
+					Activator.context.getBundle().stop();
+				} catch (BundleException ex) {
+					ex.printStackTrace();
+				}
+			}
+		});			
+		
+	       try {
+	            URL eventIconUrl = TvFrame.class.getResource("images/logo.gif");           
+	            ImageIcon icon=  new ImageIcon(eventIconUrl,"logo");
+	            setIconImage(icon.getImage());
+	       }
+	        catch (Exception ex){
+	                System.out.println("Resource: IMAGES/logo.gif not found : " + ex.toString());
+	        }
+	        
+		pack();
+		setVisible(true);
+	}
+
+	public TvPane getTvPanel()
+	{
+		return tvPane;
+	}
+
+	public TvDevice getTvDevice()
+	{
+		return tvDev;
+	}
+		
+	////////////////////////////////////////////////
+	//	run	
+	////////////////////////////////////////////////
+
+	private Thread timerThread = null;
+		
+	public void run()
+	{
+		Thread thisThread = Thread.currentThread();
+
+		while (timerThread == thisThread) {
+			tvDev.setMessage("");
+			tvPane.repaint();
+			try {
+				Thread.sleep(1000*5);
+			}
+			catch(InterruptedException e) {}
+		}
+	}
+	
+	public void start()
+	{
+		tvDev.start();
+		
+		timerThread = new Thread(this,"upnp.sample.tv.TVFrame");
+		timerThread.start();
+	}
+	
+	public void stop()
+	{
+		tvDev.stop();
+		timerThread = null;
+		dispose();
+	}
+
+
+}
+
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvIcon.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvIcon.java
index a6df26d..fb1dec3 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvIcon.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvIcon.java
@@ -1,69 +1,69 @@
-/* 
- * 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.sample.tv;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.osgi.service.upnp.UPnPIcon;
-
-public class TvIcon implements UPnPIcon {
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getMimeType()
-	 */
-	public String getMimeType() {
-		return "image/gif";
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getWidth()
-	 */
-	public int getWidth() {
-		return 32;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getHeight()
-	 */
-	public int getHeight() {
-		return 32;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getSize()
-	 */
-	public int getSize() {
-		return 0;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getDepth()
-	 */
-	public int getDepth() {
-		return 16;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.osgi.service.upnp.UPnPIcon#getInputStream()
-	 */
-	public InputStream getInputStream() throws IOException {
-		return TvIcon.class.getResourceAsStream("images/tv.gif");
-	}
-}
+/* 
+ * 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.sample.tv;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.osgi.service.upnp.UPnPIcon;
+
+public class TvIcon implements UPnPIcon {
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getMimeType()
+	 */
+	public String getMimeType() {
+		return "image/gif";
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getWidth()
+	 */
+	public int getWidth() {
+		return 32;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getHeight()
+	 */
+	public int getHeight() {
+		return 32;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getSize()
+	 */
+	public int getSize() {
+		return 0;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getDepth()
+	 */
+	public int getDepth() {
+		return 16;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.osgi.service.upnp.UPnPIcon#getInputStream()
+	 */
+	public InputStream getInputStream() throws IOException {
+		return TvIcon.class.getResourceAsStream("images/tv.gif");
+	}
+}
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvPane.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvPane.java
index f8a0549..7dd1da4 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvPane.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/TvPane.java
@@ -1,214 +1,214 @@
-/* 
- * 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.sample.tv;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.BufferedImage;
-
-import javax.imageio.ImageIO;
-import javax.swing.JPanel;
-
-public class TvPane extends JPanel  // MouseListener
-{
-	private final static int IMAGE_BORDER_SIZE = 20;
-	private final static int IMAGE_BOTTOM_BORDER_SIZE = 30;
-	
-	////////////////////////////////////////////////
-	//	Constructor
-	////////////////////////////////////////////////
-
-	public TvPane()
-	{
-		loadImage();
-		initPanel();
-	}
-
-	////////////////////////////////////////////////
-	//	TvDevice
-	////////////////////////////////////////////////
-
-	private TvDevice tvDev = null;
-	
-	public void setDevice(TvDevice dev)
-	{
-		tvDev = dev;
-	}
-
-	public TvDevice getDevice()
-	{
-		return tvDev;
-	}
-	
-	////////////////////////////////////////////////
-	//	Background
-	////////////////////////////////////////////////
-
-	private BufferedImage panelmage;
-	private BufferedImage tvOnImage;
-	
-	private void loadImage()
-	{
-		try {
-			panelmage = ImageIO.read(TvPane.class.getResourceAsStream("images/tv.jpg"));
-			tvOnImage = ImageIO.read(TvPane.class.getResourceAsStream("images/tvon.jpg"));
-		}
-		catch (Exception e) {
-			System.out.println(e);
-		}
-	}
-
-	////////////////////////////////////////////////
-	//	Background
-	////////////////////////////////////////////////
-
-	private void initPanel()
-	{
-		setPreferredSize(new Dimension(panelmage.getWidth(), panelmage.getHeight()));
-	}
-
-	////////////////////////////////////////////////
-	//	Font
-	////////////////////////////////////////////////
-
-	private final static String DEFAULT_FONT_NAME = "Lucida Console";
-	private final static int DEFAULT_TIME_FONT_SIZE = 10;
-
-	private Font timeFont = null;
-
-	private Font getFont(Graphics g, int size)
-	{
-		Font font = new Font(DEFAULT_FONT_NAME, Font.BOLD, size);
-		if (font != null)
-			return font;
-		return g.getFont();
-	}
-		
-	private Font getFont(Graphics g)
-	{
-		if (timeFont == null)
-			timeFont = getFont(g, DEFAULT_TIME_FONT_SIZE);
-		return timeFont;
-	}
-
-	////////////////////////////////////////////////
-	//	paint
-	////////////////////////////////////////////////
-
-	private void drawClockInfo(Graphics g)
-	{
-		TvDevice tvDev = getDevice();
-
-		int winWidth = getWidth();
-		int winHeight = getHeight();
-		
-		Font font = getFont(g);
-		g.setFont(font);
-		FontMetrics fontMetric = g.getFontMetrics();
-		g.setColor(Color.RED);
-
-		Rectangle2D strBounds;
-		int strWidth;
-		int strHeight;
-		int strX;
-		int strY;
-		
-		//// Time String ////
-		
-		String timeStr = tvDev.getClockTime();
-		if (timeStr != null && 0 < timeStr.length()) {
-			strBounds = fontMetric.getStringBounds(timeStr, g);
-			strWidth = (int)strBounds.getWidth();		
-			strHeight = (int)strBounds.getHeight();
-			strX = IMAGE_BORDER_SIZE;
-			strY = IMAGE_BORDER_SIZE + strHeight;
-			g.drawString(
-				timeStr,
-				strX,
-				strY);
-		}
-		
-		//// Tempture String ////
-		
-		String tempStr = tvDev.getAirconTempture();
-		if (tempStr != null && 0 < tempStr.length()) {
-			tempStr += "C";
-			strBounds = fontMetric.getStringBounds(tempStr, g);
-			strWidth = (int)strBounds.getWidth();		
-			strHeight = (int)strBounds.getHeight();
-			strX = winWidth - IMAGE_BORDER_SIZE - strWidth;
-			strY = IMAGE_BORDER_SIZE + strHeight;
-			g.drawString(
-				tempStr,
-				strX,
-				strY);
-		}
-
-		//// Message String ////
-		
-		String msgStr = tvDev.getMessage();
-		if (msgStr != null && 0 < msgStr.length()) {
-			strBounds = fontMetric.getStringBounds(msgStr, g);
-			strWidth = (int)strBounds.getWidth();		
-			strHeight = (int)strBounds.getHeight();
-			strX = IMAGE_BORDER_SIZE;
-			strY = getHeight()-IMAGE_BOTTOM_BORDER_SIZE-2;
-			g.drawString(
-				msgStr,
-				strX,
-				strY);
-		}
-	}
-
-	private void drawTvImage(Graphics g)
-	{
-		//g.setColor(Color.WHITE);
-		//g.clearRect(IMAGE_BORDER_SIZE, IMAGE_BORDER_SIZE, getWidth()-IMAGE_BORDER_SIZE*2, getHeight()-IMAGE_BORDER_SIZE-IMAGE_BOTTOM_BORDER_SIZE);
-		g.drawImage(tvOnImage, IMAGE_BORDER_SIZE, IMAGE_BORDER_SIZE, null);
-	}
-	
-	private void clear(Graphics g)
-	{
-		g.setColor(Color.GRAY);
-		g.clearRect(0, 0, getWidth(), getHeight());
-	}
-	
-
-	private void drawPanelImage(Graphics g)
-	{
-		g.drawImage(panelmage, 0, 0, null);
-	}
-		
-	public void paint(Graphics g)
-	{
-		clear(g);
-		drawPanelImage(g);
-		TvDevice tvDev = getDevice();
-		if (tvDev.isOn() == true) {
-			drawTvImage(g);
-			drawClockInfo(g);
-		}
-	}
-}
-
+/* 
+ * 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.sample.tv;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import javax.imageio.ImageIO;
+import javax.swing.JPanel;
+
+public class TvPane extends JPanel  // MouseListener
+{
+	private final static int IMAGE_BORDER_SIZE = 20;
+	private final static int IMAGE_BOTTOM_BORDER_SIZE = 30;
+	
+	////////////////////////////////////////////////
+	//	Constructor
+	////////////////////////////////////////////////
+
+	public TvPane()
+	{
+		loadImage();
+		initPanel();
+	}
+
+	////////////////////////////////////////////////
+	//	TvDevice
+	////////////////////////////////////////////////
+
+	private TvDevice tvDev = null;
+	
+	public void setDevice(TvDevice dev)
+	{
+		tvDev = dev;
+	}
+
+	public TvDevice getDevice()
+	{
+		return tvDev;
+	}
+	
+	////////////////////////////////////////////////
+	//	Background
+	////////////////////////////////////////////////
+
+	private BufferedImage panelmage;
+	private BufferedImage tvOnImage;
+	
+	private void loadImage()
+	{
+		try {
+			panelmage = ImageIO.read(TvPane.class.getResourceAsStream("images/tv.jpg"));
+			tvOnImage = ImageIO.read(TvPane.class.getResourceAsStream("images/tvon.jpg"));
+		}
+		catch (Exception e) {
+			System.out.println(e);
+		}
+	}
+
+	////////////////////////////////////////////////
+	//	Background
+	////////////////////////////////////////////////
+
+	private void initPanel()
+	{
+		setPreferredSize(new Dimension(panelmage.getWidth(), panelmage.getHeight()));
+	}
+
+	////////////////////////////////////////////////
+	//	Font
+	////////////////////////////////////////////////
+
+	private final static String DEFAULT_FONT_NAME = "Lucida Console";
+	private final static int DEFAULT_TIME_FONT_SIZE = 10;
+
+	private Font timeFont = null;
+
+	private Font getFont(Graphics g, int size)
+	{
+		Font font = new Font(DEFAULT_FONT_NAME, Font.BOLD, size);
+		if (font != null)
+			return font;
+		return g.getFont();
+	}
+		
+	private Font getFont(Graphics g)
+	{
+		if (timeFont == null)
+			timeFont = getFont(g, DEFAULT_TIME_FONT_SIZE);
+		return timeFont;
+	}
+
+	////////////////////////////////////////////////
+	//	paint
+	////////////////////////////////////////////////
+
+	private void drawClockInfo(Graphics g)
+	{
+		TvDevice tvDev = getDevice();
+
+		int winWidth = getWidth();
+		int winHeight = getHeight();
+		
+		Font font = getFont(g);
+		g.setFont(font);
+		FontMetrics fontMetric = g.getFontMetrics();
+		g.setColor(Color.RED);
+
+		Rectangle2D strBounds;
+		int strWidth;
+		int strHeight;
+		int strX;
+		int strY;
+		
+		//// Time String ////
+		
+		String timeStr = tvDev.getClockTime();
+		if (timeStr != null && 0 < timeStr.length()) {
+			strBounds = fontMetric.getStringBounds(timeStr, g);
+			strWidth = (int)strBounds.getWidth();		
+			strHeight = (int)strBounds.getHeight();
+			strX = IMAGE_BORDER_SIZE;
+			strY = IMAGE_BORDER_SIZE + strHeight;
+			g.drawString(
+				timeStr,
+				strX,
+				strY);
+		}
+		
+		//// Tempture String ////
+		
+		String tempStr = tvDev.getAirconTempture();
+		if (tempStr != null && 0 < tempStr.length()) {
+			tempStr += "C";
+			strBounds = fontMetric.getStringBounds(tempStr, g);
+			strWidth = (int)strBounds.getWidth();		
+			strHeight = (int)strBounds.getHeight();
+			strX = winWidth - IMAGE_BORDER_SIZE - strWidth;
+			strY = IMAGE_BORDER_SIZE + strHeight;
+			g.drawString(
+				tempStr,
+				strX,
+				strY);
+		}
+
+		//// Message String ////
+		
+		String msgStr = tvDev.getMessage();
+		if (msgStr != null && 0 < msgStr.length()) {
+			strBounds = fontMetric.getStringBounds(msgStr, g);
+			strWidth = (int)strBounds.getWidth();		
+			strHeight = (int)strBounds.getHeight();
+			strX = IMAGE_BORDER_SIZE;
+			strY = getHeight()-IMAGE_BOTTOM_BORDER_SIZE-2;
+			g.drawString(
+				msgStr,
+				strX,
+				strY);
+		}
+	}
+
+	private void drawTvImage(Graphics g)
+	{
+		//g.setColor(Color.WHITE);
+		//g.clearRect(IMAGE_BORDER_SIZE, IMAGE_BORDER_SIZE, getWidth()-IMAGE_BORDER_SIZE*2, getHeight()-IMAGE_BORDER_SIZE-IMAGE_BOTTOM_BORDER_SIZE);
+		g.drawImage(tvOnImage, IMAGE_BORDER_SIZE, IMAGE_BORDER_SIZE, null);
+	}
+	
+	private void clear(Graphics g)
+	{
+		g.setColor(Color.GRAY);
+		g.clearRect(0, 0, getWidth(), getHeight());
+	}
+	
+
+	private void drawPanelImage(Graphics g)
+	{
+		g.drawImage(panelmage, 0, 0, null);
+	}
+		
+	public void paint(Graphics g)
+	{
+		clear(g);
+		drawPanelImage(g);
+		TvDevice tvDev = getDevice();
+		if (tvDev.isOn() == true) {
+			drawTvImage(g);
+			drawClockInfo(g);
+		}
+	}
+}
+
diff --git a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/UPnPSubscriber.java b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/UPnPSubscriber.java
index 8780f90..8d1341d 100644
--- a/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/UPnPSubscriber.java
+++ b/upnp/samples/tv/src/main/java/org/apache/felix/upnp/sample/tv/UPnPSubscriber.java
@@ -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.sample.tv;
-
-import java.util.Properties;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.upnp.UPnPDevice;
-import org.osgi.service.upnp.UPnPEventListener;
-import org.osgi.service.upnp.UPnPService;
-
-/* 
-* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-*/
-
-public class UPnPSubscriber {
-	ServiceRegistration registration = null;
-	BundleContext context;
-	UPnPEventListener listener;
-	
-	public UPnPSubscriber(BundleContext context,UPnPEventListener listener){
-		this.context = context;
-		this.listener = listener;
-	}
-	
-	public void subscribe(String deviceType, String serviceType){
-		String keys = "(&(" + UPnPDevice.TYPE + "="+ deviceType + ")(" + UPnPService.TYPE + "=" + serviceType + "))";
-		try {
-			Filter filter = context.createFilter(keys);
-			Properties props = new Properties();
-			props.put(UPnPEventListener.UPNP_FILTER, filter);
-			registration = context.registerService(UPnPEventListener.class.getName(), listener, props);
-		}catch (Exception ex){
-			System.out.println(ex);
-		}
-	}
-	
-	public void unsubscribe(){
-		registration.unregister();
-		registration = null;
-	}
-	
-
-}
+/* 
+ * 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.sample.tv;
+
+import java.util.Properties;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.upnp.UPnPDevice;
+import org.osgi.service.upnp.UPnPEventListener;
+import org.osgi.service.upnp.UPnPService;
+
+/* 
+* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+*/
+
+public class UPnPSubscriber {
+	ServiceRegistration registration = null;
+	BundleContext context;
+	UPnPEventListener listener;
+	
+	public UPnPSubscriber(BundleContext context,UPnPEventListener listener){
+		this.context = context;
+		this.listener = listener;
+	}
+	
+	public void subscribe(String deviceType, String serviceType){
+		String keys = "(&(" + UPnPDevice.TYPE + "="+ deviceType + ")(" + UPnPService.TYPE + "=" + serviceType + "))";
+		try {
+			Filter filter = context.createFilter(keys);
+			Properties props = new Properties();
+			props.put(UPnPEventListener.UPNP_FILTER, filter);
+			registration = context.registerService(UPnPEventListener.class.getName(), listener, props);
+		}catch (Exception ex){
+			System.out.println(ex);
+		}
+	}
+	
+	public void unsubscribe(){
+		registration.unregister();
+		registration = null;
+	}
+	
+
+}
