You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2008/07/25 11:59:52 UTC
svn commit: r679735 - in /jackrabbit/trunk:
jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/ExtendedEvent.java
jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java
Author: jukka
Date: Fri Jul 25 02:59:52 2008
New Revision: 679735
URL: http://svn.apache.org/viewvc?rev=679735&view=rev
Log:
JCR-1672: Adding Event interface and isLocal()
Applied jackrabbit.patch from Carsten Ziegeler
Added:
jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/ExtendedEvent.java
Modified:
jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java
Added: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/ExtendedEvent.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/ExtendedEvent.java?rev=679735&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/ExtendedEvent.java (added)
+++ jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/ExtendedEvent.java Fri Jul 25 02:59:52 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.jackrabbit.api.observation;
+
+import javax.jcr.observation.Event;
+
+/**
+ * This is an extension of the event interface which provides
+ * a method to detect whether the changes happened on locally
+ * or remotely in a clustered environment.
+ */
+public interface ExtendedEvent extends Event {
+
+ /**
+ * Return a flag indicating whether this is an externally generated event.
+ *
+ * @return <code>true</code> if this is an external event;
+ * <code>false</code> otherwise
+ */
+ boolean isExternal();
+}
Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java?rev=679735&r1=679734&r2=679735&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventImpl.java Fri Jul 25 02:59:52 2008
@@ -16,6 +16,7 @@
*/
package org.apache.jackrabbit.core.observation;
+import org.apache.jackrabbit.api.observation.ExtendedEvent;
import org.apache.jackrabbit.core.NodeId;
import org.apache.jackrabbit.core.SessionImpl;
import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
@@ -28,9 +29,10 @@
import javax.jcr.observation.Event;
/**
- * Implementation of the {@link javax.jcr.observation.Event} interface.
+ * Implementation of the {@link javax.jcr.observation.Event} and
+ * the {@link ExtendedEvent} interface.
*/
-public final class EventImpl implements Event {
+public final class EventImpl implements ExtendedEvent {
/**
* Logger instance for this class
@@ -144,6 +146,7 @@
*
* @return <code>true</code> if this is an external event;
* <code>false</code> otherwise
+ * @see ExtendedEvent#isExternal()
*/
public boolean isExternal() {
return eventState.isExternal();