Bug 531344 - [osgi R7] Update APIs for R7

Update the range for event version

Provide the osgi.implementation capability for event

Update capability versions for metatype

Update APIs in log.stream

Change-Id: I13c99ff9e52e69f0f720e1de7231340bc47aacee
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
diff --git a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF
index bec08df..3adc53e 100644
--- a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@
 Import-Package: org.eclipse.osgi.framework.eventmgr;version="1.1.0",
  org.eclipse.osgi.util;version="1.1.0",
  org.osgi.framework;version="1.6.0",
- org.osgi.service.event;version="[1.3,1.4)",
+ org.osgi.service.event;version="[1.3,1.5)",
  org.osgi.service.log;version="1.3.0",
  org.osgi.util.tracker;version="1.5.0"
 Export-Package: org.eclipse.equinox.internal.event;x-internal:=true,
@@ -19,5 +19,9 @@
 Provide-Capability: 
  osgi.service;
   objectClass:List<String>="org.osgi.service.event.EventAdmin";
-  uses:="org.osgi.service.event"
+  uses:="org.osgi.service.event",
+ osgi.implementation;
+  osgi.implementation="osgi.event";
+  uses:="org.osgi.service.event";
+  version:Version="1.4"
 Automatic-Module-Name: org.eclipse.equinox.event
