Index: content/src/main/resources/hippo-configuration/example-dependent-module.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- content/src/main/resources/hippo-configuration/example-dependent-module.xml	(revision )
+++ content/src/main/resources/hippo-configuration/example-dependent-module.xml	(revision )
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="example-dependent-module">
+  <sv:property sv:name="jcr:primaryType" sv:type="Name">
+    <sv:value>hipposys:module</sv:value>
+  </sv:property>
+  <sv:property sv:name="hipposys:className" sv:type="String">
+    <sv:value>org.hippoecm.hst.demo.TestDaemonModuleDependent</sv:value>
+  </sv:property>
+  <sv:node sv:name="hippo:moduleconfig">
+    <sv:property sv:name="jcr:primaryType" sv:type="Name">
+      <sv:value>nt:unstructured</sv:value>
+    </sv:property>
+    <sv:property sv:name="exampleConfigurationOption" sv:type="String">
+      <sv:value>exampleConfigurationOptionValueDependent</sv:value>
+    </sv:property>
+  </sv:node>
+</sv:node>
\ No newline at end of file
Index: content/src/main/resources/hippoecm-extension.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- content/src/main/resources/hippoecm-extension.xml	(revision 38781)
+++ content/src/main/resources/hippoecm-extension.xml	(revision )
@@ -938,4 +938,33 @@
     </sv:property>
   </sv:node>
 
+  <sv:node sv:name="example-dependent-module">
+    <sv:property sv:name="jcr:primaryType" sv:type="Name">
+      <sv:value>hippo:initializeitem</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:contentresource" sv:type="String">
+      <sv:value>hippo-configuration/example-dependent-module.xml</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:contentroot" sv:type="String">
+      <sv:value>/hippo:configuration/hippo:modules</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:sequence" sv:type="Double">
+      <sv:value>13100.7</sv:value>
+    </sv:property>
+  </sv:node>
+
+  <sv:node sv:name="example-module">
+    <sv:property sv:name="jcr:primaryType" sv:type="Name">
+      <sv:value>hippo:initializeitem</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:contentresource" sv:type="String">
+      <sv:value>hippo-configuration/example-module.xml</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:contentroot" sv:type="String">
+      <sv:value>/hippo:configuration/hippo:modules</sv:value>
+    </sv:property>
+    <sv:property sv:name="hippo:sequence" sv:type="Double">
+      <sv:value>13100.8</sv:value>
+    </sv:property>
+  </sv:node>
 </sv:node>
