Class LRMIUtilities

java.lang.Object
com.gigaspaces.lrmi.LRMIUtilities

public class LRMIUtilities extends Object
This utility class provides a common Transport Protocol utilities methods.
Since:
4.0
Author:
Igor Goldenberg
See Also:
  • 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

      public static final Integer TRAFFIC_CLASS
    • READ_BLOCK_TIMEOUT

      public static final int READ_BLOCK_TIMEOUT
  • Constructor Details

    • LRMIUtilities

      public LRMIUtilities()
  • Method Details

    • getProxyInterfaces

      public static Class<?>[] getProxyInterfaces(Class<?> claz)
      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

      public static List<Class<?>> getDeclaredRemoteInterfaces(Class<?> claz)
      Returns a list of all java.rmi.Remote interfaces implemented supplied class.
      Parameters:
      claz - The class to get all java.rmi.Remote interfaces.
    • getDeclaredInterfaces

      public static List<Class<?>> getDeclaredInterfaces(Class claz, Class... assignableClasses)
      Returns an array of all declared interfaces of desired class (super-classes comes an account). If assignableClasses is null all 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

      public static String getMethodNameAndDescriptor(IMethod m)
      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

      public static String getMethodDisplayString(IMethod m)
      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

      public static Map<String,IMethod> getMappingMethodDescriptor(Class clazz)
      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

      public static boolean isRemoteProxy(Object obj)
      Returns:
      true if the specified object is a proxy to a remote stub
      Since:
      7.1
    • getServicePlatformLogicalVersion

      public static PlatformLogicalVersion getServicePlatformLogicalVersion(Object obj)
    • getConnectionEndpointDetails

      public static ConnectionEndpointDetails getConnectionEndpointDetails(Object obj)
    • initNewSocketProperties

      public static void initNewSocketProperties(SocketChannel sockChannel) throws SocketException
      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

      public static String getTrafficString(long bytes)