diff --git a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/AbstractPushStreamImpl.java b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/AbstractPushStreamImpl.java
index cf16c21..91a56c6 100644
--- a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/AbstractPushStreamImpl.java
+++ b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/AbstractPushStreamImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2015, 2017). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2015, 2018). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -260,8 +260,7 @@
 
 	@Override
 	public <R> PushStream<R> asyncMap(int n, int delay,
-			Function< ? super T,Promise< ? extends R>> mapper)
-			throws IllegalArgumentException, NullPointerException {
+			Function< ? super T,Promise< ? extends R>> mapper) {
 
 		AbstractPushStreamImpl<R> eventStream = new IntermediatePushStreamImpl<>(
 				psp, promiseFactory, this);
diff --git a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushEvent.java b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushEvent.java
index 574d655..1354dfe 100644
--- a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushEvent.java
+++ b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2015, 2017). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2015, 2018). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@
 	 * @throws IllegalStateException if this event is not a
 	 *             {@link EventType#DATA} event.
 	 */
-	public T getData() throws IllegalStateException {
+	public T getData() {
 		throw new IllegalStateException(
 				"Not a DATA event, the event type is " + getType());
 	}
@@ -90,7 +90,7 @@
 	 * @throws IllegalStateException if this event is not an
 	 *             {@link EventType#ERROR} event.
 	 */
-	public Throwable getFailure() throws IllegalStateException {
+	public Throwable getFailure() {
 		throw new IllegalStateException(
 				"Not an ERROR event, the event type is " + getType());
 	}
@@ -147,7 +147,7 @@
 	 * @throws IllegalStateException if the event is a {@link EventType#DATA}
 	 *             event.
 	 */
-	public <X> PushEvent<X> nodata() throws IllegalStateException {
+	public <X> PushEvent<X> nodata() {
 		@SuppressWarnings("unchecked")
 		PushEvent<X> result = (PushEvent<X>) this;
 		return result;
@@ -161,7 +161,7 @@
 		}
 
 		@Override
-		public T getData() throws IllegalStateException {
+		public T getData() {
 			return data;
 		}
 
@@ -176,7 +176,7 @@
 		}
 
 		@Override
-		public <X> PushEvent<X> nodata() throws IllegalStateException {
+		public <X> PushEvent<X> nodata() {
 			throw new IllegalStateException("This event is a DATA event");
 		}
 	}
diff --git a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushEventConsumer.java b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushEventConsumer.java
index 43de152..82d740b 100644
--- a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushEventConsumer.java
+++ b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushEventConsumer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2015). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2015, 2018). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,9 +60,9 @@
 	 * @param event The event
 	 * @return less than 0 means abort, 0 means continue, more than 0 means
 	 *         delay ms
-	 * @throws Exception to indicate that an error has occured and that no
-	 *         further events should be delivered to this
-	 *         {@link PushEventConsumer}
+	 * @throws Exception to indicate that an error has occurred and that no
+	 *             further events should be delivered to this
+	 *             {@link PushEventConsumer}
 	 */
 	long accept(PushEvent<? extends T> event) throws Exception;
 
diff --git a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java
index 071c9ec..2f11d10 100644
--- a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java
+++ b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2015, 2017). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2015, 2018). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@
 	 * {@link PushEvent.EventType#CLOSE} downstream. Closing a PushStream is a
 	 * safe operation that will not throw an Exception.
 	 * <p>
-	 * Calling <code>close()</code> on a closed PushStream has no effect.
+	 * Calling {@code close()} on a closed PushStream has no effect.
 	 */
 	@Override
 	void close();
@@ -120,8 +120,7 @@
 	 * @throws NullPointerException if the mapper is null
 	 */
 	<R> PushStream<R> asyncMap(int n, int delay,
-			Function< ? super T,Promise< ? extends R>> mapper)
-			throws IllegalArgumentException, NullPointerException;
+			Function< ? super T,Promise< ? extends R>> mapper);
 
 	/**
 	 * Flat map the payload value (turn one event into 0..n events of
@@ -213,15 +212,14 @@
 	 *             the delay is &lt; 0
 	 * @throws NullPointerException if the Executor is null
 	 */
-	PushStream<T> fork(int n, int delay, Executor e)
-			throws IllegalArgumentException, NullPointerException;
+	PushStream<T> fork(int n, int delay, Executor e);
 
 	/**
 	 * Buffer the events in a queue using default values for the queue size and
-	 * other behaviours. Buffered work will be processed asynchronously in the
+	 * other behaviors. Buffered work will be processed asynchronously in the
 	 * rest of the chain. Buffering also blocks the transmission of back
 	 * pressure to previous elements in the chain, although back pressure is
-	 * honoured by the buffer.
+	 * honored by the buffer.
 	 * <p>
 	 * Buffers are useful for "bursty" event sources which produce a number of
 	 * events close together, then none for some time. These bursts can
@@ -237,10 +235,10 @@
 
 	/**
 	 * Build a buffer to enqueue events in a queue using custom values for the
-	 * queue size and other behaviours. Buffered work will be processed
+	 * queue size and other behaviors. Buffered work will be processed
 	 * asynchronously in the rest of the chain. Buffering also blocks the
 	 * transmission of back pressure to previous elements in the chain, although
-	 * back pressure is honoured by the buffer.
+	 * back pressure is honored by the buffer.
 	 * <p>
 	 * Buffers are useful for "bursty" event sources which produce a number of
 	 * events close together, then none for some time. These bursts can
@@ -282,8 +280,8 @@
 	 * predicate is true, the event is dispatched to that channel on the same
 	 * position. All predicates are tested for every event.
 	 * <p>
-	 * This method differs from other methods of AsyncStream in three
-	 * significant ways:
+	 * This method differs from other methods of PushStream in three significant
+	 * ways:
 	 * <ul>
 	 * <li>The return value contains multiple streams.</li>
 	 * <li>This stream will only close when all of these child streams have
@@ -547,14 +545,15 @@
 	 * 
 	 * @param identity
 	 * @param accumulator
-	 * @param combiner combines to U's into one U (e.g. how combine two lists)
+	 * @param combiner combines two U's into one U (for example, combine two
+	 *            lists)
 	 * @return The promise
 	 */
 	<U> Promise<U> reduce(U identity, BiFunction<U, ? super T,U> accumulator,
 			BinaryOperator<U> combiner);
 
 	/**
-	 * See Stream. Will resolve onces the channel closes.
+	 * See Stream. Will resolve once the channel closes.
 	 * <p>
 	 * This is a <strong>terminal operation</strong>
 	 * 
@@ -609,7 +608,7 @@
 
 	/**
 	 * Closes the channel and resolve the promise with false when the predicate
-	 * does not matches a pay load.If the channel is closed before, the promise
+	 * does not matches a pay load. If the channel is closed before, the promise
 	 * is resolved with true.
 	 * <p>
 	 * This is a <strong>short circuiting terminal operation</strong>
diff --git a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStreamProvider.java b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStreamProvider.java
index ecd8bf4..b7496a1 100644
--- a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStreamProvider.java
+++ b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStreamProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2015, 2017). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2015, 2018). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -94,25 +94,22 @@
 	 * Create a stream with the default configured buffer, executor size, queue,
 	 * queue policy and pushback policy. This is equivalent to calling
 	 * 
-	 * <code>
-	 *   buildStream(source).create();
-	 * </code>
-	 * 
+	 * <pre>
+	 * buildStream(source).create();
+	 * </pre>
 	 * <p>
-	 * This stream will be buffered from the event producer, and will honour
-	 * back pressure even if the source does not.
-	 * 
+	 * This stream will be buffered from the event producer, and will honor back
+	 * pressure even if the source does not.
 	 * <p>
 	 * Buffered streams are useful for "bursty" event sources which produce a
 	 * number of events close together, then none for some time. These bursts
 	 * can sometimes overwhelm downstream processors. Buffering will not,
 	 * however, protect downstream components from a source which produces
 	 * events faster (on average) than they can be consumed.
-	 * 
 	 * <p>
 	 * Event delivery will not begin until a terminal operation is reached on
-	 * the chain of AsyncStreams. Once a terminal operation is reached the
-	 * stream will be connected to the event source.
+	 * the chain of PushStreams. Once a terminal operation is reached the stream
+	 * will be connected to the event source.
 	 * 
 	 * @param eventSource
 	 * @return A {@link PushStream} with a default initial buffer
@@ -265,15 +262,14 @@
 	/**
 	 * Convert an {@link PushStream} into an {@link PushEventSource}. The first
 	 * call to {@link PushEventSource#open(PushEventConsumer)} will begin event
-	 * processing.
+	 * processing. The {@link PushEventSource} will remain active until the
+	 * backing stream is closed, and permits multiple consumers to
+	 * {@link PushEventSource#open(PushEventConsumer)} it. This is equivalent
+	 * to:
 	 * 
-	 * The {@link PushEventSource} will remain active until the backing stream
-	 * is closed, and permits multiple consumers to
-	 * {@link PushEventSource#open(PushEventConsumer)} it.
-	 * 
-	 * This is equivalent to: <code>
-	 *   buildEventSourceFromStream(stream).create();
-	 * </code>
+	 * <pre>
+	 * buildEventSourceFromStream(stream).create();
+	 * </pre>
 	 * 
 	 * @param stream
 	 * @return a {@link PushEventSource} backed by the {@link PushStream}
@@ -477,12 +473,13 @@
 
 	/**
 	 * Create a {@link SimplePushEventSource} with the supplied type and default
-	 * buffering behaviours. The SimplePushEventSource will respond to back
-	 * pressure requests from the consumers connected to it.
+	 * buffering behaviors. The SimplePushEventSource will respond to back
+	 * pressure requests from the consumers connected to it. This is equivalent
+	 * to:
 	 * 
-	 * This is equivalent to: <code>
-	 *   buildSimpleEventSource(type).create();
-	 * </code>
+	 * <pre>
+	 * buildSimpleEventSource(type).create();
+	 * </pre>
 	 * 
 	 * @param type
 	 * @return a {@link SimplePushEventSource}
@@ -494,13 +491,11 @@
 	}
 	
 	/**
-	 * 
 	 * Build a {@link SimplePushEventSource} with the supplied type and custom
-	 * buffering behaviours. The SimplePushEventSource will respond to back
+	 * buffering behaviors. The SimplePushEventSource will respond to back
 	 * pressure requests from the consumers connected to it.
 	 * 
 	 * @param type
-	 * 
 	 * @return a {@link SimplePushEventSource}
 	 */
 
@@ -570,15 +565,13 @@
 	 * buffer, executor size, queue, queue policy and pushback policy. This is
 	 * equivalent to calling
 	 * 
-	 * <code>
-	 *   buildBufferedConsumer(delegate).create();
-	 * </code>
-	 * 
+	 * <pre>
+	 * buildBufferedConsumer(delegate).create();
+	 * </pre>
 	 * <p>
 	 * The returned consumer will be buffered from the event source, and will
-	 * honour back pressure requests from its delegate even if the event source
+	 * honor back pressure requests from its delegate even if the event source
 	 * does not.
-	 * 
 	 * <p>
 	 * Buffered consumers are useful for "bursty" event sources which produce a
 	 * number of events close together, then none for some time. These bursts
@@ -598,7 +591,7 @@
 	 * Build a buffered {@link PushEventConsumer} with custom configuration.
 	 * <p>
 	 * The returned consumer will be buffered from the event source, and will
-	 * honour back pressure requests from its delegate even if the event source
+	 * honor back pressure requests from its delegate even if the event source
 	 * does not.
 	 * <p>
 	 * Buffered consumers are useful for "bursty" event sources which produce a
diff --git a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/QueuePolicy.java b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/QueuePolicy.java
index cba94b1..09dfe7f 100644
--- a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/QueuePolicy.java
+++ b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/QueuePolicy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2015, 2016). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2015, 2018). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,10 +42,10 @@
 	 * 
 	 * @param queue
 	 * @param event
