diff --git a/build.gradle b/build.gradle index 74c393f..d807c24 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ subprojects { def name = project.name def javaVersion = name.endsWith("virtualthreads") ? 20 - : name.endsWith("helidon") || name.endsWith("mutiny") || name.endsWith("test") ? 11 + : name.endsWith("mutiny") || name.endsWith("test") ? 11 : 8 plugins.withType(JavaLibraryPlugin) { diff --git a/gradle.properties b/gradle.properties index 3865694..187a643 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,6 @@ nettyBomVersion=4.1.107.Final grpcStubVersion=1.62.2 reactorBomVersion=2023.0.3 rxjavaVersion=3.1.8 -helidonCommonReactiveVersion=2.5.6 mutinyVersion=2.5.8 jsr305Version=3.0.2 javaxInjectVersion=1 diff --git a/gradle/dependency-management.gradle b/gradle/dependency-management.gradle index 957e59e..225daa1 100644 --- a/gradle/dependency-management.gradle +++ b/gradle/dependency-management.gradle @@ -15,7 +15,6 @@ subprojects { dependencies { dependency "io.grpc:grpc-stub:${grpcStubVersion}" dependency "io.reactivex.rxjava3:rxjava:${rxjavaVersion}" - dependency "io.helidon.common:helidon-common-reactive:${helidonCommonReactiveVersion}" dependency "io.smallrye.reactive:mutiny:${mutinyVersion}" dependency "javax.inject:javax.inject:${javaxInjectVersion}" diff --git a/rsocket-bom/build.gradle b/rsocket-bom/build.gradle index a038080..2d85ec0 100644 --- a/rsocket-bom/build.gradle +++ b/rsocket-bom/build.gradle @@ -23,7 +23,6 @@ dependencies { api "io.grpc:grpc-stub:${grpcStubVersion}" api "io.reactivex.rxjava3:rxjava:${rxjavaVersion}" - api "io.helidon.common:helidon-common-reactive:${helidonCommonReactiveVersion}" api "io.smallrye.reactive:mutiny:${mutinyVersion}" api "com.google.protobuf:protobuf-java:${protobufVersion}" api "com.google.protobuf:protobuf-javalite:${protobufVersion}" @@ -39,7 +38,6 @@ dependencies { api "com.jauntsdn.rsocket:rsocket-rpc-mutiny-compiler:${version}" api "com.jauntsdn.rsocket:rsocket-rpc-reactor-compiler:${version}" api "com.jauntsdn.rsocket:rsocket-rpc-rxjava-compiler:${version}" - api "com.jauntsdn.rsocket:rsocket-rpc-helidon-compiler:${version}" api "com.google.protobuf:protoc:${protobufVersion}" } } diff --git a/rsocket-helidon/build.gradle b/rsocket-helidon/build.gradle deleted file mode 100644 index 880506f..0000000 --- a/rsocket-helidon/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021 - present Maksym Ostroverkhov. - */ - -plugins { - id "java-library" - id "signing" - id "maven-publish" -} - -dependencies { - api project(":rsocket-messages") - api "io.helidon.common:helidon-common-reactive" - - compileOnly "com.google.code.findbugs:jsr305" -} - -description = "RSocket-helidon api library" diff --git a/rsocket-helidon/gradle.lockfile b/rsocket-helidon/gradle.lockfile deleted file mode 100644 index 984632e..0000000 --- a/rsocket-helidon/gradle.lockfile +++ /dev/null @@ -1,18 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -com.google.code.findbugs:jsr305:3.0.2=compileClasspath,googleJavaFormat1.6 -com.google.errorprone:error_prone_annotations:2.0.18=googleJavaFormat1.6 -com.google.errorprone:javac-shaded:9+181-r4173-1=googleJavaFormat1.6 -com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6 -com.google.guava:guava:22.0=googleJavaFormat1.6 -com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6 -io.helidon.common:helidon-common-mapper:2.5.6=compileClasspath,runtimeClasspath -io.helidon.common:helidon-common-reactive:2.5.6=compileClasspath,runtimeClasspath -io.helidon.common:helidon-common-service-loader:2.5.6=compileClasspath,runtimeClasspath -io.helidon.common:helidon-common:2.5.6=compileClasspath,runtimeClasspath -io.netty:netty-buffer:4.1.107.Final=compileClasspath,runtimeClasspath -io.netty:netty-common:4.1.107.Final=compileClasspath,runtimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6 -empty=annotationProcessor diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/AbstractRSocket.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/AbstractRSocket.java deleted file mode 100644 index 6f2a133..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/AbstractRSocket.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2021 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Multi; -import io.helidon.common.reactive.Single; -import java.util.concurrent.Flow; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public abstract class AbstractRSocket implements RSocketHandler { - - @Override - public Single fireAndForget(Message message) { - message.release(); - return Single.error(new UnsupportedOperationException("fire-and-forget not implemented")); - } - - @Override - public Single requestResponse(Message message) { - message.release(); - return Single.error(new UnsupportedOperationException("request-response not implemented")); - } - - @Override - public Multi requestStream(Message message) { - message.release(); - return Multi.error(new UnsupportedOperationException("request-stream not implemented")); - } - - @Override - public Multi requestChannel(Flow.Publisher messages) { - return Multi.error( - new UnsupportedOperationException("request-channel(messages) not implemented")); - } - - @Override - public Multi requestChannel(Message message, Flow.Publisher messages) { - message.release(); - return Multi.error( - new UnsupportedOperationException("request-channel(message, messages) not implemented")); - } - - @Override - public Single metadataPush(Message message) { - message.release(); - return Single.error(new UnsupportedOperationException("metadata-push not implemented")); - } - - @Override - public void dispose() {} - - @Override - public boolean isDisposed() { - return false; - } - - @Override - public Single onClose() { - return Single.never(); - } -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ClientAcceptor.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ClientAcceptor.java deleted file mode 100644 index e823f1d..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ClientAcceptor.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2021 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import java.util.function.Function; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public interface ClientAcceptor { - - RSocket accept(SetupMessage setup, RSocket requesterRSocket); - - @FunctionalInterface - interface Interceptor extends Function {} -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ClientStreamsAcceptor.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ClientStreamsAcceptor.java deleted file mode 100644 index 757dd53..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ClientStreamsAcceptor.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2020 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public interface ClientStreamsAcceptor { - - MessageStreams accept(SetupMessage setup, MessageStreams requester); -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/Closeable.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/Closeable.java deleted file mode 100644 index 1b30fc6..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/Closeable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2021 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Single; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public interface Closeable extends GracefulCloseable { - - Single onClose(); - - void dispose(); - - boolean isDisposed(); - - @Override - default void dispose(String reason, boolean isGraceful) { - dispose(); - } -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/MessageStreams.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/MessageStreams.java deleted file mode 100644 index aa8c5e9..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/MessageStreams.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2020 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Multi; -import io.helidon.common.reactive.Single; -import io.netty.buffer.ByteBufAllocator; -import java.util.Optional; -import java.util.concurrent.Flow; -import java.util.concurrent.ScheduledExecutorService; - -/** - * Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. - * - *

Channel interactions for async exchange of binary messages using Helidon-common-reactive API. - */ -@Deprecated -public interface MessageStreams extends Closeable { - - /** - * Unreliable and unordered 1 to 0 messages exchange interaction. - * - * @return {@link Single} completed successfully as soon as message is scheduled for write if - * channel is connected, or completed with error if channel is disconnected. {@link Single} - * completion does not imply that message was written on wire; messages ordering between - * several fire-and-forget interactions, or fire-and-forget and other interactions is not - * guaranteed. - */ - Single fireAndForget(Message message); - - /** - * 1 to strictly 1 messages exchange interaction. - * - * @return {@link Single} completed successfully with exactly 1 response message, otherwise - * completed with error. - */ - Single requestResponse(Message message); - - /** 1 to N messages flow-controlled exchange interaction. */ - Multi requestStream(Message message); - - /** N to N messages flow-controlled exchange interaction. */ - Multi requestChannel(Flow.Publisher messages); - - default Optional messageFactory() { - return Optional.empty(); - } - - default Optional scheduler() { - return Optional.empty(); - } - - default Optional allocator() { - return Optional.empty(); - } -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/MessageStreamsHandler.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/MessageStreamsHandler.java deleted file mode 100644 index 5246f30..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/MessageStreamsHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Multi; -import java.util.concurrent.Flow; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public interface MessageStreamsHandler extends MessageStreams { - - default Multi requestChannel(Message message, Flow.Publisher messages) { - return requestChannel(messages); - } -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocket.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocket.java deleted file mode 100644 index 58c6cea..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocket.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2021 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Single; -import java.util.Optional; -import java.util.concurrent.ScheduledExecutorService; -import java.util.function.Function; - -/** - * Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. - * - *

Models RSocket interactions as described in - * https://github.com/rsocket/rsocket/blob/master/Protocol.md#stream-sequences-and-lifetimes - */ -@Deprecated -public interface RSocket extends MessageStreams, Availability { - - /** - * Enables metadata exchange between connection endpoints. - * - * @param message containing connection metadata. - */ - Single metadataPush(Message message); - - /** - * @return lightweight {@link ScheduledExecutorService} intended for non-fine-grained tasks - * scheduling (e.g. timeouts). - */ - default Optional coarseScheduler() { - return Optional.empty(); - } - - @Override - default double availability(int rank) { - return isDisposed() ? 0.0 : 1.0; - } - - @Override - default double availability() { - return availability(0); - } - - @FunctionalInterface - interface Interceptor extends Function {} - - static RSocket from(MessageStreams messageStreams) { - if (messageStreams instanceof RSocket) { - return (RSocket) messageStreams; - } - return new RSocketProxy(messageStreams); - } -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocketHandler.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocketHandler.java deleted file mode 100644 index 7f440c8..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocketHandler.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2021 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public interface RSocketHandler extends RSocket, MessageStreamsHandler {} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocketProxy.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocketProxy.java deleted file mode 100644 index 87564af..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/RSocketProxy.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2021 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Multi; -import io.helidon.common.reactive.Single; -import io.netty.buffer.ByteBufAllocator; -import java.util.Optional; -import java.util.concurrent.Flow; -import java.util.concurrent.ScheduledExecutorService; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public class RSocketProxy implements RSocket, RSocketHandler { - protected final MessageStreams source; - - public RSocketProxy(MessageStreams source) { - this.source = source; - } - - @Override - public Single fireAndForget(Message message) { - return source.fireAndForget(message); - } - - @Override - public Single requestResponse(Message message) { - return source.requestResponse(message); - } - - @Override - public Multi requestStream(Message message) { - return source.requestStream(message); - } - - @Override - public Multi requestChannel(Flow.Publisher messages) { - return source.requestChannel(messages); - } - - @Override - public Multi requestChannel(Message message, Flow.Publisher messages) { - MessageStreams s = source; - if (s instanceof MessageStreamsHandler) { - return ((MessageStreamsHandler) s).requestChannel(message, messages); - } - return s.requestChannel(messages); - } - - @Override - public Optional messageFactory() { - return source.messageFactory(); - } - - @Override - public Optional scheduler() { - return source.scheduler(); - } - - @Override - public Optional coarseScheduler() { - MessageStreams s = source; - if (s instanceof RSocket) { - return ((RSocket) s).coarseScheduler(); - } - return Optional.empty(); - } - - @Override - public Optional allocator() { - return source.allocator(); - } - - @Override - public void dispose() { - source.dispose(); - } - - @Override - public void dispose(String reason, boolean isGraceful) { - source.dispose(reason, isGraceful); - } - - @Override - public boolean isDisposed() { - return source.isDisposed(); - } - - @Override - public Single onClose() { - return source.onClose(); - } - - @Override - public Attributes attributes() { - return source.attributes(); - } - - @Override - public Single metadataPush(Message message) { - MessageStreams s = source; - if (s instanceof RSocket) { - return ((RSocket) s).metadataPush(message); - } - message.release(); - return Single.error( - new UnsupportedOperationException( - "metadata-push is not supported by source: " + s.getClass().getName())); - } - - @Override - public double availability(int rank) { - MessageStreams s = source; - if (s instanceof RSocket) { - return ((RSocket) s).availability(rank); - } - return s.isDisposed() ? 0.0 : 1.0; - } -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ServerAcceptor.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ServerAcceptor.java deleted file mode 100644 index 268cc3d..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ServerAcceptor.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2021 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Single; -import java.util.function.Function; - -/** Deprecated for removal since helidon-common-reactive project seems to be inactive/abandoned. */ -@Deprecated -public interface ServerAcceptor { - - Single accept(SetupMessage setup, RSocket requesterRSocket); - - @FunctionalInterface - interface Interceptor extends Function {} -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ServerStreamsAcceptor.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ServerStreamsAcceptor.java deleted file mode 100644 index 9bc2b08..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/ServerStreamsAcceptor.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2020 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Single; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public interface ServerStreamsAcceptor { - - Single accept(SetupMessage setup, MessageStreams requester); -} diff --git a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/package-info.java b/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/package-info.java deleted file mode 100644 index 0205d7e..0000000 --- a/rsocket-helidon/src/main/java/com/jauntsdn/rsocket/package-info.java +++ /dev/null @@ -1,2 +0,0 @@ -@javax.annotation.ParametersAreNonnullByDefault -package com.jauntsdn.rsocket; diff --git a/rsocket-rpc-helidon/README.md b/rsocket-rpc-helidon/README.md deleted file mode 100644 index c78e9c6..0000000 --- a/rsocket-rpc-helidon/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## RPC compiler - -### compiler options - -`metadataless-method-definitions` if present, generated interfaces additionally contain service methods with no metadata parameter, and designate calls with empty metadata. Disabled by default. - -`annotations` designate annotations family of generated stubs: one of `javax` (default), `jakarta`, `none`. \ No newline at end of file diff --git a/rsocket-rpc-helidon/build.gradle b/rsocket-rpc-helidon/build.gradle deleted file mode 100644 index 3e92534..0000000 --- a/rsocket-rpc-helidon/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2020 - present Maksym Ostroverkhov. - */ - -plugins { - id "java-library" - id "signing" - id "maven-publish" -} - -description = "RSocket-rpc-helidon api library" - -dependencies { - api project(":rsocket-helidon") - - compileOnly "com.google.code.findbugs:jsr305" -} \ No newline at end of file diff --git a/rsocket-rpc-helidon/gradle.lockfile b/rsocket-rpc-helidon/gradle.lockfile deleted file mode 100644 index 984632e..0000000 --- a/rsocket-rpc-helidon/gradle.lockfile +++ /dev/null @@ -1,18 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -com.google.code.findbugs:jsr305:3.0.2=compileClasspath,googleJavaFormat1.6 -com.google.errorprone:error_prone_annotations:2.0.18=googleJavaFormat1.6 -com.google.errorprone:javac-shaded:9+181-r4173-1=googleJavaFormat1.6 -com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6 -com.google.guava:guava:22.0=googleJavaFormat1.6 -com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6 -io.helidon.common:helidon-common-mapper:2.5.6=compileClasspath,runtimeClasspath -io.helidon.common:helidon-common-reactive:2.5.6=compileClasspath,runtimeClasspath -io.helidon.common:helidon-common-service-loader:2.5.6=compileClasspath,runtimeClasspath -io.helidon.common:helidon-common:2.5.6=compileClasspath,runtimeClasspath -io.netty:netty-buffer:4.1.107.Final=compileClasspath,runtimeClasspath -io.netty:netty-common:4.1.107.Final=compileClasspath,runtimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6 -empty=annotationProcessor diff --git a/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcHandler.java b/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcHandler.java deleted file mode 100644 index 0ad491a..0000000 --- a/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcHandler.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright 2020 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import com.jauntsdn.rsocket.exceptions.RpcException; -import io.helidon.common.reactive.Multi; -import io.helidon.common.reactive.Single; -import io.netty.buffer.ByteBuf; -import io.netty.util.ReferenceCountUtil; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Flow; -import java.util.function.Consumer; -import javax.annotation.Nullable; - -/** - * Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. - * - *

Utility for serving multiple {@link RpcService} from single {@link MessageStreams} endpoint. - */ -@Deprecated -public final class RpcHandler implements MessageStreamsHandler { - private static final String NO_DEFAULT_ZERO_SERVICES_MESSAGE = - "RpcHandler: no default service because 0 services registered"; - private static final String NO_DEFAULT_MULTIPLE_SERVICES_MESSAGE = - "RpcHandler: no default service because more than 1 service registered"; - - private final Map services; - private final RpcService defaultService; - private final CompletableFuture onClose = new CompletableFuture<>(); - private final Consumer errorConsumer; - - public static RpcHandler create(RpcService... rpcServices) { - return new RpcHandler(null, rpcServices); - } - - public static RpcHandler create(Consumer errorConsumer, RpcService... rpcServices) { - return new RpcHandler(null, rpcServices); - } - - public static Factory create(RpcService.Factory... rpcServices) { - return new Factory(null, rpcServices); - } - - public static Factory create( - Consumer errorConsumer, RpcService.Factory... rpcServices) { - return new Factory(errorConsumer, rpcServices); - } - - RpcHandler(@Nullable Consumer errorConsumer, RpcService... rpcServices) { - this.errorConsumer = errorConsumer; - Objects.requireNonNull(rpcServices, "rpcServices"); - int length = rpcServices.length; - switch (length) { - case 0: - { - services = Collections.emptyMap(); - defaultService = null; - } - break; - case 1: - { - RpcService service = rpcServices[0]; - defaultService = service; - services = Collections.singletonMap(service.service(), service); - break; - } - default: - { - defaultService = null; - Map svcs = services = new HashMap<>(length); - for (RpcService rpcService : rpcServices) { - String service = rpcService.service(); - svcs.put(service, rpcService); - } - } - } - } - - @Override - public Single fireAndForget(Message message) { - try { - String serviceName = service(message.metadata()); - - if (serviceName.isEmpty()) { - int size = services.size(); - switch (size) { - case 0: - message.release(); - return Single.error(new RpcException(NO_DEFAULT_ZERO_SERVICES_MESSAGE)); - case 1: - return defaultService.fireAndForget(message); - default: - message.release(); - return Single.error(new RpcException(NO_DEFAULT_MULTIPLE_SERVICES_MESSAGE)); - } - } - - RpcService rpcService = services.get(serviceName); - if (rpcService == null) { - message.release(); - return Single.error(new RpcException(serviceName)); - } - - return rpcService.fireAndForget(message); - } catch (Throwable t) { - ReferenceCountUtil.safeRelease(message); - return Single.error(t); - } - } - - @Override - public Single requestResponse(Message message) { - try { - String serviceName = service(message.metadata()); - - if (serviceName.isEmpty()) { - int size = services.size(); - switch (size) { - case 0: - message.release(); - return Single.error(new RpcException(NO_DEFAULT_ZERO_SERVICES_MESSAGE)); - case 1: - return defaultService.requestResponse(message); - default: - message.release(); - return Single.error(new RpcException(NO_DEFAULT_MULTIPLE_SERVICES_MESSAGE)); - } - } - - RpcService rpcService = services.get(serviceName); - if (rpcService == null) { - message.release(); - return Single.error(new RpcException(serviceName)); - } - return rpcService.requestResponse(message); - } catch (Throwable t) { - ReferenceCountUtil.safeRelease(message); - return Single.error(t); - } - } - - @Override - public Multi requestStream(Message message) { - try { - String serviceName = service(message.metadata()); - - if (serviceName.isEmpty()) { - int size = services.size(); - switch (size) { - case 0: - message.release(); - return Multi.error(new RpcException(NO_DEFAULT_ZERO_SERVICES_MESSAGE)); - case 1: - return defaultService.requestStream(message); - default: - message.release(); - return Multi.error(new RpcException(NO_DEFAULT_MULTIPLE_SERVICES_MESSAGE)); - } - } - - RpcService rpcService = services.get(serviceName); - if (rpcService == null) { - message.release(); - return Multi.error(new RpcException(serviceName)); - } - - return rpcService.requestStream(message); - } catch (Throwable t) { - ReferenceCountUtil.safeRelease(message); - return Multi.error(t); - } - } - - @Override - public Multi requestChannel(Flow.Publisher messages) { - return Multi.error( - new RpcException("RpcHandler: unsupported method: requestChannel(Publisher)")); - } - - @Override - public Multi requestChannel(Message message, Flow.Publisher messages) { - try { - String serviceName = service(message.metadata()); - - if (serviceName.isEmpty()) { - int size = services.size(); - switch (size) { - case 0: - message.release(); - return Multi.error(new RpcException(NO_DEFAULT_ZERO_SERVICES_MESSAGE)); - case 1: - return defaultService.requestChannel(message, messages); - default: - message.release(); - return Multi.error(new RpcException(NO_DEFAULT_MULTIPLE_SERVICES_MESSAGE)); - } - } - - RpcService rpcService = services.get(serviceName); - if (rpcService == null) { - message.release(); - return Multi.error(new RpcException(serviceName)); - } - - return rpcService.requestChannel(message, messages); - } catch (Throwable t) { - ReferenceCountUtil.safeRelease(message); - return Multi.error(t); - } - } - - @Override - public void dispose() { - Map svcs = services; - if (svcs.isEmpty()) { - onClose.complete(null); - return; - } - svcs.forEach( - (serviceName, rpcService) -> { - try { - rpcService.dispose(); - } catch (Throwable t) { - if (t instanceof Error) { - throw t; - } - Consumer c = errorConsumer; - if (c != null) { - c.accept(new RpcException("RPC service " + serviceName + " dispose error", t)); - } - } - }); - onClose.complete(null); - } - - @Override - public boolean isDisposed() { - return onClose.isDone(); - } - - @Override - public Single onClose() { - return Single.create(onClose, true); - } - - static String service(ByteBuf metadata) { - long header = Rpc.RpcMetadata.header(metadata); - int flags = Rpc.RpcMetadata.flags(header); - return Rpc.RpcMetadata.service(metadata, header, flags); - } - - public static final class Factory implements RpcService.Factory { - private final Consumer errorConsumer; - private final RpcService.Factory[] serviceFactories; - - Factory( - @Nullable Consumer errorConsumer, RpcService.Factory... serviceFactories) { - this.errorConsumer = errorConsumer; - this.serviceFactories = Objects.requireNonNull(serviceFactories, "serviceFactories"); - } - - @Override - public RpcHandler withLifecycle(Closeable requester) { - RpcService.Factory[] factories = serviceFactories; - RpcService[] services = new RpcService[factories.length]; - for (int i = 0; i < factories.length; i++) { - RpcService.Factory factory = factories[i]; - MessageStreamsHandler handler = factory.withLifecycle(requester); - if (handler instanceof RpcService) { - services[i] = (RpcService) handler; - } else { - throw new IllegalArgumentException( - "RpcService.Factory " - + factory.getClass() - + " created non - RpcService: " - + handler.getClass()); - } - } - return new RpcHandler(errorConsumer, services); - } - } -} diff --git a/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcInstrumentation.java b/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcInstrumentation.java deleted file mode 100644 index df2fdf7..0000000 --- a/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcInstrumentation.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2020 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -import io.helidon.common.reactive.Single; -import java.util.concurrent.Flow; -import java.util.function.Function; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public interface RpcInstrumentation { - - Function, ? extends Flow.Publisher> instrumentMulti( - String role, String service, String method, boolean isStream); - - Function, ? extends Single> instrumentSingle( - String role, String service, String method); -} diff --git a/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcService.java b/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcService.java deleted file mode 100644 index fb24db8..0000000 --- a/rsocket-rpc-helidon/src/main/java/com/jauntsdn/rsocket/RpcService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2020 - present Maksym Ostroverkhov. - * - * Licensed 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 com.jauntsdn.rsocket; - -/** Deprecated for removal since helidon-common-reactive project seems inactive/abandoned. */ -@Deprecated -public interface RpcService extends MessageStreamsHandler { - - String service(); - - Class serviceType(); - - interface Factory { - - T withLifecycle(Closeable requester); - } -} diff --git a/settings.gradle b/settings.gradle index e7e0bbb..443047a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -23,8 +23,6 @@ include "rsocket-mutiny" include "rsocket-rpc-mutiny" include "rsocket-grpc" include "rsocket-rpc-grpc" -include "rsocket-helidon" -include "rsocket-rpc-helidon" include "rsocket-futures" include "rsocket-rpc-futures" if (includeVirtualThreads()) {