Skip to content

Commit

Permalink
Moves helidon-microprofile-grpc-api to helidon-grpc-api in order to s…
Browse files Browse the repository at this point in the history
…hare annoations and types with future declarative SE API.

Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
  • Loading branch information
spericas committed Jul 18, 2024
1 parent 4c819ed commit 803445c
Show file tree
Hide file tree
Showing 43 changed files with 140 additions and 182 deletions.
8 changes: 4 additions & 4 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,6 @@
<groupId>io.helidon.microprofile.service-common</groupId>
<artifactId>helidon-microprofile-service-common</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.grpc</groupId>
<artifactId>helidon-microprofile-grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.grpc</groupId>
<artifactId>helidon-microprofile-grpc-core</artifactId>
Expand Down Expand Up @@ -525,6 +521,10 @@
<groupId>io.helidon.tracing</groupId>
<artifactId>helidon-tracing-jersey</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.grpc</groupId>
<artifactId>helidon-grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.grpc</groupId>
<artifactId>helidon-grpc-core</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.grpc</groupId>
<artifactId>helidon-microprofile-grpc-api</artifactId>
<groupId>io.helidon.grpc</groupId>
<artifactId>helidon-grpc-api</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
Expand Down
23 changes: 9 additions & 14 deletions microprofile/grpc/api/pom.xml → grpc/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,23 @@
limitations under the License.
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.helidon.microprofile.grpc</groupId>
<artifactId>helidon-microprofile-grpc-project</artifactId>
<artifactId>helidon-grpc-project</artifactId>
<groupId>io.helidon.grpc</groupId>
<version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>helidon-microprofile-grpc-api</artifactId>
<name>Helidon Microprofile gRPC Api</name>
<artifactId>helidon-grpc-api</artifactId>
<name>Helidon gRPC API</name>

<dependencies>
<dependency>
<groupId>io.helidon.grpc</groupId>
<artifactId>helidon-grpc-core</artifactId>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>provided</scope>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand All @@ -26,8 +26,7 @@
import io.grpc.MethodDescriptor.MethodType;

/**
* An annotation to mark a class as representing a
* bi-directional streaming gRPC method.
* An annotation to mark a class as representing a bi-directional streaming gRPC method.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
Expand All @@ -40,7 +39,7 @@
* <p>
* If not set the name of the actual annotated method is used.
*
* @return name of the method
* @return name of the method
*/
String value() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand All @@ -39,7 +39,7 @@
* <p>
* If not set the name of the actual annotated method is used.
*
* @return name of the method
* @return name of the method
*/
String value() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand All @@ -23,12 +23,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.inject.Qualifier;

/**
* An annotation used to mark a class as representing a gRPC service.
*/
@Qualifier
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
Expand All @@ -37,14 +34,14 @@
/**
* Obtain the service name.
*
* @return the service name
* @return the service name
*/
String value() default "";

/**
* Obtain the service version.
*
* @return the service version
* @return the service version
*/
int version() default 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.io.Serial;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import jakarta.enterprise.util.AnnotationLiteral;
import jakarta.inject.Qualifier;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

Expand Down Expand Up @@ -57,23 +53,8 @@
* It is required when a {@linkplain GrpcInterceptorBinding interceptor binding}
* is used.</p>
*/
@Qualifier
@Retention(RUNTIME)
@Target(TYPE)
@Documented
public @interface GrpcInterceptor {

/**
* An {@link AnnotationLiteral} for the {@link GrpcInterceptor} annotation.
*/
class Literal extends AnnotationLiteral<GrpcInterceptor> implements GrpcInterceptor {

@Serial
private static final long serialVersionUID = 1L;

/**
* The singleton instance of {@link GrpcInterceptor.Literal}.
*/
public static final Literal INSTANCE = new Literal();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
Expand All @@ -26,14 +26,6 @@
/**
* Specifies that an annotation type is a gRPC interceptor binding type. A gRPC Interceptor binding is
* used to specify the binding of a gRPC client or server interceptor to target gRPC service and methods.
* <p>
* The annotation type that is marked as a binding must be applied to a client of server gRPC interceptor
* implementation class (marked with the {@code jakarta.interceptor.Interceptor @Interceptor} annotation to associate that annotation with an interceptor. The annotation
* may then be applied instead of, or in addition to, the {@code jakarta.interceptor.Interceptors @Interceptors} annotation to specify
* what interceptors are attached to the class or method.
* <p>
* The associated annotation type must be associated only with {@link java.lang.annotation.ElementType#TYPE TYPE}s and/or
* {@link java.lang.annotation.ElementType#METHOD METHOD}s.
*/
@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand All @@ -22,8 +22,6 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import io.helidon.grpc.core.MarshallerSupplier;

/**
* An annotation used to annotate a type or method to specify the
* named marshaller supplier to use for rpc method calls.
Expand All @@ -33,9 +31,20 @@
@Documented
@Inherited
public @interface GrpcMarshaller {

/**
* The name of the Protocol Buffer marshaller supplier.
*/
String PROTO = "proto";

/**
* The name to use to specify the default marshaller supplier.
*/
String DEFAULT = "default";

/**
* Obtain the type of the {@link MarshallerSupplier} to use.
* @return the type of the {@link MarshallerSupplier} to use
* Obtain the type of the {@code MarshallerSupplier} to use.
* @return the type of the {@code MarshallerSupplier} to use
*/
String value() default MarshallerSupplier.DEFAULT;
String value() default DEFAULT;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
*/

/**
* API gRPC microprofile classes.
* Helidon gRPC API module.
*/
package io.helidon.microprofile.grpc.api;
package io.helidon.grpc.api;
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module io.helidon.grpc.api {

module io.helidon.microprofile.grpc.api {
requires transitive io.grpc;

requires io.helidon.grpc.core;
requires jakarta.inject;
requires jakarta.cdi;

exports io.helidon.microprofile.grpc.api;
exports io.helidon.grpc.api;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
@FunctionalInterface
public interface MarshallerSupplier {

/**
* The name of the Protocol Buffer marshaller supplier.
*/
String PROTO = "proto";

/**
* The name to use to specify the default marshaller supplier.
*/
String DEFAULT = "default";

/**
* Obtain a {@link MethodDescriptor.Marshaller} for a type.
*
Expand Down
1 change: 1 addition & 0 deletions grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<description>gRPC support for Helidon</description>

<modules>
<module>api</module>
<module>core</module>
</modules>

Expand Down
8 changes: 4 additions & 4 deletions microprofile/grpc/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
<name>Helidon Microprofile gRPC Core</name>

<dependencies>
<dependency>
<groupId>io.helidon.grpc</groupId>
<artifactId>helidon-grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.grpc</groupId>
<artifactId>helidon-grpc-core</artifactId>
Expand All @@ -37,10 +41,6 @@
<groupId>io.helidon.common</groupId>
<artifactId>helidon-common</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.grpc</groupId>
<artifactId>helidon-microprofile-grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.config</groupId>
<artifactId>helidon-microprofile-config</artifactId>
Expand Down
Loading

0 comments on commit 803445c

Please sign in to comment.