/** * Returns the object wrapped by this instance. On first access the object * is created. After that it is cached and can be accessed pretty fast. * * @return the object initialized by this {@code LazyInitializer} * @throws ConcurrentException if an error occurred during initialization of * the object */ @Override public T get() throws ConcurrentException { // use a temporary variable to reduce the number of reads of the // volatile field T result = object; if (result == NO_INIT) { synchronized (this) { result = object; if (result == NO_INIT) { object = result = initialize(); } } } return result; }
private IEntityGroup getRootGroup() { try { return rootGroupInitializer.get(); } catch (ConcurrentException ce) { throw new RuntimeException("Failed to obtain the SmartLdap root group", ce); } }
private AsyncHttpClient getClient() { try { return client.get(); } catch (final ConcurrentException e) { throw new IllegalStateException("Could not initialize the AsyncHttpClient", e); } }
private IEntityGroup getRootGroup() { try { return rootGroupInitializer.get(); } catch (ConcurrentException ce) { throw new RuntimeException("Failed to obtain the SmartLdap root group", ce); } }
/** * Returns the object wrapped by this instance. On first access the object * is created. After that it is cached and can be accessed pretty fast. * * @return the object initialized by this {@code LazyInitializer} * @throws ConcurrentException if an error occurred during initialization of * the object */ @Override public T get() throws ConcurrentException { // use a temporary variable to reduce the number of reads of the // volatile field T result = object; if (result == NO_INIT) { synchronized (this) { result = object; if (result == NO_INIT) { object = result = initialize(); } } } return result; }
public static BasicMetaDataImpl getInstance() { try { return initializer.get(); } catch (ConcurrentException e) { throw new NetSuiteException("Initialization error", e); } }
/** * Returns the object wrapped by this instance. On first access the object * is created. After that it is cached and can be accessed pretty fast. * * @return the object initialized by this {@code LazyInitializer} * @throws ConcurrentException if an error occurred during initialization of * the object */ @Override public T get() throws ConcurrentException { // use a temporary variable to reduce the number of reads of the // volatile field T result = object; if (result == NO_INIT) { synchronized (this) { result = object; if (result == NO_INIT) { object = result = initialize(); } } } return result; }
public static BasicMetaDataImpl getInstance() { try { return initializer.get(); } catch (ConcurrentException e) { throw new NetSuiteException("Initialization error", e); } }
/** * Returns the object wrapped by this instance. On first access the object * is created. After that it is cached and can be accessed pretty fast. * * @return the object initialized by this {@code LazyInitializer} * @throws ConcurrentException if an error occurred during initialization of * the object */ @Override public T get() throws ConcurrentException { // use a temporary variable to reduce the number of reads of the // volatile field T result = object; if (result == NO_INIT) { synchronized (this) { result = object; if (result == NO_INIT) { object = result = initialize(); } } } return result; }
public static BasicMetaDataImpl getInstance() { try { return initializer.get(); } catch (ConcurrentException e) { throw new NetSuiteException("Initialization error", e); } }
@Nonnull @Override public Process unmarshallBusinessProcessXml(@NotNull final File file) throws UnmarshalException { Validate.notNull(file); try { if (null == this.jaxbContext) { LOG.error(String.format( "Can not unmarshall '%s' because JAXBContext has not been created.", file.getAbsolutePath() )); return null; } final Unmarshaller jaxbUnmarshaller = this.jaxbContext.get().createUnmarshaller(); return (Process) jaxbUnmarshaller.unmarshal(file); } catch (Exception e) { throw new UnmarshalException("Can not unmarshall " + file.getAbsolutePath(), e); } }
@Override public boolean hasNext() { try { PeekingIterator<Path> peekingIterator = currentIterator.get(); return peekingIterator.hasNext(); } catch (ConcurrentException e) { throw new ConfigurationException(e); } }
@Override public Path next() { if (!hasNext()) { throw new NoSuchElementException(); } try { PeekingIterator<Path> peekingIterator = currentIterator.get(); return peekingIterator.next(); } catch (ConcurrentException e) { throw new ConfigurationException(e); } }
double score = recommendationEngine.evaluate(casses.get(), splitter);