diff options
author | Thomas Watson | 2018-02-19 14:19:52 +0000 |
---|---|---|
committer | Thomas Watson | 2018-02-19 14:43:48 +0000 |
commit | 7235e16f69bd5d6a0ba144c4e6d9cc27ea13ab37 (patch) | |
tree | 9460d503f9f713980efa1b426e6bbddb51017041 | |
parent | d183dd36ee677fe75b8eb4de48a17aee20d6fe81 (diff) | |
download | rt.equinox.bundles-7235e16f69bd5d6a0ba144c4e6d9cc27ea13ab37.tar.gz rt.equinox.bundles-7235e16f69bd5d6a0ba144c4e6d9cc27ea13ab37.tar.xz rt.equinox.bundles-7235e16f69bd5d6a0ba144c4e6d9cc27ea13ab37.zip |
Bug 531344 - [osgi R7] Update APIs for R7I20180219-2000
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>
9 files changed, 67 insertions, 72 deletions
diff --git a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF index bec08df2d..3adc53e50 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 @@ Bundle-Activator: org.eclipse.equinox.internal.event.Activator 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 @@ Bundle-ActivationPolicy: lazy 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 cf16c2125..91a56c6ea 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 @@ abstract class AbstractPushStreamImpl<T> implements PushStream<T> { @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 574d65590..1354dfe5b 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 @@ public abstract class PushEvent<T> { * @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 @@ public abstract class PushEvent<T> { * @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 @@ public abstract class PushEvent<T> { * @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 @@ public abstract class PushEvent<T> { } @Override - public T getData() throws IllegalStateException { + public T getData() { return data; } @@ -176,7 +176,7 @@ public abstract class PushEvent<T> { } @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 43de152ae..82d740bde 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 @@ public interface PushEventConsumer<T> { * @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 071c9ec7d..2f11d105d 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 @@ public interface PushStream<T> extends AutoCloseable { * {@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 @@ public interface PushStream<T> extends AutoCloseable { * @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 @@ public interface PushStream<T> extends AutoCloseable { * the delay is < 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 @@ public interface PushStream<T> extends AutoCloseable { /** * 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 @@ public interface PushStream<T> extends AutoCloseable { * 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 @@ public interface PushStream<T> extends AutoCloseable { * * @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 @@ public interface PushStream<T> extends AutoCloseable { /** * 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 ecd8bf4c4..b7496a195 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 @@ public final class PushStreamProvider { * 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 @@ public final class PushStreamProvider { /** * Convert an {@link PushStream} into an {@link PushEventSource}. The first * call to {@link PushEventSource#open(PushEventConsumer)} will begin event - * processing. - * - * The {@link PushEventSource} will remain active until the backing stream - * is closed, and permits multiple consumers to - * {@link PushEventSource#open(PushEventConsumer)} it. + * 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: * - * 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 @@ public final class PushStreamProvider { /** * 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 @@ public final class PushStreamProvider { } /** - * * 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 @@ public final class PushStreamProvider { * 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 @@ public final class PushStreamProvider { * 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 cba94b16c..09dfe7fb0 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 @@ public interface QueuePolicy<T, U extends BlockingQueue<PushEvent<? extends T>>> * * @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 314ae0830..3a79fa76f 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 aabc49375..97f6a223e 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-Localization: plugin 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"; |