/** * Retrieves the {@link Class} type to which the {@link StackTraceElement} * belongs. * * @param aStackTraceElement The {@link StackTraceElement} for which to get * the according {@link Class}. * * @return The type ({@link Class}) of the according * {@link StackTraceElement}. */ public static Class<?> toClass( StackTraceElement aStackTraceElement ) { try { return Class.forName( aStackTraceElement.getClassName() ); } catch ( ClassNotFoundException e ) { throw new HiddenException( e ); } }
@Override public void run() { try { close(); } catch ( CloseException e ) { throw new HiddenException( e ); } finally { theTimer.cancel(); } } }, aCloseInMillis );
/** * Opens the component by calling {@link #open(Object)} without you to * require catching an {@link OpenException}. * * @param aConnection The connection used for opening the connection. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void openUnchecked( CON aConnection ) { try { open( aConnection ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Initialize the component by calling {@link #initialize(Object)} without * you to require catching an {@link InitializeException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link InitializeException} exception */ default void initializeUnchecked( H aHandle ) { try { initialize( aHandle ); } catch ( InitializeException e ) { throw new HiddenException( e ); } }
/** * Initializes the component by calling {@link #initialize(Object)} without * you to require catching an {@link ConfigureException}. * * @param aContext The context to be passed to the implementing instance. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link ConfigureException} exception */ default void initializeUnchecked( CTX aContext ) { try { initialize( aContext ); } catch ( InitializeException e ) { throw new HiddenException( e ); } }
/** * Resumes the component by calling {@link #resume(Object)} without you to * require catching an {@link ResumeException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link ResumeException} exception */ default void resumeUnchecked( H aHandle ) { try { resume( aHandle ); } catch ( ResumeException e ) { throw new HiddenException( e ); } }
/** * Flushes the component by calling {@link #flush(Object)} without you to * require catching a {@link OpenException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void flushUnchecked( H aHandle ) { try { flush( aHandle ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Closes the component by calling {@link #close(Object)} without you to * require catching an {@link CloseException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link CloseException} exception */ default void closeUnchecked( H aHandle ) { try { close( aHandle ); } catch ( CloseException e ) { throw new HiddenException( e ); } }
/** * Starts the component by calling {@link #start(Object)} without you to * require catching an {@link StartException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link StartException} exception */ default void startUnchecked( H aHandle ) { try { start( aHandle ); } catch ( StartException e ) { throw new HiddenException( e ); } }
/** * Stops the component by calling {@link #stop(Object)} without you to * require catching an {@link StopException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link StopException} exception */ default void stopUnchecked( H aHandle ) { try { stop( aHandle ); } catch ( StopException e ) { throw new HiddenException( e ); } }
/** * Opens the component by calling {@link #open(Object)} without you to * require catching an {@link OpenException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void openUnchecked( H aHandle ) { try { open( aHandle ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Digests the job by calling {@link #digest(Object)} without you to require * catching a {@link DigestException}. * * @param aJob The job to be digested. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link DigestException} exception */ default void digestUnchecked( J aJob ) { try { digest( aJob ); } catch ( DigestException e ) { throw new HiddenException( e ); } } }
/** * Pauses the component by calling {@link #pause(Object)} without you to * require catching an {@link PauseException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link PauseException} exception */ default void pauseUnchecked( H aHandle ) { try { pause( aHandle ); } catch ( PauseException e ) { throw new HiddenException( e ); } }
/** * Reloads the (state of the) component by calling {@link #reload(Object)} * without you to require catching a {@link OpenException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void reloadUnchecked( H aHandle ) { try { reload( aHandle ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Initializes the component by calling {@link #initialize(Object, Object)} * without you to require catching an {@link ConfigureException}. * * @param aHandle The handle identifying the component. * * @param aContext The context to be passed to the implementing instance. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link ConfigureException} exception */ default void initializeUnchecked( H aHandle, CTX aContext ) { try { initialize( aHandle, aContext ); } catch ( ConfigureException e ) { throw new HiddenException( e ); } }
/** * Opens the component by calling {@link #withOpen(Object)} without you * to require catching an {@link OpenException}. * * @param aConnection The connection used for opening the connection. * * @return The instance to be returned on which to apply succeeding * builder operations. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default B withOpenUnchecked( CON aConnection ) { try { return withOpen( aConnection ); } catch ( OpenException e ) { throw new HiddenException( e ); } } }
/** * Opens the component by calling {@link #open(Object, Object)} without you * to require catching an {@link OpenException}. * * @param aHandle The handle identifying the component. * * @param aConnection The connection to be passed to the implementing * instance. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void openUnchecked( H aHandle, CON aConnection ) { try { open( aHandle, aConnection ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Initializes the component by calling {@link #withInitialize(Object)} * without you to require catching an {@link ConfigureException}. * * @param aContext The context to be passed to the implementing * instance. * * @return The instance to be returned on which to apply succeeding * builder operations. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link ConfigureException} exception */ default B withInitializeUnchecked( CTX aContext ) { try { return withInitialize( aContext ); } catch ( ConfigureException e ) { throw new HiddenException( e ); } } }
/** * Helper method for decomposing all {@link Decomposeable} {@link Component} * instances found in the provided {@link Collection}. The strategy with * which the {@link Component} instances are processed is defined with the * provided {@link ExecutionStrategy}. An {@link ExecutorService} can be * provided in case some EJB container is to use a managed * {@link ExecutorService} provided by an EJB server. * * @param aComponentExecutionStrategy The strategy to use when decomposing * the {@link Component} instances. * @param aExecutorService The {@link ExecutorService} to use when creating * threads, required in case an {@link ExecutionStrategy#PARALLEL} or * {@link ExecutionStrategy#JOIN} is used. * @param aComponents The {@link Collection} containing the * {@link Component} instances to process (in case them implement the * required interface). */ public static void decompose( ExecutionStrategy aComponentExecutionStrategy, ExecutorService aExecutorService, Collection<?> aComponents ) { try { execute( aComponentExecutionStrategy, aExecutorService, _decomposeCallableFactoryImpl, aComponents, (Object[]) null ); } catch ( Exception e ) { throw new HiddenException( e ); } }
/** * Helper method for destroying all {@link Destroyable} {@link Component} * instances found in the provided {@link Collection}. The strategy with * which the {@link Component} instances are processed is defined with the * provided {@link ExecutionStrategy}. An {@link ExecutorService} can be * provided in case some EJB container is to use a managed * {@link ExecutorService} provided by an EJB server. * * @param aComponentExecutionStrategy The strategy to use when destroying * the {@link Component} instances. * @param aExecutorService The {@link ExecutorService} to use when creating * threads, required in case an {@link ExecutionStrategy#PARALLEL} or * {@link ExecutionStrategy#JOIN} is used. * @param aComponents The {@link Collection} containing the * {@link Component} instances to process (in case them implement the * required interface). */ public static void destroy( ExecutionStrategy aComponentExecutionStrategy, ExecutorService aExecutorService, Collection<?> aComponents ) { try { execute( aComponentExecutionStrategy, aExecutorService, _destroyCallableFactoryImpl, aComponents, (Object[]) null ); } catch ( Exception e ) { throw new HiddenException( e ); } }