public static ReceiveListenerDispatcher getInstance ( Conversation . ConversationType convType , boolean isOnClientSide ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getInstance" , new Object [ ] { "" + convType , "" + isOnClientSide } ) ; ReceiveListenerDispatcher retInstance ; // A conversation has type CLIENT if it is an Outbound or Inbound connection from a JetStream // client. The client side RLD is different from the server side RLD, so we need the // isOnClientSide flag to distinguish them. // A conversation has type ME if it is an Outbound or Inbound connection from another ME. if ( convType == Conversation . CLIENT ) { if ( isOnClientSide ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Returning client instance" ) ; synchronized ( ReceiveListenerDispatcher . class ) { if ( clientInstance == null ) { clientInstance = new ReceiveListenerDispatcher ( true , true ) ; // Client side of ME-Client conversation } } retInstance = clientInstance ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Returning server instance" ) ; synchronized ( ReceiveListenerDispatcher . class ) { if ( serverInstance == null ) { serverInstance = new ReceiveListenerDispatcher ( false , true ) ; // ME side of ME-Client conversation } } retInstance = serverInstance ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Returning ME-ME instance" ) ; synchronized ( ReceiveListenerDispatcher . class ) { if ( meInstance == null ) { meInstance = new ReceiveListenerDispatcher ( false , false ) ; // ME-ME conversation } } retInstance = meInstance ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getInstance" , retInstance ) ; return retInstance ; }
Return a reference to the instance of this class . Used to implement the singleton design pattern .