/** * Gets the instance attribute of the LateralCacheTCPListener class. * <p> * @param ilca ITCPLateralCacheAttributes * @param cacheMgr * @return The instance value */ public synchronized static <K, V> LateralTCPListener<K, V> getInstance( ITCPLateralCacheAttributes ilca, ICompositeCacheManager cacheMgr ) { @SuppressWarnings("unchecked") // Need to cast because of common map for all instances LateralTCPListener<K, V> ins = (LateralTCPListener<K, V>) instances.get( String.valueOf( ilca.getTcpListenerPort() ) ); if ( ins == null ) { ins = new LateralTCPListener<K, V>( ilca ); ins.init(); ins.setCacheManager( cacheMgr ); instances.put( String.valueOf( ilca.getTcpListenerPort() ), ins ); if ( log.isInfoEnabled() ) { log.info( "Created new listener " + ilca.getTcpListenerPort() ); } } return ins; }
/** * Gets the instance attribute of the LateralCacheTCPListener class. * <p> * @param ilca ITCPLateralCacheAttributes * @param cacheMgr * @return The instance value */ public synchronized static <K, V> LateralTCPListener<K, V> getInstance( ITCPLateralCacheAttributes ilca, ICompositeCacheManager cacheMgr ) { @SuppressWarnings("unchecked") // Need to cast because of common map for all instances LateralTCPListener<K, V> ins = (LateralTCPListener<K, V>) instances.get( String.valueOf( ilca.getTcpListenerPort() ) ); if ( ins == null ) { ins = new LateralTCPListener<K, V>( ilca ); ins.init(); ins.setCacheManager( cacheMgr ); instances.put( String.valueOf( ilca.getTcpListenerPort() ), ins ); if ( log.isInfoEnabled() ) { log.info( "Created new listener " + ilca.getTcpListenerPort() ); } } return ins; }