Documentation
¶
Overview ¶
Package jni_raw implements a gRPC server that exposes the raw JNI Env surface over gRPC. All JNI objects are referenced by int64 handles stored in the shared HandleStore. MethodIDs and FieldIDs are passed as int64 values cast from their pointer representation.
Index ¶
- type Server
- func (s *Server) AllocObject(_ context.Context, req *pb.AllocObjectRequest) (*pb.AllocObjectResponse, error)
- func (s *Server) CallMethod(_ context.Context, req *pb.CallMethodRequest) (*pb.CallMethodResponse, error)
- func (s *Server) CallNonvirtualMethod(_ context.Context, req *pb.CallNonvirtualMethodRequest) (*pb.CallNonvirtualMethodResponse, error)
- func (s *Server) CallStaticMethod(_ context.Context, req *pb.CallStaticMethodRequest) (*pb.CallStaticMethodResponse, error)
- func (s *Server) EnsureLocalCapacity(_ context.Context, req *pb.EnsureLocalCapacityRequest) (*pb.EnsureLocalCapacityResponse, error)
- func (s *Server) ExceptionCheck(_ context.Context, _ *pb.ExceptionCheckRequest) (*pb.ExceptionCheckResponse, error)
- func (s *Server) ExceptionClear(_ context.Context, _ *pb.ExceptionClearRequest) (*pb.ExceptionClearResponse, error)
- func (s *Server) ExceptionDescribe(_ context.Context, _ *pb.ExceptionDescribeRequest) (*pb.ExceptionDescribeResponse, error)
- func (s *Server) ExceptionOccurred(_ context.Context, _ *pb.ExceptionOccurredRequest) (*pb.ExceptionOccurredResponse, error)
- func (s *Server) FindClass(_ context.Context, req *pb.FindClassRequest) (*pb.FindClassResponse, error)
- func (s *Server) FromReflectedField(_ context.Context, req *pb.FromReflectedFieldRequest) (*pb.FromReflectedFieldResponse, error)
- func (s *Server) FromReflectedMethod(_ context.Context, req *pb.FromReflectedMethodRequest) (*pb.FromReflectedMethodResponse, error)
- func (s *Server) GetAppContext(_ context.Context, _ *pb.GetAppContextRequest) (*pb.GetAppContextResponse, error)
- func (s *Server) GetArrayLength(_ context.Context, req *pb.GetArrayLengthRequest) (*pb.GetArrayLengthResponse, error)
- func (s *Server) GetByteArrayData(_ context.Context, req *pb.GetByteArrayDataRequest) (*pb.GetByteArrayDataResponse, error)
- func (s *Server) GetField(_ context.Context, req *pb.GetFieldValueRequest) (*pb.GetFieldValueResponse, error)
- func (s *Server) GetFieldID(_ context.Context, req *pb.GetFieldIDRequest) (*pb.GetFieldIDResponse, error)
- func (s *Server) GetMethodID(_ context.Context, req *pb.GetMethodIDRequest) (*pb.GetMethodIDResponse, error)
- func (s *Server) GetObjectArrayElement(_ context.Context, req *pb.GetObjectArrayElementRequest) (*pb.GetObjectArrayElementResponse, error)
- func (s *Server) GetObjectClass(_ context.Context, req *pb.GetObjectClassRequest) (*pb.GetObjectClassResponse, error)
- func (s *Server) GetObjectRefType(_ context.Context, req *pb.GetObjectRefTypeRequest) (*pb.GetObjectRefTypeResponse, error)
- func (s *Server) GetStaticField(_ context.Context, req *pb.GetStaticFieldValueRequest) (*pb.GetStaticFieldValueResponse, error)
- func (s *Server) GetStaticFieldID(_ context.Context, req *pb.GetStaticFieldIDRequest) (*pb.GetStaticFieldIDResponse, error)
- func (s *Server) GetStaticMethodID(_ context.Context, req *pb.GetStaticMethodIDRequest) (*pb.GetStaticMethodIDResponse, error)
- func (s *Server) GetStringLength(_ context.Context, req *pb.GetStringLengthRequest) (*pb.GetStringLengthResponse, error)
- func (s *Server) GetStringUTFChars(_ context.Context, req *pb.GetStringUTFCharsRequest) (*pb.GetStringUTFCharsResponse, error)
- func (s *Server) GetSuperclass(_ context.Context, req *pb.GetSuperclassRequest) (*pb.GetSuperclassResponse, error)
- func (s *Server) GetVersion(_ context.Context, _ *pb.GetVersionRequest) (*pb.GetVersionResponse, error)
- func (s *Server) IsAssignableFrom(_ context.Context, req *pb.IsAssignableFromRequest) (*pb.IsAssignableFromResponse, error)
- func (s *Server) IsInstanceOf(_ context.Context, req *pb.IsInstanceOfRequest) (*pb.IsInstanceOfResponse, error)
- func (s *Server) IsSameObject(_ context.Context, req *pb.IsSameObjectRequest) (*pb.IsSameObjectResponse, error)
- func (s *Server) MonitorEnter(_ context.Context, req *pb.MonitorEnterRequest) (*pb.MonitorEnterResponse, error)
- func (s *Server) MonitorExit(_ context.Context, req *pb.MonitorExitRequest) (*pb.MonitorExitResponse, error)
- func (s *Server) NewObject(_ context.Context, req *pb.NewObjectRequest) (*pb.NewObjectResponse, error)
- func (s *Server) NewObjectArray(_ context.Context, req *pb.NewObjectArrayRequest) (*pb.NewObjectArrayResponse, error)
- func (s *Server) NewPrimitiveArray(_ context.Context, req *pb.NewPrimitiveArrayRequest) (*pb.NewPrimitiveArrayResponse, error)
- func (s *Server) NewStringUTF(_ context.Context, req *pb.NewStringUTFRequest) (*pb.NewStringUTFResponse, error)
- func (s *Server) PopLocalFrame(_ context.Context, req *pb.PopLocalFrameRequest) (*pb.PopLocalFrameResponse, error)
- func (s *Server) Proxy(stream pb.JNIService_ProxyServer) error
- func (s *Server) PushLocalFrame(_ context.Context, req *pb.PushLocalFrameRequest) (*pb.PushLocalFrameResponse, error)
- func (s *Server) SetField(_ context.Context, req *pb.SetFieldValueRequest) (*pb.SetFieldValueResponse, error)
- func (s *Server) SetObjectArrayElement(_ context.Context, req *pb.SetObjectArrayElementRequest) (*pb.SetObjectArrayElementResponse, error)
- func (s *Server) SetStaticField(_ context.Context, req *pb.SetStaticFieldValueRequest) (*pb.SetStaticFieldValueResponse, error)
- func (s *Server) Throw(_ context.Context, req *pb.ThrowRequest) (*pb.ThrowResponse, error)
- func (s *Server) ThrowNew(_ context.Context, req *pb.ThrowNewRequest) (*pb.ThrowNewResponse, error)
- func (s *Server) ToReflectedField(_ context.Context, req *pb.ToReflectedFieldRequest) (*pb.ToReflectedFieldResponse, error)
- func (s *Server) ToReflectedMethod(_ context.Context, req *pb.ToReflectedMethodRequest) (*pb.ToReflectedMethodResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
pb.UnimplementedJNIServiceServer
VM *jni.VM
Handles *handlestore.HandleStore
// AppContextHandle is the HandleStore handle for the Android
// application Context. Set during server startup so clients can
// retrieve it via the GetAppContext RPC instead of guessing.
AppContextHandle int64
// AppClassLoader is an optional handle to the APK's ClassLoader.
// When set, FindClass falls back to ClassLoader.loadClass() if the
// JNI FindClass fails (native threads use BootClassLoader which
// can't find APK classes).
AppClassLoader int64
}
Server implements pb.JNIServiceServer.
func (*Server) AllocObject ¶
func (s *Server) AllocObject(_ context.Context, req *pb.AllocObjectRequest) (*pb.AllocObjectResponse, error)
func (*Server) CallMethod ¶
func (s *Server) CallMethod(_ context.Context, req *pb.CallMethodRequest) (*pb.CallMethodResponse, error)
func (*Server) CallNonvirtualMethod ¶
func (s *Server) CallNonvirtualMethod(_ context.Context, req *pb.CallNonvirtualMethodRequest) (*pb.CallNonvirtualMethodResponse, error)
func (*Server) CallStaticMethod ¶
func (s *Server) CallStaticMethod(_ context.Context, req *pb.CallStaticMethodRequest) (*pb.CallStaticMethodResponse, error)
func (*Server) EnsureLocalCapacity ¶
func (s *Server) EnsureLocalCapacity(_ context.Context, req *pb.EnsureLocalCapacityRequest) (*pb.EnsureLocalCapacityResponse, error)
func (*Server) ExceptionCheck ¶
func (s *Server) ExceptionCheck(_ context.Context, _ *pb.ExceptionCheckRequest) (*pb.ExceptionCheckResponse, error)
func (*Server) ExceptionClear ¶
func (s *Server) ExceptionClear(_ context.Context, _ *pb.ExceptionClearRequest) (*pb.ExceptionClearResponse, error)
func (*Server) ExceptionDescribe ¶
func (s *Server) ExceptionDescribe(_ context.Context, _ *pb.ExceptionDescribeRequest) (*pb.ExceptionDescribeResponse, error)
func (*Server) ExceptionOccurred ¶
func (s *Server) ExceptionOccurred(_ context.Context, _ *pb.ExceptionOccurredRequest) (*pb.ExceptionOccurredResponse, error)
func (*Server) FindClass ¶
func (s *Server) FindClass(_ context.Context, req *pb.FindClassRequest) (*pb.FindClassResponse, error)
func (*Server) FromReflectedField ¶
func (s *Server) FromReflectedField(_ context.Context, req *pb.FromReflectedFieldRequest) (*pb.FromReflectedFieldResponse, error)
func (*Server) FromReflectedMethod ¶
func (s *Server) FromReflectedMethod(_ context.Context, req *pb.FromReflectedMethodRequest) (*pb.FromReflectedMethodResponse, error)
func (*Server) GetAppContext ¶
func (s *Server) GetAppContext(_ context.Context, _ *pb.GetAppContextRequest) (*pb.GetAppContextResponse, error)
func (*Server) GetArrayLength ¶
func (s *Server) GetArrayLength(_ context.Context, req *pb.GetArrayLengthRequest) (*pb.GetArrayLengthResponse, error)
func (*Server) GetByteArrayData ¶
func (s *Server) GetByteArrayData(_ context.Context, req *pb.GetByteArrayDataRequest) (*pb.GetByteArrayDataResponse, error)
func (*Server) GetField ¶
func (s *Server) GetField(_ context.Context, req *pb.GetFieldValueRequest) (*pb.GetFieldValueResponse, error)
func (*Server) GetFieldID ¶
func (s *Server) GetFieldID(_ context.Context, req *pb.GetFieldIDRequest) (*pb.GetFieldIDResponse, error)
func (*Server) GetMethodID ¶
func (s *Server) GetMethodID(_ context.Context, req *pb.GetMethodIDRequest) (*pb.GetMethodIDResponse, error)
func (*Server) GetObjectArrayElement ¶
func (s *Server) GetObjectArrayElement(_ context.Context, req *pb.GetObjectArrayElementRequest) (*pb.GetObjectArrayElementResponse, error)
func (*Server) GetObjectClass ¶
func (s *Server) GetObjectClass(_ context.Context, req *pb.GetObjectClassRequest) (*pb.GetObjectClassResponse, error)
func (*Server) GetObjectRefType ¶
func (s *Server) GetObjectRefType(_ context.Context, req *pb.GetObjectRefTypeRequest) (*pb.GetObjectRefTypeResponse, error)
func (*Server) GetStaticField ¶
func (s *Server) GetStaticField(_ context.Context, req *pb.GetStaticFieldValueRequest) (*pb.GetStaticFieldValueResponse, error)
func (*Server) GetStaticFieldID ¶
func (s *Server) GetStaticFieldID(_ context.Context, req *pb.GetStaticFieldIDRequest) (*pb.GetStaticFieldIDResponse, error)
func (*Server) GetStaticMethodID ¶
func (s *Server) GetStaticMethodID(_ context.Context, req *pb.GetStaticMethodIDRequest) (*pb.GetStaticMethodIDResponse, error)
func (*Server) GetStringLength ¶
func (s *Server) GetStringLength(_ context.Context, req *pb.GetStringLengthRequest) (*pb.GetStringLengthResponse, error)
func (*Server) GetStringUTFChars ¶
func (s *Server) GetStringUTFChars(_ context.Context, req *pb.GetStringUTFCharsRequest) (*pb.GetStringUTFCharsResponse, error)
func (*Server) GetSuperclass ¶
func (s *Server) GetSuperclass(_ context.Context, req *pb.GetSuperclassRequest) (*pb.GetSuperclassResponse, error)
func (*Server) GetVersion ¶
func (s *Server) GetVersion(_ context.Context, _ *pb.GetVersionRequest) (*pb.GetVersionResponse, error)
func (*Server) IsAssignableFrom ¶
func (s *Server) IsAssignableFrom(_ context.Context, req *pb.IsAssignableFromRequest) (*pb.IsAssignableFromResponse, error)
func (*Server) IsInstanceOf ¶
func (s *Server) IsInstanceOf(_ context.Context, req *pb.IsInstanceOfRequest) (*pb.IsInstanceOfResponse, error)
func (*Server) IsSameObject ¶
func (s *Server) IsSameObject(_ context.Context, req *pb.IsSameObjectRequest) (*pb.IsSameObjectResponse, error)
func (*Server) MonitorEnter ¶
func (s *Server) MonitorEnter(_ context.Context, req *pb.MonitorEnterRequest) (*pb.MonitorEnterResponse, error)
func (*Server) MonitorExit ¶
func (s *Server) MonitorExit(_ context.Context, req *pb.MonitorExitRequest) (*pb.MonitorExitResponse, error)
func (*Server) NewObject ¶
func (s *Server) NewObject(_ context.Context, req *pb.NewObjectRequest) (*pb.NewObjectResponse, error)
func (*Server) NewObjectArray ¶
func (s *Server) NewObjectArray(_ context.Context, req *pb.NewObjectArrayRequest) (*pb.NewObjectArrayResponse, error)
func (*Server) NewPrimitiveArray ¶
func (s *Server) NewPrimitiveArray(_ context.Context, req *pb.NewPrimitiveArrayRequest) (*pb.NewPrimitiveArrayResponse, error)
func (*Server) NewStringUTF ¶
func (s *Server) NewStringUTF(_ context.Context, req *pb.NewStringUTFRequest) (*pb.NewStringUTFResponse, error)
func (*Server) PopLocalFrame ¶
func (s *Server) PopLocalFrame(_ context.Context, req *pb.PopLocalFrameRequest) (*pb.PopLocalFrameResponse, error)
func (*Server) Proxy ¶
func (s *Server) Proxy(stream pb.JNIService_ProxyServer) error
Proxy implements the bidirectional streaming RPC that creates a Java dynamic proxy and forwards method invocations to the gRPC client as CallbackEvent messages. The client responds with CallbackResponse messages that are dispatched back to the blocked JVM callback thread.
func (*Server) PushLocalFrame ¶
func (s *Server) PushLocalFrame(_ context.Context, req *pb.PushLocalFrameRequest) (*pb.PushLocalFrameResponse, error)
func (*Server) SetField ¶
func (s *Server) SetField(_ context.Context, req *pb.SetFieldValueRequest) (*pb.SetFieldValueResponse, error)
func (*Server) SetObjectArrayElement ¶
func (s *Server) SetObjectArrayElement(_ context.Context, req *pb.SetObjectArrayElementRequest) (*pb.SetObjectArrayElementResponse, error)
func (*Server) SetStaticField ¶
func (s *Server) SetStaticField(_ context.Context, req *pb.SetStaticFieldValueRequest) (*pb.SetStaticFieldValueResponse, error)
func (*Server) Throw ¶
func (s *Server) Throw(_ context.Context, req *pb.ThrowRequest) (*pb.ThrowResponse, error)
func (*Server) ThrowNew ¶
func (s *Server) ThrowNew(_ context.Context, req *pb.ThrowNewRequest) (*pb.ThrowNewResponse, error)
func (*Server) ToReflectedField ¶
func (s *Server) ToReflectedField(_ context.Context, req *pb.ToReflectedFieldRequest) (*pb.ToReflectedFieldResponse, error)
func (*Server) ToReflectedMethod ¶
func (s *Server) ToReflectedMethod(_ context.Context, req *pb.ToReflectedMethodRequest) (*pb.ToReflectedMethodResponse, error)
Click to show internal directories.
Click to hide internal directories.