Package system.runtime.interopservices
Class SafeHandle
- java.lang.Object
-
- org.mases.jcobridge.netreflection.NetObject
-
- system.runtime.constrainedexecution.CriticalFinalizerObject
-
- system.runtime.interopservices.SafeHandle
-
- All Implemented Interfaces:
AutoCloseable
,IJCOBridgeReflected
- Direct Known Subclasses:
SafeAccessTokenHandle
,SafeEvpPKeyHandle
,SafeHandleMinusOneIsInvalid
,SafeHandleZeroOrMinusOneIsInvalid
public class SafeHandle extends CriticalFinalizerObject implements AutoCloseable
The base .NET class managing System.Runtime.InteropServices.SafeHandle, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e.See: https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.InteropServices.SafeHandle
-
-
Field Summary
Fields Modifier and Type Field Description static String
assemblyFullName
Fully assembly qualified name: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798estatic String
assemblyShortName
Assembly name: System.Private.CoreLibstatic String
className
Qualified class name: System.Runtime.InteropServices.SafeHandlestatic JCType
classType
The type managed from JCOBridge.
-
Constructor Summary
Constructors Constructor Description SafeHandle()
SafeHandle(Object instance)
Internal constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SafeHandle
cast(IJCOBridgeReflected from)
Try to cast theIJCOBridgeReflected
instance intoSafeHandle
, a cast assert is made to check if types are compatible.void
close()
void
Close()
void
DangerousAddRef(JCORefOut<AtomicBoolean> success)
void
DangerousRelease()
void
Dispose()
boolean
getIsClosed()
boolean
getIsInvalid()
String
getJCOAssemblyName()
Returns the reflected Assembly nameString
getJCOClassName()
Returns the reflected Class nameObject
getJCOInstance()
Returns the instantiated classString
getJCOObjectName()
Returns the reflected Class name used to build the objectJCType
getJCOType()
Returns the instantiated class Typevoid
SetHandleAsInvalid()
void
setJCOInstance(JCObject instance)
-
Methods inherited from class org.mases.jcobridge.netreflection.NetObject
Equals, Equals, GetHashCode, GetType, hashCode, toObjectFromArray, toObjectFromArray, toString, ToString, translateException
-
-
-
-
Field Detail
-
assemblyFullName
public static final String assemblyFullName
Fully assembly qualified name: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e- See Also:
- Constant Field Values
-
assemblyShortName
public static final String assemblyShortName
Assembly name: System.Private.CoreLib- See Also:
- Constant Field Values
-
className
public static final String className
Qualified class name: System.Runtime.InteropServices.SafeHandle- See Also:
- Constant Field Values
-
-
Method Detail
-
getJCOAssemblyName
public String getJCOAssemblyName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Assembly name- Specified by:
getJCOAssemblyName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOAssemblyName
in classCriticalFinalizerObject
- Returns:
- A
String
representing the Fullname of reflected Assembly
-
getJCOClassName
public String getJCOClassName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name- Specified by:
getJCOClassName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOClassName
in classCriticalFinalizerObject
- Returns:
- A
String
representing the Fullname of reflected Class
-
getJCOObjectName
public String getJCOObjectName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name used to build the object- Specified by:
getJCOObjectName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOObjectName
in classCriticalFinalizerObject
- Returns:
- A
String
representing the name used to allocated the object in CLR context
-
getJCOInstance
public Object getJCOInstance()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class- Specified by:
getJCOInstance
in interfaceIJCOBridgeReflected
- Overrides:
getJCOInstance
in classCriticalFinalizerObject
- Returns:
- An
Object
representing the CLR instance of the instantiated Class
-
setJCOInstance
public void setJCOInstance(JCObject instance)
- Overrides:
setJCOInstance
in classCriticalFinalizerObject
-
getJCOType
public JCType getJCOType()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class Type- Specified by:
getJCOType
in interfaceIJCOBridgeReflected
- Overrides:
getJCOType
in classCriticalFinalizerObject
- Returns:
- A
JCType
representing the CLR Type of the instantiated Class
-
cast
public static SafeHandle cast(IJCOBridgeReflected from) throws Throwable
Try to cast theIJCOBridgeReflected
instance intoSafeHandle
, a cast assert is made to check if types are compatible.- Parameters:
from
-IJCOBridgeReflected
instance to be casted- Returns:
SafeHandle
instance- Throws:
Throwable
- in case of error during cast operation
-
Close
public void Close() throws Throwable, ArgumentException, ArgumentOutOfRangeException, IndexOutOfRangeException, PlatformNotSupportedException, NotSupportedException, ArgumentNullException, ObjectDisposedException, InvalidOperationException, RankException, ArrayTypeMismatchException
-
DangerousAddRef
public void DangerousAddRef(JCORefOut<AtomicBoolean> success) throws Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, IndexOutOfRangeException, NotSupportedException, RankException, CultureNotFoundException, ObjectDisposedException
-
DangerousRelease
public void DangerousRelease() throws Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, IndexOutOfRangeException, NotSupportedException, CultureNotFoundException, ObjectDisposedException
-
Dispose
public void Dispose() throws Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, IndexOutOfRangeException, NotSupportedException, ObjectDisposedException, RankException
-
SetHandleAsInvalid
public void SetHandleAsInvalid() throws Throwable, ArgumentException, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, PlatformNotSupportedException, ArrayTypeMismatchException, IndexOutOfRangeException, NotSupportedException, ObjectDisposedException, RankException
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-