Package com.gigaspaces.lrmi
Class LRMIUtilities
java.lang.Object
com.gigaspaces.lrmi.LRMIUtilities
This utility class provides a common Transport Protocol utilities methods.
- Since:
- 4.0
- Author:
- Igor Goldenberg
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final intstatic final intstatic final intstatic final booleanstatic final Integer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RemoteMethodCachecreateRemoteMethodCache(List<Class<?>> remoteInterfaces, Map<String, Integer> methodMapping, Map<String, LRMIMethodMetadata> overrideMethodsMetadata) Returns a ~cache of sorted java.rmi.Remote methods of desired exported Remote object.static intgetAndSetSocketTimeout(SocketChannel sockChannel, int timeout) With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time.static ConnectionEndpointDetailsgetDeclaredInterfaces(Class claz, Class... assignableClasses) Returns an array of all declared interfaces of desired class (super-classes comes an account).getDeclaredRemoteInterfaces(Class<?> claz) Returns a list of alljava.rmi.Remoteinterfaces implemented supplied class.getMappingMethodDescriptor(Class clazz) Returns the cross instance/platform mapping table of desired class with method descriptors(method hash).static StringGets a readable format string that describe the specified methodstatic StringReturns a string consisting of the given method's name followed by its "method descriptor", as appropriate for use in the computation of the "method hash".static Class<?>[]getProxyInterfaces(Class<?> claz) Returns an array of all interfaces an lrmi based proxy to the specified class should implementstatic PlatformLogicalVersionstatic StringgetTrafficString(long bytes) static voidinitNewSocketProperties(SocketChannel sockChannel) static booleanisRemoteProxy(Object obj)
-
Field Details
-
SEND_BUFFER_SIZE
public static final int SEND_BUFFER_SIZE -
RECEIVE_BUFFER_SIZE
public static final int RECEIVE_BUFFER_SIZE -
KEEP_ALIVE_MODE
public static final boolean KEEP_ALIVE_MODE -
TCP_NO_DELAY_MODE
public static final boolean TCP_NO_DELAY_MODE -
TRAFFIC_CLASS
-
READ_BLOCK_TIMEOUT
public static final int READ_BLOCK_TIMEOUT
-
-
Constructor Details
-
LRMIUtilities
public LRMIUtilities()
-
-
Method Details
-
getProxyInterfaces
Returns an array of all interfaces an lrmi based proxy to the specified class should implement- Parameters:
claz- proxy class- Returns:
- an array of all interfaces an lrmi based proxy to the specified class should implement
-
getDeclaredRemoteInterfaces
Returns a list of alljava.rmi.Remoteinterfaces implemented supplied class.- Parameters:
claz- The class to get alljava.rmi.Remoteinterfaces.
-
getDeclaredInterfaces
Returns an array of all declared interfaces of desired class (super-classes comes an account). IfassignableClassesisnullall implemented interface will be added to array, otherwise only assignable classes.- Parameters:
claz- The class to get all interfaces.
-
createRemoteMethodCache
public static RemoteMethodCache createRemoteMethodCache(List<Class<?>> remoteInterfaces, Map<String, Integer> methodMapping, Map<String, LRMIMethodMetadata> overrideMethodsMetadata) Returns a ~cache of sorted java.rmi.Remote methods of desired exported Remote object. -
getMethodNameAndDescriptor
Returns a string consisting of the given method's name followed by its "method descriptor", as appropriate for use in the computation of the "method hash". See section 4.3.3 of The Java(TM) Virtual Machine Specification for the definition of a "method descriptor". -
getMethodDisplayString
Gets a readable format string that describe the specified method- Parameters:
m- displayed method- Returns:
- readable format string that describe the specified method
- Since:
- 7.1
-
getMappingMethodDescriptor
Returns the cross instance/platform mapping table of desired class with method descriptors(method hash). Key: String method descriptor (method hash) Value: Method instance of provided class.
The method descriptor generates- Parameters:
clazz- the class to get mapping descriptors from.- Returns:
- the mapping descriptor table.
-
isRemoteProxy
- Returns:
- true if the specified object is a proxy to a remote stub
- Since:
- 7.1
-
getServicePlatformLogicalVersion
-
getConnectionEndpointDetails
-
initNewSocketProperties
- Throws:
SocketException
-
getAndSetSocketTimeout
public static int getAndSetSocketTimeout(SocketChannel sockChannel, int timeout) throws SocketException With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. Default is zero (indefinite).- Returns:
- the previous timeout associated with this socket.
- Throws:
SocketException
-
getTrafficString
-