Index: content/src/main/resources/hippo-configuration/example-module.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- content/src/main/resources/hippo-configuration/example-module.xml	(revision )
+++ content/src/main/resources/hippo-configuration/example-module.xml	(revision )
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="example-module">
+  <sv:property sv:name="jcr:primaryType" sv:type="Name">
+    <sv:value>hipposys:module</sv:value>
+  </sv:property>
+  <sv:property sv:name="hipposys:className" sv:type="String">
+    <sv:value>org.hippoecm.hst.demo.TestDaemonModule</sv:value>
+  </sv:property>
+  <sv:node sv:name="hippo:moduleconfig">
+    <sv:property sv:name="jcr:primaryType" sv:type="Name">
+      <sv:value>nt:unstructured</sv:value>
+    </sv:property>
+    <sv:property sv:name="exampleConfigurationOption" sv:type="String">
+      <sv:value>exampleConfigurationOptionValue</sv:value>
+    </sv:property>
+  </sv:node>
+</sv:node>
\ No newline at end of file
Index: cms/src/main/java/org/hippoecm/hst/demo/MyExampleService.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- cms/src/main/java/org/hippoecm/hst/demo/MyExampleService.java	(revision )
+++ cms/src/main/java/org/hippoecm/hst/demo/MyExampleService.java	(revision )
@@ -0,0 +1,8 @@
+package org.hippoecm.hst.demo;
+
+import org.onehippo.cms7.services.SingletonService;
+
+@SingletonService
+public interface MyExampleService {
+    void doSomething();
+}
\ No newline at end of file
Index: cms/src/main/java/org/hippoecm/hst/demo/TestDaemonModuleDependent.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- cms/src/main/java/org/hippoecm/hst/demo/TestDaemonModuleDependent.java	(revision )
+++ cms/src/main/java/org/hippoecm/hst/demo/TestDaemonModuleDependent.java	(revision )
@@ -0,0 +1,49 @@
+package org.hippoecm.hst.demo;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.onehippo.cms7.services.HippoServiceRegistry;
+import org.onehippo.repository.modules.AbstractReconfigurableDaemonModule;
+import org.onehippo.repository.modules.RequiresService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: svoortman
+ * Date: 3/12/13
+ * Time: 12:44 PM
+ * To change this template use File | Settings | File Templates.
+ */
+@RequiresService(types = MyExampleService.class)
+public class TestDaemonModuleDependent extends AbstractReconfigurableDaemonModule {
+    private static Logger log = LoggerFactory.getLogger(TestDaemonModuleDependent.class);
+
+    @Override
+    protected void doInitialize(final Session session) throws RepositoryException {
+        log.warn("Test daemon module dependent initializing");
+        log.warn("Getting the service");
+        MyExampleService service = HippoServiceRegistry.getService(MyExampleService.class);
+        if (service == null) {
+            log.error("Service is null");
+            return;
+        }
+        log.warn("Calling the service");
+        service.doSomething();
+        log.warn("Test daemon module dependent initialized");
+    }
+
+    @Override
+    protected void doShutdown() {
+        log.warn("Test daemon module dependent shut down");
+    }
+
+    @Override
+    protected void doConfigure(final Node moduleConfig) throws RepositoryException {
+        log.warn("Configuration exists");
+        log.warn("Configuration path: " + moduleConfig.getPath());
+        log.warn("exampleConfigurationOption=" + moduleConfig.getProperty("exampleConfigurationOption").getString());
+    }
+}
Index: cms/src/main/java/org/hippoecm/hst/demo/TestDaemonModule.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- cms/src/main/java/org/hippoecm/hst/demo/TestDaemonModule.java	(revision )
+++ cms/src/main/java/org/hippoecm/hst/demo/TestDaemonModule.java	(revision )
@@ -0,0 +1,56 @@
+package org.hippoecm.hst.demo;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.onehippo.cms7.services.HippoServiceRegistry;
+import org.onehippo.repository.modules.ConfigurableDaemonModule;
+import org.onehippo.repository.modules.ProvidesService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: svoortman
+ * Date: 3/12/13
+ * Time: 12:44 PM
+ * To change this template use File | Settings | File Templates.
+ */
+
+@ProvidesService(types = MyExampleService.class)
+public class TestDaemonModule implements ConfigurableDaemonModule {
+    private static Logger log = LoggerFactory.getLogger(TestDaemonModule.class);
+
+    private MyExampleService service;
+
+    @Override
+    public void initialize(final Session session) throws RepositoryException {
+        log.warn("Test daemon module initializing");
+        HippoServiceRegistry.registerService(service = new MyExampleService() {
+            @Override
+            public void doSomething() {
+                doSomethingNow();
+            }
+        }, MyExampleService.class);
+        log.warn("Test daemon module initialized");
+    }
+
+    private void doSomethingNow() {
+        log.warn("Alright already... I'm doing it..");
+    }
+
+    @Override
+    public void shutdown() {
+        log.warn("Test daemon module shutting down...");
+        HippoServiceRegistry.unregisterService(service, MyExampleService.class);
+        log.warn("Test daemon module shut down");
+    }
+
+    @Override
+    public void configure(final Node moduleConfig) throws RepositoryException {
+        log.warn("Configuration exists");
+        log.warn("Configuration path: " + moduleConfig.getPath());
+        log.warn("exampleConfigurationOption=" + moduleConfig.getProperty("exampleConfigurationOption").getString());
+    }
+}
