incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Sling Website > Managing events
Date Mon, 16 Aug 2010 10:02:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=SLINGxSITE&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/SLINGxSITE/Managing+events">Managing
events</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~jck">Jean-Christophe
KAUTZMANN</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>You can learn more in the
&quot;Eventing, Jobs and Scheduling&quot; section (http://sling.apache.org/site/eventing-and-jobs.html).
 <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>To get started with the Sling eventing API, you will implement here a service that
listens to files posted to /tmp/dropbox and moves them to the appropriate locations depending
on the mime-type: <br> * images (.png) are moved to /dropbox/images/ <br> * music
(.mp3) are moved to /dropbox/music/ <br> * movies (.avi) are moved to /dropbox/movies/
<br> * otherwise the files are moved to /dropbox/other/ <br> <br>To do that,
you will implement 2 services. The first one, called OsgiDropBoxService: <br>- listens
to osgi event &quot;resource added&quot; <br>- sends a job event <br>The
second one, called DropBoxEventHandler: <br>- listens to job event &quot;file added
to /tmp/dropbox&quot; <br>- moves the file according to its extension <br>
<br>Listening to osgi event &quot;resource added&quot; <br> <br>To
listen to the specific osgi event &quot;resource added&quot;: <br>- The service
needs to implement the interface org.osgi.service.event.EventHandler and its handleEvent(Event
event) method. <br>- The property &quot;event.topics&quot; needs to be set to
&quot;org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED&quot; in the class
annotations. <br>To get a list of possible events available in Sling (resource added,
removed or changed), refer to the javadocs for org.apache.sling.api.SlingConstants. <br>
<br>To send a job event: <br>- The service needs to implement the interface org.apache.sling.event.JobProcessor
and its process(org.osgi.service.event.Event job) method. <br> <br>The first part
of the code looks as follows: <br>/** <br> * The &lt;code&gt;OsgiDropBoxService&lt;/code&gt;
is listening content added to /tmp/dropbox by using OSGI events <br> *  <br> *
@scr.component  immediate=&quot;true&quot; <br> * @scr.service interface=&quot;org.osgi.service.event.EventHandler&quot;
<br> * @scr.property name=&quot;event.topics&quot; valueRef=&quot;org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED&quot;
<br> */ <br>public class OsgiDropBoxService implements JobProcessor, EventHandler
{ <br> <br>The Event Admin service is needed to send the job event: <br>
/**  <br>	 * The OSGI event admin used for sending events  <br>     * @scr.reference
<br>	 */ <br>	private EventAdmin eventAdmin; <br> <br>The job topic
for dropbox job events needs to be defined: <br>    /** The job topic for dropbox job
events. */ <br>    public static final String JOB_TOPIC = &quot;com/sling/eventing/dropbox/job&quot;;
<br> <br>The org.osgi.service.event.EventHandler#handleEvent(Event event) method
needs to be implemented: <br>	public void handleEvent(Event event) { <br>	   
if (EventUtil.isLocal(event)) { <br>	        EventUtil.processJob(event, this); <br>
    } <br>	} <br> <br>The org.apache.sling.event.JobProcessor#process(Event
event) method needs to be implemented. <br>The logic is as follows: <br>- the
OSGI event is analyzed <br>- if the event is a file that has been added to &quot;/tmp/dropbox&quot;:
<br>	- an event is created with 2 properties: <br>		- one to flag the event as
a job event <br>		- the file path <br>	- the job event is sent to all the listeners
that subscribe to the topic of the event. <br> <br>	public boolean process(Event
event) { <br>		String propPath = (String) event.getProperty(SlingConstants.PROPERTY_PATH);
<br>		String propResType = (String) event.getProperty(SlingConstants.PROPERTY_RESOURCE_TYPE);
<br>		// an event is sent if a file is added to /tmp/dropbox <br>		if (propPath.startsWith(&quot;/tmp/dropbox&quot;)
&amp;&amp; propResType.equals(&quot;nt:file&quot;)) { <br>    		final
Dictionary&lt;String, Object&gt; props = new Hashtable&lt;String, Object&gt;();
<br>            props.put(EventUtil.PROPERTY_JOB_TOPIC, JOB_TOPIC); <br>    	
props.put(&quot;resourcePath&quot;, propPath); <br>    		Event dropboxJobEvent
= new Event(EventUtil.TOPIC_JOB, props); <br>    		eventAdmin.sendEvent(dropboxJobEvent);
<br>    		log.info(&quot;the dropbox job has been sent: {}&quot;, propPath);
<br>		} <br>		return true; <br>	} <br> <br>The whole service
looks now as follows: <br>... <br> <br>Now that you have a service that
sends job events whenever a file is uploaded to &quot;/tmp/dropbox&quot;,  <br>you
will create the service DropBoxEventHandler that listens to those job events and moves the
files to a location <br>corresponding to their mime-types. <br> <br>Listening
to job events <br> <br>To listen to the job events that have been defined before:
<br>- The service also needs to implement the interface org.osgi.service.event.EventHandler
and its handleEvent(Event event) method. <br>- The property &quot;event.topics&quot;
needs to be set to &quot;com.jck.sling.eventing.osgi.OsgiDropBoxService.JOB_TOPIC&quot;
in the class annotations. <br> <br>To move the files: <br>- The service
needs to implement the interface org.apache.sling.event.JobProcessor and its process(org.osgi.service.event.Event
job) method. <br> <br>The first part of the code looks as follows: <br>/**
<br> * @scr.component  immediate=&quot;true&quot; <br> * @scr.service
interface=&quot;org.osgi.service.event.EventHandler&quot; <br> * @scr.property
name=&quot;event.topics&quot; valueRef=&quot;com.jck.sling.eventing.osgi.OsgiDropBoxService.JOB_TOPIC&quot;
<br> */ <br> <br>public class DropBoxEventHandler implements JobProcessor,
EventHandler { <br> <br> <br> <br>Several class fields are defined:
<br>- for logging <br>- to reference the SlingRepository and the JcrResourceResolverFactory
services, which are used in the implementation <br>- to define the destination path
of the files <br> <br>    /** Default log. */ <br>    protected final Logger
log = LoggerFactory.getLogger(this.getClass()); <br> <br>    private Session adminSession;
<br> <br>    /** @scr.reference */ <br>    private SlingRepository repository;
<br> <br>    /** <br>     * @scr.reference <br>     */ <br>
   private JcrResourceResolverFactory resolverFactory; <br> <br>    private final
static String IMAGES_PATH = &quot;/dropbox/images/&quot;; <br>    private final
static String MUSIC_PATH = &quot;/dropbox/music/&quot;; <br>    private final
static String MOVIES_PATH = &quot;/dropbox/movies/&quot;; <br>    private final
static String OTHER_PATH = &quot;/dropbox/other/&quot;; <br> <br>The org.osgi.service.event.EventHandler#handleEvent(Event
event) method needs to be implemented: <br>	public void handleEvent(Event event) { <br>
    if (EventUtil.isLocal(event)) { <br>	        EventUtil.processJob(event, this);
<br>	    } <br>	} <br> <br>The org.apache.sling.event.JobProcessor#process(Event
event) method needs to be implemented. <br>The logic is as follows: <br>- the
resource path is extracted from the job event property <br>- the resource is obtained
from the file path <br>- if the resource is a file, the destination path is defined
based on the file mime-type <br>- the file is moved to the new location <br> <br>
public boolean process(Event event) { <br>		try { <br>			String resourcePath =
(String) event.getProperty(&quot;resourcePath&quot;); <br>			String resourceName
= resourcePath.substring(resourcePath.lastIndexOf(&quot;/&quot;) + 1); <br>
       	adminSession = repository.loginAdministrative(null); <br>	        ResourceResolver
resourceResolver = resolverFactory.getResourceResolver(adminSession); <br>	        Resource
res = resourceResolver.getResource(resourcePath); <br>	        if (ResourceUtil.isA(res,
&quot;nt:file&quot;)) { <br>	        	String mimeType = res.getResourceMetadata().getContentType();
<br>	        	String destDir; <br>	        	if (mimeType.equals(&quot;image/png&quot;))
{ <br>	        		destDir = IMAGES_PATH; <br>	        	} <br>	        	else
if (mimeType.equals(&quot;audio/mpeg&quot;)) { <br>	        		destDir = MUSIC_PATH;
<br>	        	} <br>	        	else if (mimeType.equals(&quot;video/x-msvideo&quot;))
{ <br>	        		destDir = MOVIES_PATH; <br>	        	} <br>	        	else
{ <br>	        		destDir = OTHER_PATH; <br>	        	} <br>        		adminSession.move(resourcePath,
destDir + resourceName); <br>	        	adminSession.save(); <br>	        	log.info(&quot;The
file {} has been moved to {}&quot;, resourceName, destDir); <br>	        } <br>
        return true; <br>		} catch (RepositoryException e) { <br>			log.error(&quot;RepositoryException:
&quot; + e); <br>			return false; <br>        } finally { <br>     
      if (adminSession != null &amp;&amp; adminSession.isLive()) { <br>    
       	adminSession.logout(); <br>            	adminSession = null; <br>    
       } <br>        } <br>	} <br> <br>The complete code for the service
