diff --git a/client/src/main/java/org/glassfish/tyrus/client/ClientManager.java b/client/src/main/java/org/glassfish/tyrus/client/ClientManager.java index fd68e9e2..151aa248 100755 --- a/client/src/main/java/org/glassfish/tyrus/client/ClientManager.java +++ b/client/src/main/java/org/glassfish/tyrus/client/ClientManager.java @@ -290,31 +290,52 @@ public boolean evaluate() { } @Override - public Session connectToServer(Class annotatedEndpointClass, URI path) throws DeploymentException, IOException { + public Session connectToServer(final Class annotatedEndpointClass, final URI path) throws DeploymentException, IOException { if (annotatedEndpointClass.getAnnotation(ClientEndpoint.class) == null) { throw new DeploymentException( String.format( "Class argument in connectToServer(Class, URI) is to be annotated endpoint class. Class " + "%s does not have @ClientEndpoint", annotatedEndpointClass.getName())); } - return tryCatchInterruptedExecutionEx(() -> connectToServer(annotatedEndpointClass, null, path.toString(), true)); + return tryCatchInterruptedExecutionEx(new SupplierWithEx, DeploymentException>() { + @Override + public Future get() throws DeploymentException { + return connectToServer(annotatedEndpointClass, null, path.toString(), true); + } + }); } @Override - public Session connectToServer(Class endpointClass, ClientEndpointConfig cec, URI path) throws - DeploymentException, IOException { - return tryCatchInterruptedExecutionEx(() -> connectToServer(endpointClass, cec, path.toString(), true)); + public Session connectToServer(final Class endpointClass, + final ClientEndpointConfig cec, + final URI path) throws DeploymentException, IOException { + return tryCatchInterruptedExecutionEx(new SupplierWithEx, DeploymentException>() { + @Override + public Future get() throws DeploymentException { + return connectToServer(endpointClass, cec, path.toString(), true); + } + }); } @Override - public Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws + public Session connectToServer(final Endpoint endpointInstance, final ClientEndpointConfig cec, final URI path) throws DeploymentException, IOException { - return tryCatchInterruptedExecutionEx(() -> connectToServer(endpointInstance, cec, path.toString(), true)); + return tryCatchInterruptedExecutionEx(new SupplierWithEx, DeploymentException>() { + @Override + public Future get() throws DeploymentException { + return connectToServer(endpointInstance, cec, path.toString(), true); + } + }); } @Override - public Session connectToServer(Object obj, URI path) throws DeploymentException, IOException { - return tryCatchInterruptedExecutionEx(() -> connectToServer(obj, null, path.toString(), true)); + public Session connectToServer(final Object obj, final URI path) throws DeploymentException, IOException { + return tryCatchInterruptedExecutionEx(new SupplierWithEx, DeploymentException>() { + @Override + public Future get() throws DeploymentException { + return connectToServer(obj, null, path.toString(), true); + } + }); } private Session tryCatchInterruptedExecutionEx(SupplierWithEx, DeploymentException> supplier) diff --git a/core/src/main/java/org/glassfish/tyrus/core/AnnotatedEndpoint.java b/core/src/main/java/org/glassfish/tyrus/core/AnnotatedEndpoint.java index 87f14aa3..eee3975e 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/AnnotatedEndpoint.java +++ b/core/src/main/java/org/glassfish/tyrus/core/AnnotatedEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -95,7 +95,7 @@ public static AnnotatedEndpoint fromClass(Class annotatedClass, ComponentProv boolean isServerEndpoint, int incomingBufferSize, ErrorCollector collector, EndpointEventListener endpointEventListener) { return fromClass(annotatedClass, componentProvider, isServerEndpoint, incomingBufferSize, collector, - endpointEventListener, Collections.emptySet()); + endpointEventListener, (Set) (Set) Collections.emptySet()); } /** @@ -132,7 +132,7 @@ public static AnnotatedEndpoint fromInstance( Object annotatedInstance, ComponentProviderService componentProvider, boolean isServerEndpoint, int incomingBufferSize, ErrorCollector collector) { return fromInstance(annotatedInstance, componentProvider, isServerEndpoint, incomingBufferSize, - collector, Collections.emptySet()); + collector, (Set) (Set) Collections.emptySet()); } /** diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfigurator.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfigurator.java index dbe69d7d..dc30b8d5 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfigurator.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusServerEndpointConfigurator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -28,6 +28,7 @@ import jakarta.websocket.server.ServerEndpointConfig; import org.glassfish.tyrus.core.collection.LazyValue; +import org.glassfish.tyrus.core.collection.Value; import org.glassfish.tyrus.core.collection.Values; import org.glassfish.tyrus.core.extension.ExtendedExtension; import org.glassfish.tyrus.core.frame.Frame; @@ -42,7 +43,12 @@ public class TyrusServerEndpointConfigurator extends ServerEndpointConfig.Config private LazyValue componentProviderService; public TyrusServerEndpointConfigurator() { - this.componentProviderService = Values.lazy(() -> ComponentProviderService.create()); + this.componentProviderService = Values.lazy(new Value() { + @Override + public ComponentProviderService get() { + return ComponentProviderService.create(); + } + }); } @Override diff --git a/ext/client-java8/pom.xml b/ext/client-java8/pom.xml index 4aab416b..a188e4e3 100644 --- a/ext/client-java8/pom.xml +++ b/ext/client-java8/pom.xml @@ -77,6 +77,13 @@ true + + maven-compiler-plugin + + 1.8 + 1.8 + + diff --git a/tests/release-test/pom.xml b/tests/release-test/pom.xml index 9fa55b5e..d7f1a023 100644 --- a/tests/release-test/pom.xml +++ b/tests/release-test/pom.xml @@ -57,6 +57,13 @@ + + maven-compiler-plugin + + 1.8 + 1.8 + + diff --git a/tests/tools/pom.xml b/tests/tools/pom.xml index bc45bdaf..72d9e037 100755 --- a/tests/tools/pom.xml +++ b/tests/tools/pom.xml @@ -43,6 +43,13 @@ true + + maven-compiler-plugin + + 1.8 + 1.8 + +