Author: cziegeler
Date: Mon Feb 22 11:31:39 2010
New Revision: 912536

URL: http://svn.apache.org/viewvc?rev=912536&view=rev
Log:
Move private class into private package and fix include instructions

Added:
    
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/job/JobStatusNotifier.java
   (with props)
Modified:
    sling/trunk/bundles/extensions/event/pom.xml
    
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/EventUtil.java
    
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventHelper.java
    
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java

Modified: sling/trunk/bundles/extensions/event/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/pom.xml?rev=912536&r1=912535&r2=912536&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/pom.xml (original)
+++ sling/trunk/bundles/extensions/event/pom.xml Mon Feb 22 11:31:39 2010
@@ -73,7 +73,7 @@
                             slingevent=http://sling.apache.org/jcr/event/1.0
                         </Sling-Namespaces>
                         <Embed-Dependency>
-                            
jackrabbit-jcr-commons;inline="org/apache/jackrabbit/util/ISO9075.*|org/apache/jackrabbit/name/ISO8601.*|org/apache/jackrabbit/util/XMLChar.*"
+                            
jackrabbit-jcr-commons;inline="org/apache/jackrabbit/util/ISO9075.*|org/apache/jackrabbit/util/ISO8601.*|org/apache/jackrabbit/util/XMLChar.*"
                         </Embed-Dependency>
                     </instructions>
                 </configuration>

Modified: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/EventUtil.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/EventUtil.java?rev=912536&r1=912535&r2=912536&view=diff
==============================================================================
--- 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/EventUtil.java
 (original)
+++ 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/EventUtil.java
 Mon Feb 22 11:31:39 2010
@@ -22,9 +22,9 @@
 import java.util.Enumeration;
 import java.util.Hashtable;
 
-import org.apache.sling.event.EventUtil.JobStatusNotifier.NotifierContext;
 import org.apache.sling.event.impl.AbstractRepositoryEventHandler;
 import org.apache.sling.event.impl.JobEventHandler;
+import org.apache.sling.event.impl.job.JobStatusNotifier;
 import org.osgi.service.event.Event;
 import org.slf4j.LoggerFactory;
 
@@ -230,7 +230,7 @@
         if ( !isJobEvent(job) ) {
             return null;
         }
-        final JobStatusNotifier.NotifierContext ctx = (NotifierContext) 
job.getProperty(JobStatusNotifier.CONTEXT_PROPERTY_NAME);
+        final JobStatusNotifier.NotifierContext ctx = 
(JobStatusNotifier.NotifierContext) 
job.getProperty(JobStatusNotifier.CONTEXT_PROPERTY_NAME);
         if ( ctx == null ) {
             throw new IllegalArgumentException("JobStatusNotifier context is 
not available in event properties.");
         }
@@ -341,46 +341,6 @@
     }
 
     /**
-     * This is a private interface which is only public for import reasons.
-     */
-    public static interface JobStatusNotifier {
-
-        String CONTEXT_PROPERTY_NAME = JobStatusNotifier.class.getName();
-
-        public static final class NotifierContext {
-            public final JobStatusNotifier notifier;
-            public final String eventNodePath;
-
-            public NotifierContext(JobStatusNotifier n, String path) {
-                this.notifier = n;
-                this.eventNodePath = path;
-            }
-        }
-
-        /**
-         * Send an acknowledge message that someone is processing the job.
-         * @param job The job.
-         * @param eventNodePath The storage node in the repository.
-         * @return <code>true</code> if the ack is ok, <code>false</code> 
otherwise (e.g. if
-         *   someone else already send an ack for this job.
-         */
-        boolean sendAcknowledge(Event job, String eventNodePath);
-
-        /**
-         * Notify that the job is finished.
-         * If the job is not rescheduled, a return value of <code>false</code> 
indicates an error
-         * during the processing. If the job should be rescheduled, 
<code>true</code> indicates
-         * that the job could be rescheduled. If an error occurs or the number 
of retries is
-         * exceeded, <code>false</code> will be returned.
-         * @param job The job.
-         * @param eventNodePath The storage node in the repository.
-         * @param reschedule Should the event be rescheduled?
-         * @return <code>true</code> if everything went fine, 
<code>false</code> otherwise.
-         */
-        boolean finishedJob(Event job, String eventNodePath, boolean 
reschedule);
-    }
-
-    /**
      * Improved toString method for an Event.
      * This method prints out the event topic and all of the properties.
      */

Modified: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventHelper.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventHelper.java?rev=912536&r1=912535&r2=912536&view=diff
==============================================================================
--- 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventHelper.java
 (original)