looks as follows: <br>... <br> <br> <br>2 services <br> <br>Sling
sends OSGi events when resources are added, removed or changed <br>	org.apache.sling.api.SlingConstants:
<br>		TOPIC_RESOURCE_ADDED <br>		TOPIC_RESOURCE_REMOVED <br>		TOPIC_RESOURCE_CHANGED
<br> <br>Web console: see all the events sent <br>	http://localhost:4502/system/console/events
<br> <br> <br>How to listen to osgi events: <br>	subscribe to the
event <br>		 * @scr.property name=&quot;event.topics&quot; valueRef=&quot;org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED&quot;
<br>	the service needs to implement JobProcessor and EventHandler (org.osgi.service.event.EventHandler,
listener for events) <br>		process(org.osgi.service.event.Event job) from JobProcessor
<br>		handleEvent(Event event) from EventHandler <br> <br> <br>Send
a job event <br> <br>		reference the osgi EventAdmin <br>		define the JOB_TOPIC
<br>		define the job and send it: <br>    		final Dictionary&lt;String, Object&gt;
props = new Hashtable&lt;String, Object&gt;(); <br>            props.put(EventUtil.PROPERTY_JOB_TOPIC,
JOB_TOPIC); <br>    		props.put(&quot;nodePath&quot;, propPath); <br>
   		Event dropboxJobEvent = new Event(EventUtil.TOPIC_JOB, props); <br>    		eventAdmin.sendEvent(dropboxJobEvent);
