Extension ID
com.castsoftware.grpcjava
What's new?
Please see gRPC-java - 1.0 - Release Notes for more information.
Description
This extension provides support for gRPC when used inside java source code.
In what situation should you install this extension?
If your JEE application source code uses the gRPC framework you should install this extension.
Features
Object structure and links
- Creates gRPC service method objects which represent entry-points to the server.
- Creates calls to gRPC service method objects which represent exit-points from the client.
- The dependent Web Services Linker is responsible for detecting and creating links between matching calls to gRPC Method objects and the gRPC Method objects.
Support
Server side
When a class inherits from FooServiceGrpc.FooServiceImplBase, for any overiden method FooMethod
the analyzer creates a gRPC Method object named FooService.FooMethod
. For instance when analyzing the following source code, the extension creates a Greeter.sayHello gRPC Method and a callLink to the Java Method sayHello
.
public class GreeterService extends GreeterGrpc.GreeterImplBase { @Override public void sayHello(GreeterOuterClass.HelloRequest request, StreamObserver<GreeterOuterClass.HelloReply> responseObserver) { String message = "Hello " + request.getName(); log.info("Returning " +message); } }
Client side
The gRPC frameworks provide stubs for the client side. A gRPC call can be carried out from that stub. When analyzing the following source code, this extension will generate a call to gRPC Method object name Greeter.sayHello
.
import io.grpc.examples.GreeterGrpc; public class DemoAPpTest { private static final GreeterGrpc.GreeterStub stub = GreeterGrpc.newStub(channel); protected void init(VaadinRequest vaadinRequest) { try { stub.sayHello(GreeterOuterClass.HelloRequest.newBuilder().setName("name").build()); } catch (StatusRuntimeException e) { }
Web Services Linker is then responsible for linking that call to gRPC Method to any matching gRPC service method.
Function Point, Quality and Sizing support
- Function Points (transactions): a green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
- Quality and Sizing: no Quality Rules are implemented for gRPC-java
Function Points | Quality and Sizing |
---|---|
CAST AIP release | Supported |
---|---|
8.3.x |
Supported DBMS servers
This extension is compatible with the following DBMS servers:
CSS/PostgreSQL | Oracle | Microsoft |
---|---|---|
Prerequisites
An installation of any compatible release of CAST AIP (see table above) |
In order to develop an app which uses gRPC one needs to go through the following steps: Our analyzers rely on the naming convention which is used by gRPC for generating the source code based on the *.proto files. Our analyzers do not need the *.proto file nor the generated source code.What source code is needed by our analyzer?
Dependencies with other extensions
Some CAST extensions require the presence of other CAST extensions in order to function correctly. The extension requires that the following other CAST extensions are also installed:
- JEE Analyzer
- Web Services Linker
- com.castsoftware.internal.platform (Internal Extension)
Note that:
- when using AIP Console or CAST Extension Downloader to download the extension and AIP Console or the Manage Extensions interface in CAST Server Manager to install the extension, any dependent extensions are automatically downloaded and installed for you. You do not need to do anything.
- the JEE Analyzer is not a dependency, but since this extension is always installed with AIP, you do not need to do anything.
Download and installation instructions
Please see:
The latest release status of this extension can be seen when downloading it from the CAST Extend server.
What results can you expect?
Objects
The following objects are displayed in CAST Enlighten:
Icon | Description |
---|---|
Java gRPC Service Method | |
call to gRPC Service Method |
Current known limitations
- Only the files which contain an import containing at least one "grpc" string are currently analyzed with this extension.
Multi-line method call are not supported for the creation of calls to gRPC service method. No call to gRPC service can be created from the following code
stub .foo()