Package com.portal.pcm
Class PortalContextUtil
java.lang.Object
com.portal.pcm.PortalContextUtil
A Utility class that maps socket channel and related portal context objects.
Used during asynchronous mode of opcode processing.
-
Method Summary
Modifier and TypeMethodDescriptionfinal voidadds the socket channel to the mapstatic PortalContextUtilread the map to get related portal context objectfinal booleancheck if any of the socket channel has been mapped to the portal context object.final PortalContextremove the socket channel from the mapfinal voidremoved the stale socket channel object
-
Method Details
-
getInstance
-
addSocketChannelAsActive
adds the socket channel to the map- Parameters:
sc- socket channel objectpc- portal context object
-
removeActiveSocketChannel
remove the socket channel from the map- Parameters:
sc- socket channel object- Returns:
- portal context
-
removeStaleChannel
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
read the map to get related portal context object- Parameters:
sc- socket channel object- Returns:
- portal context
-