-	 * @throws Exception If an error ocurred adding the event to the queue. This
-	 *         exception will cause the connection between the
-	 *         {@link PushEventSource} and the {@link PushEventConsumer} to be
-	 *         closed with an {@link EventType#ERROR}
+	 * @throws Exception If an error occurred adding the event to the queue.
+	 *             This exception will cause the connection between the
+	 *             {@link PushEventSource} and the {@link PushEventConsumer} to
+	 *             be closed with an {@link EventType#ERROR}
 	 */
 	public void doOffer(U queue, PushEvent<? extends T> event) throws Exception;
 	
diff --git a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/SimplePushEventSource.java b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/SimplePushEventSource.java
index 314ae08..3a79fa7 100644
--- a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/SimplePushEventSource.java
+++ b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/SimplePushEventSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2015, 2016). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2015, 2017). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/bundles/org.eclipse.equinox.metatype/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.metatype/META-INF/MANIFEST.MF
index aabc493..97f6a22 100644
--- a/bundles/org.eclipse.equinox.metatype/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.metatype/META-INF/MANIFEST.MF
@@ -20,11 +20,11 @@
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Provide-Capability: osgi.implementation;
   osgi.implementation="osgi.metatype";
-  version:Version="1.3";
+  version:Version="1.4";
   uses:="org.osgi.service.metatype",
  osgi.extender;
   osgi.extender="osgi.metatype";
-  version:Version="1.3";
+  version:Version="1.4";
   uses:="org.osgi.service.metatype",
  osgi.service;
   objectClass:List<String>="org.osgi.service.metatype.MetaTypeService";