Skip to content

Commit 15fbb57

Browse files
committed
[Java.Interop] Rename JniValueMarshaler to JniValueManager.
Context: dotnet#8 Rename JniRuntime.JniValueMarshaler to JniRuntime.JniValueManager. The reason for this is that the likely fix for issue 8 ("Value Marshaling with Expressions") will involve adding a type named JniValueMarshaler ("JniMarshalInfo" should die!), and having two different JniValueMarshaler types running around would be confusing. Added benefit: JniValueManager is more consistent with JniTypeManager. :-)
1 parent eb69a47 commit 15fbb57

24 files changed

+73
-73
lines changed

src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaClass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ internal JniArgumentMarshalInfo (object value, Type valueType)
155155
{
156156
this = new JniArgumentMarshalInfo ();
157157
var jvm = JniEnvironment.Runtime;
158-
var info = jvm.ValueMarshaler.GetJniMarshalInfoForType (valueType);
158+
var info = jvm.ValueManager.GetJniMarshalInfoForType (valueType);
159159
if (info.CreateJniArgumentValue != null)
160160
jvalue = info.CreateJniArgumentValue (value);
161161
else if (info.CreateMarshalCollection != null) {

src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaConstructorInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public override unsafe object Invoke (IJavaPeerable self, JniArgumentValue* argu
4242
{
4343
if (self == null) {
4444
var h = members.InstanceMethods.StartCreateInstance (JniSignature, typeof (JavaInstanceProxy), arguments);
45-
self = JniEnvironment.Runtime.ValueMarshaler.GetObject<JavaInstanceProxy> (ref h, JniObjectReferenceOptions.CopyAndDispose);
45+
self = JniEnvironment.Runtime.ValueManager.GetObject<JavaInstanceProxy> (ref h, JniObjectReferenceOptions.CopyAndDispose);
4646
}
4747
members.InstanceMethods.FinishCreateInstance (JniSignature, self, arguments);
4848
return new DynamicJavaInstance (self);

src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMemberInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected virtual void Dispose (bool disposing)
2222

2323
protected static object ToReturnValue (ref JniObjectReference handle, string signature, int n)
2424
{
25-
var instance = JniEnvironment.Runtime.ValueMarshaler.GetObject (ref handle, JniObjectReferenceOptions.CopyAndDispose);
25+
var instance = JniEnvironment.Runtime.ValueManager.GetObject (ref handle, JniObjectReferenceOptions.CopyAndDispose);
2626
switch (signature [n]) {
2727
case 'L':
2828
return new DynamicJavaInstance (instance);

src/Java.Interop.Dynamic/Java.Interop.Dynamic/JniMetaObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override DynamicMetaObject BindConvert (ConvertBinder binder)
5252
return new DynamicMetaObject (typeE, BindingRestrictions.GetTypeRestriction (typeE, binder.Type), type);
5353
}
5454

55-
var marshalInfo = vm.ValueMarshaler.GetJniMarshalInfoForType (binder.Type);
55+
var marshalInfo = vm.ValueManager.GetJniMarshalInfoForType (binder.Type);
5656
if (marshalInfo.GetValueFromJni == null)
5757
return binder.FallbackConvert (this);
5858

src/Java.Interop.Export/Java.Interop/ExportedMemberBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static Expression CreateDisposeJniEnvironment (ParameterExpression envp)
327327
static Expression GetThis (Expression vm, Type targetType, Expression context)
328328
{
329329
return Expression.Call (
330-
Expression.Property (vm, "ValueMarshaler"),
330+
Expression.Property (vm, "ValueManager"),
331331
"GetObject",
332332
new[]{targetType},
333333
context);

src/Java.Interop.Export/Tests/Java.Interop/ExportedMemberBuilderTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public void CreateMarshalFromJniMethodExpression_InstanceAction ()
178178
ExportTest __this;
179179
180180
__jvm = JniEnvironment.Runtime;
181-
__this = __jvm.ValueMarshaler.GetObject<ExportTest>(__context);
181+
__this = __jvm.ValueManager.GetObject<ExportTest>(__context);
182182
__this.InstanceAction();
183183
}
184184
catch (Exception __e)
@@ -304,7 +304,7 @@ public void CreateMarshalFromJniMethodExpression_FuncInt64 ()
304304
long __mret;
305305
306306
__jvm = JniEnvironment.Runtime;
307-
__this = __jvm.ValueMarshaler.GetObject<ExportTest>(__context);
307+
__this = __jvm.ValueManager.GetObject<ExportTest>(__context);
308308
__mret = __this.FuncInt64();
309309
__jret = __mret;
310310
return __jret;
@@ -343,7 +343,7 @@ public void CreateMarshalFromJniMethodExpression_FuncIJavaObject ()
343343
JavaObject __mret;
344344
345345
__jvm = JniEnvironment.Runtime;
346-
__this = __jvm.ValueMarshaler.GetObject<ExportTest>(__context);
346+
__this = __jvm.ValueManager.GetObject<ExportTest>(__context);
347347
__mret = __this.FuncIJavaObject();
348348
__jret = References.NewReturnToJniRef(__mret);
349349
return __jret;

src/Java.Interop/Java.Interop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
</Compile>
126126
<Compile Include="Java.Interop\JniReferenceSafeHandle.cs" />
127127
<Compile Include="Java.Interop\JniRuntime.JniExportedMemberBuilder.cs" />
128-
<Compile Include="Java.Interop\JniRuntime.JniValueMarshaler.cs" />
128+
<Compile Include="Java.Interop\JniRuntime.JniValueManager.cs" />
129129
<Compile Include="Java.Interop\JniSystem.cs" />
130130
<Compile Include="Java.Interop\JniWeakGlobalReference.cs" />
131131
<Compile Include="Java.Interop\ManagedPeer.cs" />

src/Java.Interop/Java.Interop/JavaArray.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ internal static JniObjectReference CreateLocalRef<TArray> (object value, Func<IL
143143
internal static IList<T> GetValueFromJni<TArray> (ref JniObjectReference reference, JniObjectReferenceOptions transfer, Type targetType, ArrayCreator<TArray> creator)
144144
where TArray : JavaArray<T>
145145
{
146-
var value = JniEnvironment.Runtime.ValueMarshaler.PeekObject (reference);
146+
var value = JniEnvironment.Runtime.ValueManager.PeekObject (reference);
147147
var array = value as TArray;
148148
if (array != null) {
149149
JniObjectReference.Dispose (ref reference, transfer);

src/Java.Interop/Java.Interop/JavaException.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public JavaException (ref JniObjectReference reference, JniObjectReferenceOption
8888

8989
~JavaException ()
9090
{
91-
JniEnvironment.Runtime.ValueMarshaler.TryCollectObject (this);
91+
JniEnvironment.Runtime.ValueManager.TryCollectObject (this);
9292
}
9393

9494
public JniObjectReference PeerReference {
@@ -123,7 +123,7 @@ public override string StackTrace {
123123

124124
protected SetSafeHandleCompletion SetPeerReference (ref JniObjectReference handle, JniObjectReferenceOptions transfer)
125125
{
126-
return JniEnvironment.Runtime.ValueMarshaler.SetObjectPeerReference (
126+
return JniEnvironment.Runtime.ValueManager.SetObjectPeerReference (
127127
this,
128128
ref handle,
129129
transfer,
@@ -134,14 +134,14 @@ public void UnregisterFromRuntime ()
134134
{
135135
if (!PeerReference.IsValid)
136136
throw new ObjectDisposedException (GetType ().FullName);
137-
JniEnvironment.Runtime.ValueMarshaler.UnRegisterObject (this);
137+
JniEnvironment.Runtime.ValueManager.UnRegisterObject (this);
138138
}
139139

140140
public void Dispose ()
141141
{
142142
if (!PeerReference.IsValid)
143143
return;
144-
JniEnvironment.Runtime.ValueMarshaler.DisposeObject (this);
144+
JniEnvironment.Runtime.ValueManager.DisposeObject (this);
145145
var inner = InnerException as JavaException;
146146
if (inner != null) {
147147
inner.Dispose ();

src/Java.Interop/Java.Interop/JavaObject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ unsafe public class JavaObject : IJavaPeerable, IJavaPeerableEx
2222

2323
~JavaObject ()
2424
{
25-
JniEnvironment.Runtime.ValueMarshaler.TryCollectObject (this);
25+
JniEnvironment.Runtime.ValueManager.TryCollectObject (this);
2626
}
2727

2828
public JniObjectReference PeerReference {
@@ -64,7 +64,7 @@ public unsafe JavaObject ()
6464

6565
protected SetPeerReferenceCompletion SetPeerReference (ref JniObjectReference handle, JniObjectReferenceOptions transfer)
6666
{
67-
return JniEnvironment.Runtime.ValueMarshaler.SetObjectPeerReference (
67+
return JniEnvironment.Runtime.ValueManager.SetObjectPeerReference (
6868
this,
6969
ref handle,
7070
transfer,
@@ -75,12 +75,12 @@ public void UnregisterFromRuntime ()
7575
{
7676
if (!PeerReference.IsValid)
7777
throw new ObjectDisposedException (GetType ().FullName);
78-
JniEnvironment.Runtime.ValueMarshaler.UnRegisterObject (this);
78+
JniEnvironment.Runtime.ValueManager.UnRegisterObject (this);
7979
}
8080

8181
public void Dispose ()
8282
{
83-
JniEnvironment.Runtime.ValueMarshaler.DisposeObject (this);
83+
JniEnvironment.Runtime.ValueManager.DisposeObject (this);
8484
}
8585

8686
public void DisposeUnlessRegistered ()

0 commit comments

Comments
 (0)