Java 类org.apache.commons.lang3.concurrent.ConcurrentInitializer 实例源码

项目:spring-open    文件:HazelcastRuntime.java   
/**
 * Gets the LogMapManager for given {@link SharedLogObjectID}.
 * <p/>
 * If listener was not registered, it will create and register a listener.
 *
 * @param oid {@link SharedLogObjectID}
 * @return {@link LogMapManager}
 */
private LogMapManager getLogMapManager(final SharedLogObjectID oid) {
    LogMapManager listener
        = ConcurrentUtils.createIfAbsentUnchecked(listenerMap, oid,
            new ConcurrentInitializer<LogMapManager>() {
                @Override
                public LogMapManager get() throws ConcurrentException {
                    IMap<SeqNum, LogValue> logMap = getLogMap(oid);
                    return new LogMapManager(oid, logMap);
                }
            });
    return listener;
}