Interface | Description |
---|---|
BindableService |
Provides a way to bind instance of service implementation to server.
|
CallCredentials |
Carries credential data that will be propagated to the server via request metadata for each RPC.
|
CallCredentials.MetadataApplier | Deprecated |
ClientInterceptor |
Interface for intercepting outgoing calls before they are dispatched by a
Channel . |
Codec |
Encloses classes related to the compression and decompression of messages.
|
Compressor |
Represents a message compressor.
|
Decompressor |
Represents a message decompressor.
|
Drainable |
Extension to an
InputStream or alike by adding a method that transfers all
content to an OutputStream . |
InternalInstrumented<T> |
An internal class.
|
InternalMetadata.TrustedAsciiMarshaller<T> |
A specialized plain ASCII marshaller.
|
InternalNotifyOnServerBuild |
Provides a callback method for a service to receive a reference to its server.
|
InternalServiceProviders.PriorityAccessor<T> | |
InternalWithLogId |
An internal class.
|
KnownLength |
An
InputStream or alike whose total number of bytes that can be read is known
upfront. |
Metadata.AsciiMarshaller<T> |
Marshaller for metadata values that are serialized into ASCII strings.
|
Metadata.BinaryMarshaller<T> |
Marshaller for metadata values that are serialized into raw binary.
|
MethodDescriptor.Marshaller<T> |
A typed abstraction over message serialization and deserialization, a.k.a.
|
MethodDescriptor.PrototypeMarshaller<T> |
A marshaller that uses a fixed instance of the type it produces.
|
MethodDescriptor.ReflectableMarshaller<T> |
A marshaller that supports retrieving it's type parameter
T at runtime. |
NameResolver.Listener |
Receives address updates.
|
ServerCallHandler<RequestT,ResponseT> |
Interface to initiate processing of incoming remote calls.
|
ServerInterceptor |
Interface for intercepting incoming calls before that are dispatched by
ServerCallHandler . |
Class | Description |
---|---|
Attributes |
An immutable type-safe container of attributes.
|
Attributes.Builder |
The helper class to build an Attributes instance.
|
Attributes.Key<T> |
Key for an key-value pair.
|
BinaryLog |
A binary log that can be installed on a channel or server.
|
CallCredentials.RequestInfo |
The request-related information passed to
CallCredentials2.applyRequestMetadata() . |
CallCredentials2 |
The new interface for
CallCredentials . |
CallCredentials2.MetadataApplier | |
CallOptions |
The collection of runtime options for a new RPC call.
|
CallOptions.Key<T> |
Key for a key-value pair.
|
Channel |
A virtual connection to a conceptual endpoint, to perform RPCs.
|
ClientCall<ReqT,RespT> |
An instance of a call to a remote method.
|
ClientCall.Listener<T> |
Callbacks for receiving metadata, response messages and completion status from the server.
|
ClientInterceptors |
Utility methods for working with
ClientInterceptor s. |
ClientInterceptors.CheckedForwardingClientCall<ReqT,RespT> |
A
ForwardingClientCall that delivers exceptions from its start logic to the
call listener. |
ClientStreamTracer |
StreamTracer for the client-side. |
ClientStreamTracer.Factory |
Factory class for
ClientStreamTracer . |
Codec.Gzip |
A gzip compressor and decompressor.
|
Codec.Identity |
The "identity", or "none" codec.
|
CompressorRegistry |
Encloses classes related to the compression and decompression of messages.
|
ConnectivityStateInfo |
A tuple of a
ConnectivityState and its associated Status . |
Contexts |
Utility methods for working with
Context s in GRPC. |
DecompressorRegistry |
Encloses classes related to the compression and decompression of messages.
|
EquivalentAddressGroup |
A group of
SocketAddress es that are considered equivalent when channel makes connections. |
ForwardingChannelBuilder<T extends ForwardingChannelBuilder<T>> |
A
ManagedChannelBuilder that delegates all its builder method to another builder by
default. |
ForwardingClientCall<ReqT,RespT> |
A
ClientCall which forwards all of it's methods to another ClientCall . |
ForwardingClientCall.SimpleForwardingClientCall<ReqT,RespT> |
A simplified version of
ForwardingClientCall where subclasses can pass in a ClientCall as the delegate. |
ForwardingClientCallListener<RespT> |
A
ClientCall.Listener which forwards all of its methods to another ClientCall.Listener . |
ForwardingClientCallListener.SimpleForwardingClientCallListener<RespT> |
A simplified version of
ForwardingClientCallListener where subclasses can pass in a
ClientCall.Listener as the delegate. |
ForwardingServerCall<ReqT,RespT> |
A
ServerCall which forwards all of it's methods to another ServerCall . |
ForwardingServerCall.SimpleForwardingServerCall<ReqT,RespT> |
A simplified version of
ForwardingServerCall where subclasses can pass in a ServerCall as the delegate. |
ForwardingServerCallListener<ReqT> |
A
ServerCall.Listener which forwards all of its methods to another ServerCall.Listener of matching parameterized types. |
ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT> |
A simplified version of
ForwardingServerCallListener where subclasses can pass in a
ServerCall.Listener as the delegate. |
Grpc |
Stuff that are part of the public API but are not bound to particular classes, e.g., static
methods, constants, attribute and context keys.
|
HandlerRegistry |
Registry of services and their methods used by servers to dispatching incoming calls.
|
InternalChannelz |
This is an internal API.
|
InternalChannelz.ChannelStats |
A data class to represent a channel's stats.
|
InternalChannelz.ChannelStats.Builder | |
InternalChannelz.ChannelTrace | |
InternalChannelz.ChannelTrace.Builder | |
InternalChannelz.ChannelTrace.Event | |
InternalChannelz.ChannelTrace.Event.Builder | |
InternalChannelz.OtherSecurity | |
InternalChannelz.RootChannelList | |
InternalChannelz.Security | |
InternalChannelz.ServerList | |
InternalChannelz.ServerSocketsList | |
InternalChannelz.ServerStats | |
InternalChannelz.ServerStats.Builder | |
InternalChannelz.SocketOptions | |
InternalChannelz.SocketOptions.Builder | |
InternalChannelz.SocketStats | |
InternalChannelz.TcpInfo | |
InternalChannelz.TcpInfo.Builder | |
InternalChannelz.Tls | |
InternalChannelz.TransportStats |
A data class to represent transport stats.
|
InternalClientInterceptors |
Internal accessor.
|
InternalDecompressorRegistry |
Private accessor for decompressor registries.
|
InternalLogId |
An internal class.
|
InternalManagedChannelProvider | |
InternalMetadata |
Internal
Metadata accessor. |
InternalMethodDescriptor |
Accesses internal data and methods.
|
InternalServerInterceptors |
Accessor to internal methods of
ServerInterceptors . |
InternalServiceProviders | |
InternalStatus |
Accesses internal data.
|
LoadBalancer |
A pluggable component that receives resolved addresses from
NameResolver and provides the
channel a usable subchannel when asked. |
LoadBalancer.Factory |
Factory to create
LoadBalancer instance. |
LoadBalancer.Helper |
Provides essentials for LoadBalancer implementations.
|
LoadBalancer.PickResult |
A balancing decision made by
SubchannelPicker for an RPC. |
LoadBalancer.PickSubchannelArgs |
Provides arguments for a
LoadBalancer.SubchannelPicker.pickSubchannel(
LoadBalancer.PickSubchannelArgs) . |
LoadBalancer.Subchannel |
A logical connection to a server, or a group of equivalent servers represented by an
EquivalentAddressGroup . |
LoadBalancer.SubchannelPicker |
The main balancing logic.
|
ManagedChannel |
A
Channel that provides lifecycle management. |
ManagedChannelBuilder<T extends ManagedChannelBuilder<T>> |
A builder for
ManagedChannel instances. |
ManagedChannelProvider |
Provider of managed channels for transport agnostic consumption.
|
Metadata |
Provides access to read and write metadata values to be exchanged during a call.
|
Metadata.Key<T> |
Key for metadata entries.
|
MethodDescriptor<ReqT,RespT> |
Description of a remote method used by
Channel to initiate a call. |
MethodDescriptor.Builder<ReqT,RespT> |
A builder for a
MethodDescriptor . |
NameResolver |
A pluggable component that resolves a target
URI and return addresses to the caller. |
NameResolver.Factory |
Factory that creates
NameResolver instances. |
NameResolverProvider |
Provider of name resolvers for name agnostic consumption.
|
PickFirstBalancerFactory |
A
LoadBalancer that provides no load balancing mechanism over the
addresses from the NameResolver . |
Server |
Server for listening for and dispatching incoming calls.
|
ServerBuilder<T extends ServerBuilder<T>> |
A builder for
Server instances. |
ServerCall<ReqT,RespT> |
Encapsulates a single call received from a remote client.
|
ServerCall.Listener<ReqT> |
Callbacks for consuming incoming RPC messages.
|
ServerInterceptors |
Utility methods for working with
ServerInterceptor s. |
ServerMethodDefinition<ReqT,RespT> |
Definition of a method exposed by a
Server . |
ServerProvider |
Provider of servers for transport agnostic consumption.
|
ServerServiceDefinition |
Definition of a service to be exposed via a Server.
|
ServerServiceDefinition.Builder |
Builder for constructing Service instances.
|
ServerStreamTracer |
Listens to events on a stream to collect metrics.
|
ServerStreamTracer.Factory | |
ServerStreamTracer.ServerCallInfo<ReqT,RespT> |
A data class with info about the started
ServerCall . |
ServerTransportFilter |
Listens on server transport life-cycle events, with the capability to read and/or change
transport attributes.
|
ServiceDescriptor |
Descriptor for a service.
|
ServiceDescriptor.Builder |
A builder for a
ServiceDescriptor . |
Status |
Defines the status of an operation by providing a standard
Status.Code in conjunction with an
optional descriptive message. |
StreamTracer |
Listens to events on a stream to collect metrics.
|
Enum | Description |
---|---|
ConnectivityState |
The connectivity states.
|
InternalChannelz.ChannelTrace.Event.Severity | |
InternalKnownTransport |
All known transports.
|
MethodDescriptor.MethodType |
The call type of a method.
|
SecurityLevel |
The level of security guarantee in communications.
|
Status.Code |
The set of canonical status codes.
|
Exception | Description |
---|---|
ManagedChannelProvider.ProviderNotFoundException |
Thrown when no suitable
ManagedChannelProvider objects can be found. |
StatusException |
Status in Exception form, for propagating Status information via exceptions. |
StatusRuntimeException |
Status in RuntimeException form, for propagating Status information via exceptions. |
Annotation Type | Description |
---|---|
EquivalentAddressGroup.Attr |
Annotation for
EquivalentAddressGroup 's attributes. |
ExperimentalApi |
Indicates a public API that can change at any time, and has no guarantee of API stability and
backward-compatibility.
|
Grpc.TransportAttr |
Annotation for transport attributes.
|
Internal |
Annotates a program element (class, method, package, etc) which is internal to gRPC, not part of
the public API, and should not be used by users of gRPC.
|
NameResolver.ResolutionResultAttr |
Annotation for name resolution result attributes.
|
gRPC is based on a client-server model of remote procedure calls. A client creates a channel which is connected to a server. RPCs are initiated from the client and sent to the server which then responds back to the client. When the client and server are done sending messages, they half close their respective connections. The RPC is complete as soon as the server closes.
To send an RPC, first create a Channel
using ManagedChannelBuilder.forTarget(java.lang.String)
. When using auto generate Protobuf stubs, the stub class
will have constructors for wrapping the channel. These include newBlockingStub
, newStub
, and newFutureStub
which you can use based on your design. The stub is the
primary way a client interacts with a server.
To receive RPCs, create a Server
using ServerBuilder.forPort(int)
.
The Protobuf stub will contain an abstract class called AbstractFoo, where Foo is the name of
your service. Extend this class, and pass an instance of it to ServerBuilder.addService(io.grpc.ServerServiceDefinition)
. Once your server is built, call Server.start()
to begin accepting RPCs.
Both Clients and Servers should use a custom Executor
. The gRPC
runtime includes a default executor that eases testing and examples, but is not ideal for use in
a production environment. See the associated documentation in the respective builders.
Clients and Servers can also be shutdown gracefully using the shutdown
method. The API
to conduct an orderly shutdown is modeled from the ExecutorService
.
gRPC also includes support for more advanced features, such as name resolution, load balancing, bidirectional streaming, health checking, and more. See the relative methods in the client and server builders.
Development of gRPC is done primary on Github at https://github.com/grpc/grpc-java, where the gRPC team welcomes contributions and bug reports. There is also a mailing list at grpc-io if you have questions about gRPC.
Copyright © 2018. All rights reserved.