/** * Returns the result of the background initialization. This method blocks * until initialization is complete. If the background processing caused a * runtime exception, it is directly thrown by this method. Checked * exceptions, including {@code InterruptedException} are wrapped in a * {@link ConcurrentException}. Calling this method before {@link #start()} * was called causes an {@code IllegalStateException} exception to be * thrown. * * @return the object produced by this initializer * @throws ConcurrentException if a checked exception occurred during * background processing * @throws IllegalStateException if {@link #start()} has not been called */ @Override public T get() throws ConcurrentException { try { return getFuture().get(); } catch (final ExecutionException execex) { ConcurrentUtils.handleCause(execex); return null; // should not be reached } catch (final InterruptedException iex) { // reset interrupted state Thread.currentThread().interrupt(); throw new ConcurrentException(iex); } }
/** * Returns the result of the background initialization. This method blocks * until initialization is complete. If the background processing caused a * runtime exception, it is directly thrown by this method. Checked * exceptions, including {@code InterruptedException} are wrapped in a * {@link ConcurrentException}. Calling this method before {@link #start()} * was called causes an {@code IllegalStateException} exception to be * thrown. * * @return the object produced by this initializer * @throws ConcurrentException if a checked exception occurred during * background processing * @throws IllegalStateException if {@link #start()} has not been called */ @Override public T get() throws ConcurrentException { try { return getFuture().get(); } catch (final ExecutionException execex) { ConcurrentUtils.handleCause(execex); return null; // should not be reached } catch (final InterruptedException iex) { // reset interrupted state Thread.currentThread().interrupt(); throw new ConcurrentException(iex); } }
/** * Returns the result of the background initialization. This method blocks * until initialization is complete. If the background processing caused a * runtime exception, it is directly thrown by this method. Checked * exceptions, including {@code InterruptedException} are wrapped in a * {@link ConcurrentException}. Calling this method before {@link #start()} * was called causes an {@code IllegalStateException} exception to be * thrown. * * @return the object produced by this initializer * @throws ConcurrentException if a checked exception occurred during * background processing * @throws IllegalStateException if {@link #start()} has not been called */ @Override public T get() throws ConcurrentException { try { return getFuture().get(); } catch (final ExecutionException execex) { ConcurrentUtils.handleCause(execex); return null; // should not be reached } catch (final InterruptedException iex) { // reset interrupted state Thread.currentThread().interrupt(); throw new ConcurrentException(iex); } }
/** * Returns the result of the background initialization. This method blocks * until initialization is complete. If the background processing caused a * runtime exception, it is directly thrown by this method. Checked * exceptions, including {@code InterruptedException} are wrapped in a * {@link ConcurrentException}. Calling this method before {@link #start()} * was called causes an {@code IllegalStateException} exception to be * thrown. * * @return the object produced by this initializer * @throws ConcurrentException if a checked exception occurred during * background processing * @throws IllegalStateException if {@link #start()} has not been called */ @Override public T get() throws ConcurrentException { try { return getFuture().get(); } catch (final ExecutionException execex) { ConcurrentUtils.handleCause(execex); return null; // should not be reached } catch (final InterruptedException iex) { // reset interrupted state Thread.currentThread().interrupt(); throw new ConcurrentException(iex); } }