Package system.runtime.caching
Class MemoryCache
- java.lang.Object
-
- org.mases.jcobridge.netreflection.NetObject
-
- org.mases.jcobridge.netreflection.NetObjectEnumerable
-
- system.runtime.caching.ObjectCache
-
- system.runtime.caching.MemoryCache
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.lang.Iterable<NetObject>
,IEnumerable
,IJCOBridgeReflected
public class MemoryCache extends ObjectCache implements java.lang.AutoCloseable
The base .NET class managing System.Runtime.Caching.MemoryCache, System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a..NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.Caching.MemoryCache
Powered by JCOBridge: more info at https://www.jcobridge.com
- Author:
- MASES s.r.l https://masesgroup.com
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
assemblyFullName
Fully assembly qualified name: System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3astatic java.lang.String
assemblyShortName
Assembly name: System.Runtime.Cachingstatic java.lang.String
className
Qualified class name: System.Runtime.Caching.MemoryCachestatic JCType
classType
The type managed from JCOBridge.-
Fields inherited from class org.mases.jcobridge.netreflection.NetObjectEnumerable
Null
-
-
Constructor Summary
Constructors Constructor Description MemoryCache()
MemoryCache(java.lang.Object instance)
Internal constructor.MemoryCache(java.lang.String name, NameValueCollection config)
MemoryCache(java.lang.String name, NameValueCollection config, boolean ignoreConfigSection)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
Add(CacheItem item, CacheItemPolicy policy)
NetObject
AddOrGetExisting(java.lang.String key, NetObject value, DateTimeOffset absoluteExpiration, java.lang.String regionName)
NetObject
AddOrGetExisting(java.lang.String key, NetObject value, CacheItemPolicy policy, java.lang.String regionName)
CacheItem
AddOrGetExisting(CacheItem item, CacheItemPolicy policy)
static MemoryCache
cast(IJCOBridgeReflected from)
Try to cast theIJCOBridgeReflected
instance intoMemoryCache
, a cast assert is made to check if types are compatible.void
close()
boolean
Contains(java.lang.String key, java.lang.String regionName)
void
Dispose()
NetObject
Get(java.lang.String key, java.lang.String regionName)
CacheItem
GetCacheItem(java.lang.String key, java.lang.String regionName)
long
getCacheMemoryLimit()
long
GetCount(java.lang.String regionName)
static MemoryCache
getDefault()
java.lang.String
getJCOAssemblyName()
Returns the reflected Assembly namejava.lang.String
getJCOClassName()
Returns the reflected Class namejava.lang.Object
getJCOInstance()
Returns the instantiated classjava.lang.String
getJCOObjectName()
Returns the reflected Class name used to build the objectJCType
getJCOType()
Returns the instantiated class Typelong
GetLastSize(java.lang.String regionName)
long
getPhysicalMemoryLimit()
TimeSpan
getPollingInterval()
NetObject
Remove(java.lang.String key, java.lang.String regionName)
NetObject
Remove(java.lang.String key, CacheEntryRemovedReason reason, java.lang.String regionName)
void
Set(java.lang.String key, NetObject value, DateTimeOffset absoluteExpiration, java.lang.String regionName)
void
Set(java.lang.String key, NetObject value, CacheItemPolicy policy, java.lang.String regionName)
void
Set(CacheItem item, CacheItemPolicy policy)
void
setJCOInstance(JCObject instance)
long
Trim(int percent)
-
Methods inherited from class system.runtime.caching.ObjectCache
Add, Add, getDefaultCacheCapabilities, getHost, getName, setHost
-
Methods inherited from class org.mases.jcobridge.netreflection.NetObjectEnumerable
GetEnumerator, iterator
-
-
-
-
Field Detail
-
assemblyFullName
public static final java.lang.String assemblyFullName
Fully assembly qualified name: System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a- See Also:
- Constant Field Values
-
assemblyShortName
public static final java.lang.String assemblyShortName
Assembly name: System.Runtime.Caching- See Also:
- Constant Field Values
-
className
public static final java.lang.String className
Qualified class name: System.Runtime.Caching.MemoryCache- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MemoryCache
public MemoryCache(java.lang.Object instance) throws java.lang.Throwable
Internal constructor. Use with caution- Throws:
java.lang.Throwable
-
MemoryCache
public MemoryCache() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
MemoryCache
public MemoryCache(java.lang.String name, NameValueCollection config) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException, FormatException, Win32Exception, NullReferenceException, PlatformNotSupportedException, WaitHandleCannotBeOpenedException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException, OperationCanceledException, OverflowException, ConfigurationException, ConfigurationErrorsException, MulticastNotSupportedException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
FormatException
Win32Exception
NullReferenceException
PlatformNotSupportedException
WaitHandleCannotBeOpenedException
FileNotFoundException
DirectoryNotFoundException
UnauthorizedAccessException
IOException
PathTooLongException
DriveNotFoundException
OperationCanceledException
OverflowException
ConfigurationException
ConfigurationErrorsException
MulticastNotSupportedException
-
MemoryCache
public MemoryCache(java.lang.String name, NameValueCollection config, boolean ignoreConfigSection) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException, FormatException, Win32Exception, NullReferenceException, PlatformNotSupportedException, WaitHandleCannotBeOpenedException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException, OperationCanceledException, OverflowException, ConfigurationException, ConfigurationErrorsException, MulticastNotSupportedException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
FormatException
Win32Exception
NullReferenceException
PlatformNotSupportedException
WaitHandleCannotBeOpenedException
FileNotFoundException
DirectoryNotFoundException
UnauthorizedAccessException
IOException
PathTooLongException
DriveNotFoundException
OperationCanceledException
OverflowException
ConfigurationException
ConfigurationErrorsException
MulticastNotSupportedException
-
-
Method Detail
-
getJCOAssemblyName
public java.lang.String getJCOAssemblyName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Assembly name- Specified by:
getJCOAssemblyName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOAssemblyName
in classObjectCache
- Returns:
- A
String
representing the Fullname of reflected Assembly
-
getJCOClassName
public java.lang.String getJCOClassName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name- Specified by:
getJCOClassName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOClassName
in classObjectCache
- Returns:
- A
String
representing the Fullname of reflected Class
-
getJCOObjectName
public java.lang.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 classObjectCache
- Returns:
- A
String
representing the name used to allocated the object in CLR context
-
getJCOInstance
public java.lang.Object getJCOInstance()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class- Specified by:
getJCOInstance
in interfaceIJCOBridgeReflected
- Overrides:
getJCOInstance
in classObjectCache
- Returns:
- An
Object
representing the CLR instance of the instantiated Class
-
setJCOInstance
public void setJCOInstance(JCObject instance)
- Overrides:
setJCOInstance
in classObjectCache
-
getJCOType
public JCType getJCOType()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class Type- Specified by:
getJCOType
in interfaceIJCOBridgeReflected
- Overrides:
getJCOType
in classObjectCache
- Returns:
- A
JCType
representing the CLR Type of the instantiated Class
-
cast
public static MemoryCache cast(IJCOBridgeReflected from) throws java.lang.Throwable
Try to cast theIJCOBridgeReflected
instance intoMemoryCache
, a cast assert is made to check if types are compatible.- Parameters:
from
-IJCOBridgeReflected
instance to be casted- Returns:
MemoryCache
instance- Throws:
java.lang.Throwable
- in case of error during cast operation
-
Add
public boolean Add(CacheItem item, CacheItemPolicy policy) throws java.lang.Throwable
- Overrides:
Add
in classObjectCache
- Throws:
java.lang.Throwable
-
Contains
public boolean Contains(java.lang.String key, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotImplementedException, NotSupportedException, ArgumentOutOfRangeException, CultureNotFoundException, MissingManifestResourceException, ObjectDisposedException
- Overrides:
Contains
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotImplementedException
NotSupportedException
ArgumentOutOfRangeException
CultureNotFoundException
MissingManifestResourceException
ObjectDisposedException
-
GetCount
public long GetCount(java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException
- Overrides:
GetCount
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
-
GetLastSize
public long GetLastSize(java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
-
Trim
public long Trim(int percent) throws java.lang.Throwable, InvalidOperationException, ArgumentOutOfRangeException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException, OperationCanceledException, ArgumentException, ArgumentNullException, ObjectDisposedException, AbandonedMutexException
- Throws:
java.lang.Throwable
InvalidOperationException
ArgumentOutOfRangeException
FileNotFoundException
DirectoryNotFoundException
UnauthorizedAccessException
IOException
PathTooLongException
DriveNotFoundException
OperationCanceledException
ArgumentException
ArgumentNullException
ObjectDisposedException
AbandonedMutexException
-
AddOrGetExisting
public NetObject AddOrGetExisting(java.lang.String key, NetObject value, DateTimeOffset absoluteExpiration, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException, FormatException, AbandonedMutexException, PlatformNotSupportedException
- Overrides:
AddOrGetExisting
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
FormatException
AbandonedMutexException
PlatformNotSupportedException
-
AddOrGetExisting
public NetObject AddOrGetExisting(java.lang.String key, NetObject value, CacheItemPolicy policy, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException, FormatException, AbandonedMutexException, PlatformNotSupportedException
- Overrides:
AddOrGetExisting
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
FormatException
AbandonedMutexException
PlatformNotSupportedException
-
Get
public NetObject Get(java.lang.String key, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotImplementedException, NotSupportedException, ArgumentOutOfRangeException, CultureNotFoundException, MissingManifestResourceException, ObjectDisposedException
- Overrides:
Get
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotImplementedException
NotSupportedException
ArgumentOutOfRangeException
CultureNotFoundException
MissingManifestResourceException
ObjectDisposedException
-
Remove
public NetObject Remove(java.lang.String key, CacheEntryRemovedReason reason, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException, PlatformNotSupportedException
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
PlatformNotSupportedException
-
Remove
public NetObject Remove(java.lang.String key, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotImplementedException, NotSupportedException, ArgumentOutOfRangeException, CultureNotFoundException, MissingManifestResourceException, ObjectDisposedException, PlatformNotSupportedException
- Overrides:
Remove
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotImplementedException
NotSupportedException
ArgumentOutOfRangeException
CultureNotFoundException
MissingManifestResourceException
ObjectDisposedException
PlatformNotSupportedException
-
AddOrGetExisting
public CacheItem AddOrGetExisting(CacheItem item, CacheItemPolicy policy) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, ArgumentException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotImplementedException, CultureNotFoundException, MissingManifestResourceException, ObjectDisposedException, AbandonedMutexException, PlatformNotSupportedException
- Overrides:
AddOrGetExisting
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentOutOfRangeException
ArgumentException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotImplementedException
CultureNotFoundException
MissingManifestResourceException
ObjectDisposedException
AbandonedMutexException
PlatformNotSupportedException
-
GetCacheItem
public CacheItem GetCacheItem(java.lang.String key, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotImplementedException, NotSupportedException, ArgumentOutOfRangeException, CultureNotFoundException, MissingManifestResourceException, ObjectDisposedException
- Overrides:
GetCacheItem
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotImplementedException
NotSupportedException
ArgumentOutOfRangeException
CultureNotFoundException
MissingManifestResourceException
ObjectDisposedException
-
Dispose
public void Dispose() throws java.lang.Throwable, ArgumentException, InvalidOperationException, ArgumentNullException, KeyNotFoundException, ObjectDisposedException, AbandonedMutexException, NotImplementedException, MissingManifestResourceException, ArgumentOutOfRangeException, NullReferenceException, CultureNotFoundException, PlatformNotSupportedException, NotSupportedException, Win32Exception, SecurityException, UnauthorizedAccessException, IOException, OutOfMemoryException, SystemException, ApplicationException
- Throws:
java.lang.Throwable
ArgumentException
InvalidOperationException
ArgumentNullException
KeyNotFoundException
ObjectDisposedException
AbandonedMutexException
NotImplementedException
MissingManifestResourceException
ArgumentOutOfRangeException
NullReferenceException
CultureNotFoundException
PlatformNotSupportedException
NotSupportedException
Win32Exception
SecurityException
UnauthorizedAccessException
IOException
OutOfMemoryException
SystemException
ApplicationException
-
Set
public void Set(CacheItem item, CacheItemPolicy policy) throws java.lang.Throwable, ArgumentNullException
- Overrides:
Set
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
-
Set
public void Set(java.lang.String key, NetObject value, DateTimeOffset absoluteExpiration, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException
- Overrides:
Set
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
-
Set
public void Set(java.lang.String key, NetObject value, CacheItemPolicy policy, java.lang.String regionName) throws java.lang.Throwable, ArgumentNullException, ArgumentException, TypeLoadException, InvalidOperationException, MissingMethodException, TargetInvocationException, NotSupportedException, NotImplementedException, ArgumentOutOfRangeException, IndexOutOfRangeException, CultureNotFoundException, OutOfMemoryException, MissingManifestResourceException, ObjectDisposedException, FormatException, AbandonedMutexException, PlatformNotSupportedException
- Overrides:
Set
in classObjectCache
- Throws:
java.lang.Throwable
ArgumentNullException
ArgumentException
TypeLoadException
InvalidOperationException
MissingMethodException
TargetInvocationException
NotSupportedException
NotImplementedException
ArgumentOutOfRangeException
IndexOutOfRangeException
CultureNotFoundException
OutOfMemoryException
MissingManifestResourceException
ObjectDisposedException
FormatException
AbandonedMutexException
PlatformNotSupportedException
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
getCacheMemoryLimit
public long getCacheMemoryLimit() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
getPhysicalMemoryLimit
public long getPhysicalMemoryLimit() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
getDefault
public static MemoryCache getDefault() throws java.lang.Throwable, ArgumentException, ArgumentNullException, ArgumentOutOfRangeException, OutOfMemoryException, CultureNotFoundException, NotSupportedException, NotImplementedException, MissingManifestResourceException, ObjectDisposedException, InvalidOperationException, FormatException, IndexOutOfRangeException, Win32Exception, NullReferenceException, PlatformNotSupportedException, WaitHandleCannotBeOpenedException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException, OperationCanceledException, OverflowException, ConfigurationException, ConfigurationErrorsException, MulticastNotSupportedException
- Throws:
java.lang.Throwable
ArgumentException
ArgumentNullException
ArgumentOutOfRangeException
OutOfMemoryException
CultureNotFoundException
NotSupportedException
NotImplementedException
MissingManifestResourceException
ObjectDisposedException
InvalidOperationException
FormatException
IndexOutOfRangeException
Win32Exception
NullReferenceException
PlatformNotSupportedException
WaitHandleCannotBeOpenedException
FileNotFoundException
DirectoryNotFoundException
UnauthorizedAccessException
IOException
PathTooLongException
DriveNotFoundException
OperationCanceledException
OverflowException
ConfigurationException
ConfigurationErrorsException
MulticastNotSupportedException
-
getPollingInterval
public TimeSpan getPollingInterval() throws java.lang.Throwable, ArgumentException, OverflowException
- Throws:
java.lang.Throwable
ArgumentException
OverflowException
-
-