public static synchronized ChatStateManager getInstance ( final XMPPConnection connection ) { ChatStateManager manager = INSTANCES . get ( connection ) ; if ( manager == null ) { manager = new ChatStateManager ( connection ) ; INSTANCES . put ( connection , manager ) ; } return manager ; }
Returns the ChatStateManager related to the XMPPConnection and it will create one if it does not yet exist .