- java.lang.Object
-
- brave.rpc.RpcRequest
-
- Direct Known Subclasses:
RpcClientRequest,RpcServerRequest
public abstract class RpcRequest extends java.lang.ObjectAbstract request type used for parsing and sampling of rpc clients and servers.- Since:
- 5.8
- See Also:
RpcClientRequest,RpcServerRequest
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.Stringmethod()The unqualified, case-sensitive method name.abstract java.lang.Stringservice()The fully-qualified, case-sensitive service path.java.lang.StringtoString()abstract java.lang.Objectunwrap()Returns the underlying rpc request object.
-
-
-
Method Detail
-
unwrap
public abstract java.lang.Object unwrap()
Returns the underlying rpc request object. Ex.org.apache.rpc.RpcRequestNote: Some implementations are composed of multiple types, such as a request and a socket address of the client. Moreover, an implementation may change the type returned due to refactoring. Unless you control the implementation, cast carefully (ex using
instance of) instead of presuming a specific type will always be returned.- Since:
- 5.8
-
method
@Nullable public abstract java.lang.String method()
The unqualified, case-sensitive method name. Prefer the name defined in IDL to any mappedJava method name.Examples
- gRPC - full method "grpc.health.v1.Health/Check" returns "Check"
- Apache Dubbo - "demo.service.DemoService#sayHello()" command returns "sayHello"
- Apache Thrift - full method "scribe.Log" returns "Log"
Note: For IDL based services, such as Protocol Buffers, this may be different than the
Java method name, or in a different case format.- Returns:
- the RPC method name or null if unreadable.
-
service
@Nullable public abstract java.lang.String service()
The fully-qualified, case-sensitive service path. Prefer the name defined in IDL to any mappedJava package name.Examples
- gRPC - full method "grpc.health.v1.Health/Check" returns "grpc.health.v1.Health"
- Apache Dubbo - "demo.service.DemoService#sayHello()" command returns "demo.service.DemoService"
- Apache Thrift - full method "scribe.Log" returns "scribe"
Note: For IDL based services, such as Protocol Buffers, this may be different than the
Java package name, or in a different case format. Also, this is the definition of the service, not its deploymentservice name.- Returns:
- the RPC namespace or null if unreadable.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-