Class PortalContextUtil

java.lang.Object
com.portal.pcm.PortalContextUtil

public class PortalContextUtil extends Object
A Utility class that maps socket channel and related portal context objects. Used during asynchronous mode of opcode processing.
  • Method Details

    • getInstance

      public static PortalContextUtil getInstance()
    • addSocketChannelAsActive

      public final void addSocketChannelAsActive(SocketChannel sc, PortalContext pc)
      adds the socket channel to the map
      Parameters:
      sc - socket channel object
      pc - portal context object
    • removeActiveSocketChannel

      public final PortalContext removeActiveSocketChannel(SocketChannel sc)
      remove the socket channel from the map
      Parameters:
      sc - socket channel object
      Returns:
      portal context
    • removeStaleChannel

      public final void removeStaleChannel(PortalContext pc)
      removed the stale socket channel object
      Parameters:
      pc - portal context
    • isAnySocketChannelActive

      public final boolean isAnySocketChannelActive()
      check if any of the socket channel has been mapped to the portal context object.
      Returns:
      true is map is not empty
    • getRelatedPortalContext

      public PortalContext getRelatedPortalContext(SocketChannel sc)
      read the map to get related portal context object
      Parameters:
      sc - socket channel object
      Returns:
      portal context