diff --git a/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/Activator.java b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/Activator.java
new file mode 100644
index 0000000..8fae5d9
--- /dev/null
+++ b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/Activator.java
@@ -0,0 +1,197 @@
+/*
+ * 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.example.servicebased.host;
+
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.*;
+
+import org.osgi.framework.*;
+import org.apache.felix.framework.Felix;
+import org.apache.felix.framework.util.FelixConstants;
+import org.apache.felix.framework.util.StringMap;
+import org.apache.felix.framework.cache.BundleCache;
+
+/**
+ * The activator of the host application bundle. The activator creates the
+ * main application <tt>JFrame</tt> and starts tracking <tt>SimpleShape</tt>
+ * services. All activity is performed on the Swing event thread to avoid
+ * synchronization and repainting issues. Closing the application window
+ * will result in <tt>Bundle.stop()</tt> being called on the system bundle,
+ * which will cause the framework to shutdown and the JVM to exit.
+ * <p>
+ * This class also provides a static <tt>main()</tt> method so that it can be
+ * run as a stand-alone host application. In such a scenario, the application
+ * creates its own embedded Felix framework instance and interacts with the
+ * internal services to providing drawing functionality. To successfully
+ * launch the stand-alone application, it must be run from this bundle's
+ * installation directory using "<tt>java -jar</tt>".
+**/
+public class Activator implements BundleActivator, Runnable
+{
+    private BundleContext m_context	= null;
+    private DrawingFrame m_frame = null;
+    private ShapeTracker m_shapetracker = null;
+
+    /**
+     * Displays the applications window and starts service tracking;
+     * everything is done on the Swing event thread to avoid synchronization
+     * and repainting issues.
+     * @param context The context of the bundle.
+    **/
+    public void start(BundleContext context)
+    {
+        m_context = context;
+        if (SwingUtilities.isEventDispatchThread())
+        {
+            run();
+        }
+        else
+        {
+            try
+            {
+                javax.swing.SwingUtilities.invokeAndWait(this);
+            }
+            catch (Exception ex)
+            {
+                ex.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * Stops service tracking and disposes of the application window.
+     * @param context The context of the bundle.
+    **/
+    public void stop(BundleContext context)
+    {
+        m_shapetracker.close();
+        m_frame.setVisible(false);
+        m_frame.dispose();
+    }
+
+    /**
+     * This method actually performs the creation of the application window.
+     * It is intended to be called by the Swing event thread and should not
+     * be called directly.
+    **/
+    public void run()
+    {
+        m_frame = new DrawingFrame();
+
+        m_frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+        m_frame.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent evt)
+            {
+                try
+                {
+                    m_context.getBundle(0).stop();
+                }
+                catch (BundleException ex)
+                {
+                    ex.printStackTrace();
+                }
+            }
+        });
+
+        m_frame.setVisible(true);
+
+        m_shapetracker = new ShapeTracker(m_context, m_frame);
+        m_shapetracker.open();
+    }
+
+    /**
+     * Enables the bundle to run as a stand-alone application. When this
+     * static <tt>main()</tt> method is invoked, the application creates
+     * its own embedded Felix framework instance and interacts with the
+     * internal services to providing drawing functionality. To successfully
+     * launch as a stand-alone application, the method should be invoked from
+     * the bundle's installation directory using "<tt>java -jar</tt>".
+     * @param argv The command-line arguments.
+     * @throws Exception If anything goes wrong.
+    **/
+    public static void main(String[] argv) throws Exception
+    {
+        // Create a temporary bundle cache directory and
+        // make sure to clean it up on exit.
+        final File cachedir = File.createTempFile("felix.example", null);
+        cachedir.delete();
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            public void run()
+            {
+                deleteFileOrDir(cachedir);
+            }
+        });
+
+        Map configMap = new StringMap(false);
+        configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
+            "org.osgi.framework; version=1.3.0," +
+            "org.osgi.service.packageadmin; version=1.2.0," +
+            "org.osgi.service.startlevel; version=1.0.0," +
+            "org.osgi.service.url; version=1.0.0," +
+            "org.osgi.util.tracker; version=1.3.2," +
+            "org.apache.felix.example.servicebased.host.service; version=1.0.0," +
+            "javax.swing");
+        configMap.put(FelixConstants.AUTO_START_PROP + ".1",
+            "file:../servicebased.circle/target/servicebased.circle-1.0.0.jar " +
+            "file:../servicebased.square/target/servicebased.square-1.0.0.jar " +
+            "file:../servicebased.triangle/target/servicebased.triangle-1.0.0.jar");
+        configMap.put(FelixConstants.LOG_LEVEL_PROP, "1");
+        configMap.put(BundleCache.CACHE_PROFILE_DIR_PROP, cachedir.getAbsolutePath());
+
+        List list = new ArrayList();
+        list.add(new Activator());
+
+        try
+        {
+            // Now create an instance of the framework.
+            Felix felix = new Felix(configMap, list);
+            felix.start();
+        }
+        catch (Exception ex)
+        {
+            System.err.println("Could not create framework: " + ex);
+            ex.printStackTrace();
+            System.exit(-1);
+        }
+    }
+
+    /**
+     * Utility method used to delete the profile directory when run as
+     * a stand-alone application.
+     * @param file The file to recursively delete.
+    **/
+    private static void deleteFileOrDir(File file)
+    {
+        if (file.isDirectory())
+        {
+            File[] childs = file.listFiles();
+            for (int i = 0;i < childs.length;i++)
+            {
+                deleteFileOrDir(childs[i]);
+            }
+        }
+        file.delete();
+    }
+}
\ No newline at end of file
diff --git a/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/DrawingFrame.java b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/DrawingFrame.java
new file mode 100644
index 0000000..29d1d59
--- /dev/null
+++ b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/DrawingFrame.java
@@ -0,0 +1,230 @@
+/*
+ * 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.example.servicebased.host;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+
+import javax.swing.*;
+
+import org.apache.felix.example.servicebased.host.service.SimpleShape;
+
+public class DrawingFrame extends JFrame
+    implements MouseListener, MouseMotionListener
+{
+    private static final long serialVersionUID = 1L;
+    private static final int BOX = 54;
+    private JToolBar m_toolbar;
+    private String m_selected;
+    private JPanel m_panel;
+    private Map m_shapes = new HashMap();
+    private ShapeComponent m_selectedComponent;
+    private SimpleShape m_defaultShape = new DefaultShape();
+    private ActionListener m_reusableActionListener = new ShapeActionListener();
+
+    public DrawingFrame()
+    {
+        super("Service-Based Host");
+
+        m_toolbar = new JToolBar("Toolbar");
+        m_panel = new JPanel();
+        m_panel.setBackground(Color.WHITE);
+        m_panel.setLayout(null);
+        m_panel.setMinimumSize(new Dimension(400, 400));
+        m_panel.addMouseListener(this);
+        getContentPane().setLayout(new BorderLayout());
+        getContentPane().add(m_toolbar, BorderLayout.NORTH);
+        getContentPane().add(m_panel, BorderLayout.CENTER);
+        setSize(400, 400);
+    }
+
+    public void selectShape(String name)
+    {
+        m_selected = name;
+    }
+
+    public SimpleShape getShape(String name)
+    {
+        ShapeInfo info = (ShapeInfo) m_shapes.get(name);
+        if (info == null)
+        {
+            return m_defaultShape;
+        }
+        else
+        {
+            return info.m_shape;
+        }
+    }
+
+    public void addShape(String name, Icon icon, SimpleShape shape)
+    {
+        m_shapes.put(name, new ShapeInfo(name, icon, shape));
+        JButton button = new JButton(icon);
+        button.setActionCommand(name);
+        button.addActionListener(m_reusableActionListener);
+
+        if (m_selected == null)
+        {
+            button.doClick();
+        }
+
+        m_toolbar.add(button);
+        m_toolbar.validate();
+        repaint();
+    }
+
+    public void removeShape(String name)
+    {
+        m_shapes.remove(name);
+
+        if ((m_selected != null) && m_selected.equals(name))
+        {
+            m_selected = null;
+        }
+
+        for (int i = 0; i < m_toolbar.getComponentCount(); i++)
+        {
+            JButton sb = (JButton) m_toolbar.getComponent(i);
+            if (sb.getActionCommand().equals(name))
+            {
+                m_toolbar.remove(i);
+                m_toolbar.invalidate();
+                validate();
+                repaint();
+                break;
+            }
+        }
+
+        if ((m_selected == null) && (m_toolbar.getComponentCount() > 0))
+        {
+            ((JButton) m_toolbar.getComponent(0)).doClick();
+        }
+    }
+
+    public void mouseClicked(MouseEvent evt)
+    {
+        if (m_selected == null)
+        {
+            return;
+        }
+
+        if (m_panel.contains(evt.getX(), evt.getY()))
+        {
+            ShapeComponent sc = new ShapeComponent(this, m_selected);
+            sc.setBounds(evt.getX() - BOX / 2, evt.getY() - BOX / 2, BOX, BOX);
+            m_panel.add(sc, 0);
+            m_panel.validate();
+            m_panel.repaint(sc.getBounds());
+        }
+    }
+
+    public void mouseEntered(MouseEvent evt)
+    {
+    }
+
+    public void mouseExited(MouseEvent evt)
+    {
+    }
+
+    public void mousePressed(MouseEvent evt)
+    {
+        Component c = m_panel.getComponentAt(evt.getPoint());
+        if (c instanceof ShapeComponent)
+        {
+            m_selectedComponent = (ShapeComponent) c;
+            m_panel.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
+            m_panel.addMouseMotionListener(this);
+            m_selectedComponent.repaint();
+        }
+    }
+
+    public void mouseReleased(MouseEvent evt)
+    {
+        if (m_selectedComponent != null)
+        {
+            m_panel.removeMouseMotionListener(this);
+            m_panel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+            m_selectedComponent.setBounds(
+                evt.getX() - BOX / 2, evt.getY() - BOX / 2, BOX, BOX);
+            m_selectedComponent.repaint();
+            m_selectedComponent = null;
+        }
+    }
+
+    public void mouseDragged(MouseEvent evt)
+    {
+        m_selectedComponent.setBounds(
+            evt.getX() - BOX / 2, evt.getY() - BOX / 2, BOX, BOX);
+    }
+
+    public void mouseMoved(MouseEvent evt)
+    {
+    }
+
+    private class DefaultShape implements SimpleShape
+    {
+        private ImageIcon m_icon = null;
+
+        public void draw(Graphics2D g2, Point p)
+        {
+            if (m_icon == null)
+            {
+                try
+                {
+                    m_icon = new ImageIcon(this.getClass().getResource("underc.png"));
+                }
+                catch (Exception ex)
+                {
+                    ex.printStackTrace();
+                    g2.setColor(Color.red);
+                    g2.fillRect(0, 0, getWidth() - 1, getHeight() - 1);
+                    return;
+                }
+            }
+            g2.drawImage(m_icon.getImage(), 0, 0, null);
+        }
+
+        public String getName()
+        {
+            return "Default";
+        }
+    }
+
+    private class ShapeActionListener implements ActionListener
+    {
+        public void actionPerformed(ActionEvent evt)
+        {
+            selectShape(evt.getActionCommand());
+        }
+    }
+
+    private static class ShapeInfo
+    {
+        public String m_name;
+        public Icon m_icon;
+        public SimpleShape m_shape;
+        public ShapeInfo(String name, Icon icon, SimpleShape shape)
+        {
+            m_name = name;
+            m_icon = icon;
+            m_shape = shape;
+        }
+    }
+}
\ No newline at end of file
diff --git a/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeComponent.java b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeComponent.java
new file mode 100644
index 0000000..fbeca54
--- /dev/null
+++ b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeComponent.java
@@ -0,0 +1,66 @@
+/*
+ * 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.example.servicebased.host;
+
+import java.awt.*;
+
+import javax.swing.*;
+
+import org.apache.felix.example.servicebased.host.service.SimpleShape;
+
+/**
+ * Simple component class used to represent a drawn shape. This component
+ * uses a shape service to paint its contents.
+**/
+public class ShapeComponent extends JComponent
+{
+    private static final long serialVersionUID = 1L;
+    private DrawingFrame m_frame;
+    private String m_shapeName;
+
+    /**
+     * Construct a component for the specified drawing frame with the specified
+     * named shape. The component acquires the named shape from the drawing
+     * frame at the time of painting, which enables it to account for
+     * service dynamism.
+     * @param frame The drawing frame associated with the component.
+     * @param shapeName The name of the shape to draw.
+    **/
+    public ShapeComponent(DrawingFrame frame, String shapeName)
+    {
+        m_frame = frame;
+        m_shapeName = shapeName;
+    }
+
+    /**
+     * Paints the contents of the component. The component acquires the named
+     * shape from the drawing frame at the time of painting, which enables it
+     * to account for service dynamism.
+     * @param g The graphics object to use for painting.
+    **/
+    protected void paintComponent(Graphics g)
+    {
+        super.paintComponent(g);
+        Graphics2D g2 = (Graphics2D) g;
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+            RenderingHints.VALUE_ANTIALIAS_ON);
+        SimpleShape shape = m_frame.getShape(m_shapeName);
+        shape.draw(g2, new Point(getWidth()/2, getHeight()/2));
+    }
+}
\ No newline at end of file
diff --git a/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeTracker.java b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeTracker.java
new file mode 100644
index 0000000..ff97a85
--- /dev/null
+++ b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeTracker.java
@@ -0,0 +1,186 @@
+/*
+ * 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.example.servicebased.host;
+
+import javax.swing.*;
+
+import org.apache.felix.example.servicebased.host.service.SimpleShape;
+import org.osgi.framework.*;
+import org.osgi.util.tracker.*;
+
+/**
+ * Extends the <tt>ServiceTracker</tt> to create a tracker for
+ * <tt>SimpleShape</tt> services. The tracker is responsible for
+ * listener for the arrival/departure of <tt>SimpleShape</tt>
+ * services and informing the application about the availability
+ * of shapes. This tracker forces all notifications to be processed
+ * on the Swing event thread to avoid synchronization and redraw
+ * issues.
+**/
+public class ShapeTracker extends ServiceTracker
+{
+    // Flag indicating an added shape.
+    private static final int ADDED = 1;
+    // Flag indicating a modified shape.
+    private static final int MODIFIED = 2;
+    // Flag indicating a removed shape.
+    private static final int REMOVED = 3;
+    // The application object to notify.
+    private DrawingFrame m_frame;
+
+    /**
+     * Constructs a tracker that uses the specified bundle context to
+     * track services and notifies the specified application object about
+     * changes.
+     * @param context The bundle context to be used by the tracker.
+     * @param frame The application object to notify about service changes.
+    **/
+    public ShapeTracker(BundleContext context, DrawingFrame frame)
+    {
+        super(context, SimpleShape.class.getName(), null);
+        m_frame = frame;
+    }
+
+    /**
+     * Overrides the <tt>ServiceTracker</tt> functionality to inform
+     * the application object about the added service.
+     * @param ref The service reference of the added service.
+     * @return The service object to be used by the tracker.
+    **/
+    public Object addingService(ServiceReference ref)
+    {
+        SimpleShape shape = (SimpleShape) super.addingService(ref);
+        processShapeOnEventThread(ADDED, ref, shape);
+        return shape;
+    }
+
+    /**
+     * Overrides the <tt>ServiceTracker</tt> functionality to inform
+     * the application object about the modified service.
+     * @param ref The service reference of the modified service.
+     * @param svc The service object of the modified service.
+    **/
+    public void modifiedService(ServiceReference ref, Object svc)
+    {
+        processShapeOnEventThread(MODIFIED, ref, (SimpleShape) svc);
+    }
+
+    /**
+     * Overrides the <tt>ServiceTracker</tt> functionality to inform
+     * the application object about the removed service.
+     * @param ref The service reference of the removed service.
+     * @param svc The service object of the removed service.
+    **/
+    public void removedService(ServiceReference ref, Object svc)
+    {
+        processShapeOnEventThread(REMOVED, ref, (SimpleShape) svc);
+        super.removedService(ref, svc);
+    }
+
+    /**
+     * Processes a received service notification from the <tt>ServiceTracker</tt>,
+     * forcing the processing of the notification onto the Swing event thread
+     * if it is not already on it.
+     * @param action The type of action associated with the notification.
+     * @param ref The service reference of the corresponding service.
+     * @param shape The service object of the corresponding service.
+    **/
+    private void processShapeOnEventThread(
+        int action, ServiceReference ref, SimpleShape shape)
+    {
+        try
+        {
+            if (SwingUtilities.isEventDispatchThread())
+            {
+                processShape(action, ref, shape);
+            }
+            else
+            {
+                SwingUtilities.invokeAndWait(new ShapeRunnable(action, ref, shape));
+            }
+        }
+        catch (Exception ex)
+        {
+            ex.printStackTrace();
+        }
+    }
+
+    /**
+     * Actually performs the processing of the service notification. Invokes
+     * the appropriate callback method on the application object depending on
+     * the action type of the notification.
+     * @param action The type of action associated with the notification.
+     * @param ref The service reference of the corresponding service.
+     * @param shape The service object of the corresponding service.
+    **/
+    private void processShape(int action, ServiceReference ref, SimpleShape shape)
+    {
+        String name = (String) ref.getProperty(SimpleShape.NAME_PROPERTY);
+
+        switch (action)
+        {
+            case MODIFIED:
+                m_frame.removeShape(name);
+                // Purposely let this fall through to the 'add' case to
+                // reload the service.
+
+            case ADDED:
+                Icon icon = (Icon) ref.getProperty(SimpleShape.ICON_PROPERTY);
+                m_frame.addShape(name, icon, shape);
+                break;
+
+            case REMOVED:
+                m_frame.removeShape(name);
+                break;
+        }
+    }
+
+    /**
+     * Simple class used to process service notification handling on the
+     * Swing event thread.
+    **/
+    private class ShapeRunnable implements Runnable
+    {
+        private int m_action;
+        private ServiceReference m_ref;
+        private SimpleShape m_shape;
+
+        /**
+         * Constructs an object with the specified action, service reference,
+         * and service object for processing on the Swing event thread.
+         * @param action The type of action associated with the notification.
+         * @param ref The service reference of the corresponding service.
+         * @param shape The service object of the corresponding service.
+        **/
+        public ShapeRunnable(int action, ServiceReference ref, SimpleShape shape)
+        {
+            m_action = action;
+            m_ref = ref;
+            m_shape = shape;
+        }
+
+        /**
+         * Calls the <tt>processShape()</tt> method.
+        **/
+        public void run()
+        {
+            processShape(m_action, m_ref, m_shape);
+        }
+    }
+}
\ No newline at end of file
diff --git a/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/service/SimpleShape.java b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/service/SimpleShape.java
new file mode 100644
index 0000000..c1a9b78
--- /dev/null
+++ b/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/service/SimpleShape.java
@@ -0,0 +1,51 @@
+/*
+ * 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.example.servicebased.host.service;
+
+import java.awt.Graphics2D;
+import java.awt.Point;
+
+/**
+ * This interface defines the <tt>SimpleShape</tt> service. This service
+ * is used to draw shapes. It has two service properties:
+ * <ul>
+ *   <li>simple.shape.name - A <tt>String</tt> name for the shape.
+ *   </li>
+ *   <li>simple.shape.icon - A <tt>Icon</tt> for the shape.
+ *   </li>
+ * </ul>
+**/
+public interface SimpleShape
+{
+    /**
+     * A service property for the name of the shape.
+    **/
+    public static final String NAME_PROPERTY = "simple.shape.name";
+    /**
+     * A service property for the icon of the shape.
+    **/
+    public static final String ICON_PROPERTY = "simple.shape.icon";
+
+    /**
+     * Method to draw the shape of the service.
+     * @param g2 The graphics object used for painting.
+     * @param p The position to paint the triangle.
+    **/
+    public void draw(Graphics2D g2, Point p);
+}
\ No newline at end of file
diff --git a/examples/servicebased.host/src/main/resources/META-INF/LICENSE b/examples/servicebased.host/src/main/resources/META-INF/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/examples/servicebased.host/src/main/resources/META-INF/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
diff --git a/examples/servicebased.host/src/main/resources/META-INF/NOTICE b/examples/servicebased.host/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000..459d669
--- /dev/null
+++ b/examples/servicebased.host/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,5 @@
+Apache Felix Shell Service
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/examples/servicebased.host/src/main/resources/org/apache/felix/example/servicebased/host/underc.png b/examples/servicebased.host/src/main/resources/org/apache/felix/example/servicebased/host/underc.png
new file mode 100644
index 0000000..425cdb9
--- /dev/null
+++ b/examples/servicebased.host/src/main/resources/org/apache/felix/example/servicebased/host/underc.png
Binary files differ
