incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1463857 - /sling/site/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.mdtext
Date Wed, 03 Apr 2013 07:53:15 GMT
Author: fmeschbe
Date: Wed Apr  3 07:53:15 2013
New Revision: 1463857

URL: http://svn.apache.org/r1463857
Log:
formatting

Modified:
    sling/site/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.mdtext

Modified: sling/site/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.mdtext?rev=1463857&r1=1463856&r2=1463857&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.mdtext
(original)
+++ sling/site/trunk/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.mdtext
Wed Apr  3 07:53:15 2013
@@ -54,11 +54,14 @@ To send an event the following code can 
         props.put("resourcePath", RESOURCE_PATH);
         final Event myEvent = new Event(JobUtil.TOPIC_JOB, props);
         eventAdmin.sendEvent(myEvent);
+    }
 
 However, for our example, to send a job event the service needs to implement the **org.osgi.service.event.EventHandler**
and **org.apache.sling.event.JobProcessor** interfaces:
 
     :::java
     public class DropBoxService implements JobProcessor, EventHandler {
+        ...
+    }
 
 
 To send the job event the Event Admin service needs to be referenced:
@@ -91,10 +94,12 @@ Its logic is as follows:
 
 * The OSGI event is analyzed.
 * If the event is a file that has been added to */tmp/dropbox*:
-* * An event is created with 2 properties:
-* * * A property to set the event as a job event.
-* * * A property for the file path.
-* * The job event is sent to all the listeners that subscribe to the topic of the event.
+    * An event is created with 2 properties:
+        * A property to set the event as a job event.
+        * A property for the file path.
+    * The job event is sent to all the listeners that subscribe to the topic of the event.
+
+For example:
 
     :::java
     public boolean process(Event event) {
@@ -153,6 +158,8 @@ Some class fields need to be defined:
 * The references to the SlingRepository and the JcrResourceResolverFactory services, which
are used in the implementation.
 * The destination paths of the files.
 
+For example:
+
     :::java
     /** Default log. */
     protected final Logger log = LoggerFactory.getLogger(this.getClass());



Mime
View raw message