+++ 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventHelper.java
 Mon Feb 22 11:31:39 2010
@@ -43,6 +43,7 @@
 import org.apache.jackrabbit.util.ISO9075;
 import org.apache.sling.event.EventUtil;
 import org.apache.sling.event.JobStatusProvider;
+import org.apache.sling.event.impl.job.JobStatusNotifier;
 import org.osgi.service.event.Event;
 
 
@@ -85,7 +86,7 @@
         EventUtil.PROPERTY_DISTRIBUTE,
         EventUtil.PROPERTY_APPLICATION,
         JobStatusProvider.PROPERTY_EVENT_ID,
-        EventUtil.JobStatusNotifier.CONTEXT_PROPERTY_NAME
+        JobStatusNotifier.CONTEXT_PROPERTY_NAME
     };
 
     /** List of ignored prefixes to read from the repository. */

Modified: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java?rev=912536&r1=912535&r2=912536&view=diff
==============================================================================
--- 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
 (original)
+++ 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
 Mon Feb 22 11:31:39 2010
@@ -56,6 +56,7 @@
 import org.apache.sling.event.EventUtil;
 import org.apache.sling.event.JobStatusProvider;
 import org.apache.sling.event.impl.job.JobBlockingQueue;
+import org.apache.sling.event.impl.job.JobStatusNotifier;
 import org.apache.sling.event.impl.job.JobUtil;
 import org.apache.sling.event.impl.job.ParallelInfo;
 import org.osgi.framework.Constants;
@@ -91,7 +92,7 @@
 })
 public class JobEventHandler
     extends AbstractRepositoryEventHandler
-    implements EventUtil.JobStatusNotifier, JobStatusProvider, Runnable {
+    implements JobStatusNotifier, JobStatusProvider, Runnable {
 
     /** A map for keeping track of currently processed job topics. */
     private final Map<String, Boolean> processingMap = new HashMap<String, 
Boolean>();
@@ -1036,8 +1037,8 @@
         final String eventTopic = 
(String)e.getProperty(EventUtil.PROPERTY_JOB_TOPIC);
         final Dictionary<String, Object> properties = new 
EventPropertiesMap(e);
         // put properties for finished job callback
-        properties.put(EventUtil.JobStatusNotifier.CONTEXT_PROPERTY_NAME,
-                new EventUtil.JobStatusNotifier.NotifierContext(this, 
nodePath));
+        properties.put(JobStatusNotifier.CONTEXT_PROPERTY_NAME,
+                new JobStatusNotifier.NotifierContext(this, nodePath));
         return new Event(eventTopic, properties);
     }
 

Added: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/job/JobStatusNotifier.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/job/JobStatusNotifier.java?rev=912536&view=auto
==============================================================================
--- 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/job/JobStatusNotifier.java
 (added)
+++ 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/job/JobStatusNotifier.java
 Mon Feb 22 11:31:39 2010
@@ -0,0 +1,58 @@
+/*
+ * 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.sling.event.impl.job;
+
+import org.osgi.service.event.Event;
+
+public interface JobStatusNotifier {
+
+    String CONTEXT_PROPERTY_NAME = JobStatusNotifier.class.getName();
+
+    public static final class NotifierContext {
+        public final JobStatusNotifier notifier;
+        public final String eventNodePath;
+
+        public NotifierContext(JobStatusNotifier n, String path) {
+            this.notifier = n;
+            this.eventNodePath = path;
+        }
+    }
+
+    /**
+     * Send an acknowledge message that someone is processing the job.
+     * @param job The job.
+     * @param eventNodePath The storage node in the repository.
+     * @return <code>true</code> if the ack is ok, <code>false</code> 
otherwise (e.g. if
+     *   someone else already send an ack for this job.
+     */
+    boolean sendAcknowledge(Event job, String eventNodePath);
+
+    /**
+     * Notify that the job is finished.
+     * If the job is not rescheduled, a return value of <code>false</code> 
indicates an error
+     * during the processing. If the job should be rescheduled, 
<code>true</code> indicates
+     * that the job could be rescheduled. If an error occurs or the number of 
retries is
+     * exceeded, <code>false</code> will be returned.
+     * @param job The job.
+     * @param eventNodePath The storage node in the repository.
+     * @param reschedule Should the event be rescheduled?
+     * @return <code>true</code> if everything went fine, <code>false</code> 
otherwise.
+     */
+    boolean finishedJob(Event job, String eventNodePath, boolean reschedule);
+}

Propchange: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/job/JobStatusNotifier.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/job/JobStatusNotifier.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/job/JobStatusNotifier.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain


Reply via email to