Difference between revisions of "GxRest/GxJRS"

From Gcube Wiki
Jump to: navigation, search
(Requests)
(Correlation to the JAX-RS runtime)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Scope and Features =
 
= Scope and Features =
gxJRS is much more advanced than gxHTTP and offers fully-fledged extensions built on top of JAX-RS and gxHTTP.
+
gxJRS is much more advanced than [[GxRest/GxHTTP|gxHTTP]] and offers fully-fledged extensions built on top of JAX-RS and gxHTTP.
  
 
Prominent features of gxJRS are:
 
Prominent features of gxJRS are:
Line 12: Line 12:
 
Context-aware [[GxRest/GxJRS/Requests | requests]] sent from a client to a web application.
 
Context-aware [[GxRest/GxJRS/Requests | requests]] sent from a client to a web application.
  
= Requests =
+
= Responses =
* outbound status-aware [[GxRest/GxJRS/Responses#Outbound_Responses | responses]] returned from a web application
+
* Outbound status-aware [[GxRest/GxJRS/Responses#Outbound_Responses | responses]] returned from a web application.
* inbound [[GxRest/GxJRS/Responses#Inbound_Responses | responses]] received by a client.
+
* Inbound [[GxRest/GxJRS/Responses#Inbound_Responses | responses]] received by a client.
 
+
= Correlation with the JAX-RS runtime =
+
The gxJRS approach is independent from the [https://jcp.org/en/jsr/detail?id=311 JAX-RS] implementation used to develop the web application, being entirely based on the <code lang="Java">javax.ws.rs</code> package. However, some features rely on a JAX-RS runtime implementation. It dynamically loads the implementation available on the classpath and uses it for modeling and sending the responses and requests. The reference implementation for JAX-RS is named [http://jersey.java.net/ Jersey], but it is not included in Java SE. You must explicitly add Jersey or another JAR-RS implementation to your classpath.
+
  
At request side, a JAX-RS runtime is not strictly required as one of the requests implementation builds atop of plain HTTP protocol.
+
= Correlation to the JAX-RS runtime =
 +
The gxJRS approach is independent from the [https://jcp.org/en/jsr/detail?id=311 JAX-RS] implementation used to develop the web application, being entirely based on the <code lang="Java">javax.ws.rs</code> package. However, some features rely on a JAX-RS runtime implementation. It dynamically loads the implementation available on the classpath and uses it for modeling and sending the responses and requests. The reference implementation for JAX-RS is [http://jersey.java.net/ Jersey], but it is not included in Java SE. You must explicitly add Jersey or another JAX-RS implementation to your classpath.
  
 
= Distribution =
 
= Distribution =

Latest revision as of 05:09, 4 April 2019

Scope and Features

gxJRS is much more advanced than gxHTTP and offers fully-fledged extensions built on top of JAX-RS and gxHTTP.

Prominent features of gxJRS are:

  • to achieve independence from the web framework used to develop the web application;
  • to guarantee the correctness of requests/responses across the D4Science infrastructure;
  • to abstract over the HTTP-based details required by the gCube framework when invoking a remote service;
  • to avoid that each service implements its own conventions over the returned responses;
  • to return error responses at the familiar (for any Java programmer) level of exceptions and error codes, while web frameworks usually just let return an HTTP status, headers and streams.

Requests

Context-aware requests sent from a client to a web application.

Responses

  • Outbound status-aware responses returned from a web application.
  • Inbound responses received by a client.

Correlation to the JAX-RS runtime

The gxJRS approach is independent from the JAX-RS implementation used to develop the web application, being entirely based on the javax.ws.rs package. However, some features rely on a JAX-RS runtime implementation. It dynamically loads the implementation available on the classpath and uses it for modeling and sending the responses and requests. The reference implementation for JAX-RS is Jersey, but it is not included in Java SE. You must explicitly add Jersey or another JAX-RS implementation to your classpath.

Distribution

gxJRS is available as Maven artifact and can be added to a maven-based project with the following dependency:

<dependency>
	<groupId>org.gcube.common</groupId>
	<artifactId>gxJRS</artifactId>
	<version>LATEST</version>
</dependency>