<br> <br> <br>Listen to a Job event <br>same as listening to an event,
except: <br> * @scr.property name=&quot;event.topics&quot; valueRef=&quot;com.jck.sling.eventing.osgi.OsgiDropBoxService.JOB_TOPIC&quot;
<br> <br>Complete code sample <br>... <br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>Apache Sling provides some mechanisms and support for managing events. This
page describes ...</p>

<p>Sling distinguishes between 2 types of events:</p>
<ul class="alternate" type="square">
	<li>standard events: no garantee of processing</li>
	<li>job events: garantee of processing. Someone has to do something with the event
(do the job).</li>
</ul>


<p>The event mechanism is leveraging the OSGi Event Admin Specification (OSGi Compendium
113).<br/>
The OSGi API is very simple and leightweight - sending an event is just generating the event
object and calling the event admin. Receiving the event is implementing a single interface
and declaring through properties which topics one is interested in. For more details please
refer to the following javadocs:</p>
<ul class="alternate" type="square">
	<li>package org.osgi.service.event of the OSGI API (<a href="http://www.osgi.org/javadoc/r4v42/org/osgi/service/event/package-summary.html"
class="external-link" rel="nofollow">http://www.osgi.org/javadoc/r4v42/org/osgi/service/event/package-summary.html</a>).</li>
	<li>package org.apache.sling.event of the Sling API (<a href="http://sling.apache.org/apidocs/sling5/org/apache/sling/event/package-summary.html"
class="external-link" rel="nofollow">http://sling.apache.org/apidocs/sling5/org/apache/sling/event/package-summary.html</a>)</li>
</ul>


<p>You can learn more in the "Eventing, Jobs and Scheduling" section (<a href="http://sling.apache.org/site/eventing-and-jobs.html"
class="external-link" rel="nofollow">http://sling.apache.org/site/eventing-and-jobs.html</a>).
</p>

<p>To get started with the Sling eventing API, you will implement here a service that
listens to files posted to /tmp/dropbox and moves them to the appropriate locations depending
on the mime-type:</p>
<ul>
	<li>images (.png) are moved to /dropbox/images/</li>
	<li>music (.mp3) are moved to /dropbox/music/</li>
	<li>movies (.avi) are moved to /dropbox/movies/</li>
	<li>otherwise the files are moved to /dropbox/other/</li>
</ul>


<p>To do that, you will implement 2 services. The first one, called OsgiDropBoxService:</p>
<ul class="alternate" type="square">
	<li>listens to osgi event "resource added"</li>
	<li>sends a job event<br/>
The second one, called DropBoxEventHandler:</li>
	<li>listens to job event "file added to /tmp/dropbox"</li>
	<li>moves the file according to its extension</li>
</ul>


<p>Listening to osgi event "resource added"</p>

<p>To listen to the specific osgi event "resource added":</p>
<ul class="alternate" type="square">
	<li>The service needs to implement the interface org.osgi.service.event.EventHandler
and its handleEvent(Event event) method.</li>
	<li>The property "event.topics" needs to be set to "org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED"
in the class annotations.<br/>
To get a list of possible events available in Sling (resource added, removed or changed),
refer to the javadocs for org.apache.sling.api.SlingConstants.</li>
</ul>


<p>To send a job event:</p>
<ul class="alternate" type="square">
	<li>The service needs to implement the interface org.apache.sling.event.JobProcessor
and its process(org.osgi.service.event.Event job) method.</li>
</ul>


<p>The first part of the code looks as follows:<br/>
/**</p>
<ul>
	<li>The &lt;code&gt;OsgiDropBoxService&lt;/code&gt; is listening content
added to /tmp/dropbox by using OSGI events</li>
	<li></li>
	<li>@scr.component  immediate="true"</li>
	<li>@scr.service interface="org.osgi.service.event.EventHandler"</li>
	<li>@scr.property name="event.topics" valueRef="org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED"<br/>
 */<br/>
public class OsgiDropBoxService implements JobProcessor, EventHandler {</li>
</ul>


<p>The Event Admin service is needed to send the job event:<br/>
	/** </p>
<ul>
	<li>The OSGI event admin used for sending events</li>
	<li>@scr.reference<br/>
	 */<br/>
	private EventAdmin eventAdmin;</li>
</ul>


<p>The job topic for dropbox job events needs to be defined:<br/>
    /** The job topic for dropbox job events. */<br/>
    public static final String JOB_TOPIC = "com/sling/eventing/dropbox/job";</p>

<p>The org.osgi.service.event.EventHandler#handleEvent(Event event) method needs to
be implemented:<br/>
	public void handleEvent(Event event) {<br/>
	    if (EventUtil.isLocal(event)) </p>
<div class="error"><span class="error">Unknown macro: {
	        EventUtil.processJob(event, this);
	    }</span> 
<p>	}</p>

<p>The org.apache.sling.event.JobProcessor#process(Event event) method needs to be implemented.<br/>
The logic is as follows:</p>
<ul class="alternate" type="square">
	<li>the OSGI event is analyzed</li>
	<li>if the event is a file that has been added to "/tmp/dropbox":</li>
	<li>an event is created with 2 properties:</li>
	<li>one to flag the event as a job event</li>
	<li>the file path</li>
	<li>the job event is sent to all the listeners that subscribe to the topic of the event.</li>
</ul>


<p>	public boolean process(Event event) {<br/>
		String propPath = (String) event.getProperty(SlingConstants.PROPERTY_PATH);<br/>
		String propResType = (String) event.getProperty(SlingConstants.PROPERTY_RESOURCE_TYPE);<br/>
		// an event is sent if a file is added to /tmp/dropbox<br/>
		if (propPath.startsWith("/tmp/dropbox") &amp;&amp; propResType.equals("nt:file"))
{<br/>
    		final Dictionary&lt;String, Object&gt; props = new Hashtable&lt;String,
Object&gt;();<br/>
            props.put(EventUtil.PROPERTY_JOB_TOPIC, JOB_TOPIC);<br/>
    		props.put("resourcePath", propPath);<br/>
    		Event dropboxJobEvent = new Event(EventUtil.TOPIC_JOB, props);<br/>
    		eventAdmin.sendEvent(dropboxJobEvent);<br/>
    		log.info("the dropbox job has been sent: {}", propPath);<br/>
		}<br/>
		return true;<br/>
	}</p>

<p>The whole service looks now as follows:<br/>
...</p>

<p>Now that you have a service that sends job events whenever a file is uploaded to
"/tmp/dropbox", <br/>
you will create the service DropBoxEventHandler that listens to those job events and moves
the files to a location<br/>
corresponding to their mime-types.</p>

<p>Listening to job events</p>

<p>To listen to the job events that have been defined before:</p>
<ul class="alternate" type="square">
	<li>The service also needs to implement the interface org.osgi.service.event.EventHandler
and its handleEvent(Event event) method.</li>
	<li>The property "event.topics" needs to be set to "com.jck.sling.eventing.osgi.OsgiDropBoxService.JOB_TOPIC"
in the class annotations.</li>
</ul>


<p>To move the files:</p>
<ul class="alternate" type="square">
	<li>The service needs to implement the interface org.apache.sling.event.JobProcessor
and its process(org.osgi.service.event.Event job) method.</li>
</ul>


<p>The first part of the code looks as follows:<br/>
/**</p>
<ul>
	<li>@scr.component  immediate="true"</li>
	<li>@scr.service interface="org.osgi.service.event.EventHandler"</li>
	<li>@scr.property name="event.topics" valueRef="com.jck.sling.eventing.osgi.OsgiDropBoxService.JOB_TOPIC"<br/>
 */</li>
</ul>


<p>public class DropBoxEventHandler implements JobProcessor, EventHandler {</p>



<p>Several class fields are defined:</p>
<ul class="alternate" type="square">
	<li>for logging</li>
	<li>to reference the SlingRepository and the JcrResourceResolverFactory services, which
are used in the implementation</li>
	<li>to define the destination path of the files</li>
</ul>


<p>    /** Default log. */<br/>
    protected final Logger log = LoggerFactory.getLogger(this.getClass());</p>

<p>    private Session adminSession;</p>

<p>    /** @scr.reference */<br/>
    private SlingRepository repository;</p>

<p>    /**</p>
<ul>
	<li>@scr.reference<br/>
     */<br/>
    private JcrResourceResolverFactory resolverFactory;</li>
</ul>


<p>    private final static String IMAGES_PATH = "/dropbox/images/";<br/>
    private final static String MUSIC_PATH = "/dropbox/music/";<br/>
    private final static String MOVIES_PATH = "/dropbox/movies/";<br/>
    private final static String OTHER_PATH = "/dropbox/other/";</p>

<p>The org.osgi.service.event.EventHandler#handleEvent(Event event) method needs to
be implemented:<br/>
	public void handleEvent(Event event) {<br/>
	    if (EventUtil.isLocal(event)) </p></div>
<p>	}</p>

<p>The org.apache.sling.event.JobProcessor#process(Event event) method needs to be implemented.<br/>
The logic is as follows:</p>
<ul class="alternate" type="square">
	<li>the resource path is extracted from the job event property</li>
	<li>the resource is obtained from the file path</li>
	<li>if the resource is a file, the destination path is defined based on the file mime-type</li>
	<li>the file is moved to the new location</li>
</ul>


<p>	public boolean process(Event event) {<br/>
		try {<br/>
			String resourcePath = (String) event.getProperty("resourcePath");<br/>
			String resourceName = resourcePath.substring(resourcePath.lastIndexOf("/") + 1);<br/>
        	adminSession = repository.loginAdministrative(null);<br/>
	        ResourceResolver resourceResolver = resolverFactory.getResourceResolver(adminSession);<br/>
	        Resource res = resourceResolver.getResource(resourcePath);<br/>
	        if (ResourceUtil.isA(res, "nt:file")) {<br/>
	        	String mimeType = res.getResourceMetadata().getContentType();<br/>
	        	String destDir;<br/>
	        	if (mimeType.equals("image/png")) </p>
<div class="error"><span class="error">Unknown macro: {
	        		destDir = IMAGES_PATH;
	        	}</span> </div>
<p>	        	else if (mimeType.equals("audio/mpeg")) </p>
<div class="error"><span class="error">Unknown macro: {
	        		destDir = MUSIC_PATH;
	        	}</span> </div>
<p>	        	else if (mimeType.equals("video/x-msvideo")) </p>
<div class="error"><span class="error">Unknown macro: {
	        		destDir = MOVIES_PATH;
	        	}</span> </div>
<p>	        	else </p>
<div class="error"><span class="error">Unknown macro: {
	        		destDir = OTHER_PATH;
	        	}</span> </div>
<p>        		adminSession.move(resourcePath, destDir + resourceName);<br/>
	        	adminSession.save();<br/>
	        	log.info("The file {} has been moved to {}", resourceName, destDir);<br/>
	        }<br/>
	        return true;<br/>
		} catch (RepositoryException e) </p>
<div class="error"><span class="error">Unknown macro: {
			log.error(&quot;RepositoryException}</span> </div>
<p> finally {<br/>
            if (adminSession != null &amp;&amp; adminSession.isLive()) </p>
<div class="error"><span class="error">Unknown macro: {
            	adminSession.logout();
            	adminSession = null;
            }</span> </div>
<p>        }<br/>
	}</p>

<p>The complete code for the service looks as follows:<br/>
...</p>


<p>2 services</p>

<p>Sling sends OSGi events when resources are added, removed or changed<br/>
	org.apache.sling.api.SlingConstants:<br/>
		TOPIC_RESOURCE_ADDED<br/>
		TOPIC_RESOURCE_REMOVED<br/>
		TOPIC_RESOURCE_CHANGED</p>

<p>Web console: see all the events sent<br/>
	<a href="http://localhost:4502/system/console/events" class="external-link" rel="nofollow">http://localhost:4502/system/console/events</a></p>


<p>How to listen to osgi events:<br/>
	subscribe to the event</p>
<ul>
	<li>@scr.property name="event.topics" valueRef="org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED"<br/>
	the service needs to implement JobProcessor and EventHandler (org.osgi.service.event.EventHandler,
listener for events)<br/>
		process(org.osgi.service.event.Event job) from JobProcessor<br/>
		handleEvent(Event event) from EventHandler</li>
</ul>



<p>Send a job event</p>

<p>		reference the osgi EventAdmin<br/>
		define the JOB_TOPIC<br/>
		define the job and send it:<br/>
    		final Dictionary&lt;String, Object&gt; props = new Hashtable&lt;String,
Object&gt;();<br/>
            props.put(EventUtil.PROPERTY_JOB_TOPIC, JOB_TOPIC);<br/>
    		props.put("nodePath", propPath);<br/>
    		Event dropboxJobEvent = new Event(EventUtil.TOPIC_JOB, props);<br/>
    		eventAdmin.sendEvent(dropboxJobEvent);</p>


<p>Listen to a Job event<br/>
same as listening to an event, except:</p>
<ul>
	<li>@scr.property name="event.topics" valueRef="com.jck.sling.eventing.osgi.OsgiDropBoxService.JOB_TOPIC"</li>
</ul>


<p>Complete code sample<br/>
...</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/SLINGxSITE/Managing+events">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=23335037&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/SLINGxSITE/Managing+events?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message