/** * This hook method allows you to handle any exceptions being thrown by an * event listener whilst invoking a given event. * * @param aException The exception thrown by the given event listener. * @param aObserver The listener which caused the exception. * @param aEvent The event for which the exception was caused. * @param aExecutionStrategy the execution strategy */ protected void doHandleEventListenerException( Exception aException, O aObserver, EV aEvent, ExecutionStrategy aExecutionStrategy ) { warn( "Caught an unexpected exception while invoking event observer instances with strategy \"" + aExecutionStrategy + "\" with message: " + ExceptionUtility.toMessage( aException ), aException ); }
@Override public void run() { try { runInitialize(); if ( _stage != null ) { runInitialize( _stage ); } } catch ( InitializeException e ) { LOGGER.error( "Exception during initialization: " + ExceptionUtility.toMessage( e ), e ); } }
throw new CloneNotSupportedException( ExceptionUtility.toMessage( e ) );
/** * {@inheritDoc} */ @Override public String toString() { try { return toString( _encoding ); } catch ( IOException e ) { throw new HiddenException( ExceptionUtility.toMessage( e ), e ); } }
/** * Run. */ @Override public void run() { try { digest( _job ); } catch ( DigestException aException ) { if ( !(_job instanceof SignOffProxyMessage) || isOpened() ) LOGGER.warn( "Unable to digest the job \"" + _job.getClass().getName() + "\" as of a digest exception: \"" + ExceptionUtility.toMessage( aException ) + "\"", aException ); } } }
/** * Run. */ @Override public void run() { try { Object returnValue = _method.invoke( _providedObject, _argumentArray ); _returnValue = SerializeUtility.toSerializable( returnValue ); } catch ( InvocationTargetException aInvocationTargetException ) { LOGGER.warn( ExceptionUtility.toMessage( aInvocationTargetException ), aInvocationTargetException ); _returnThrowable = aInvocationTargetException.getTargetException(); } catch ( IllegalAccessException aIllegalAccessException ) { LOGGER.warn( ExceptionUtility.toMessage( aIllegalAccessException ), aIllegalAccessException ); throw new InvalidMethodRequestRuntimeException( aIllegalAccessException ); } catch ( Throwable aThrowable ) { LOGGER.warn( ExceptionUtility.toMessage( aThrowable ), aThrowable ); _returnThrowable = aThrowable; } finally { _hasResult = true; synchronized ( this ) { notifyAll(); } } }
/** * {@inheritDoc} */ @Override public void destroy() { if ( !_isDestroyed ) { try { close(); } catch ( CloseException e ) { LOGGER.warn( "Destroying failed as of: " + ExceptionUtility.toMessage( e ), e ); } finally { _executorService.shutdownNow(); try { _transceiver.close(); } catch ( CloseException e ) { LOGGER.warn( "Destroying failed as of: " + ExceptionUtility.toMessage( e ), e ); } finally { _isDestroyed = true; } } } }
throw new IllegalStateException( ExceptionUtility.toMessage( e ), e );
/** * {@inheritDoc} */ @Override public String toEncrypted( String aInput ) throws EncryptionException { // TODO: What to do when already encrypted? if ( ForwardSecrecyUtility.hasEncryptionPattern( aInput ) ) { LOGGER.warn( "The provided text may have already been encrypted with a cipher UID beginning with \"" + aInput.substring( 0, ForwardSecrecyUtility.CIPHER_UID_TIMESTAMP_LENGTH ) + "...\"!" ); } try { return _cipherUid + Delimiter.CIPHER_UID.getChar() + _stringEncryptor.encrypt( aInput ); } catch ( EncryptionOperationNotPossibleException | EncryptionInitializationException e ) { throw new EncryptionException( ExceptionUtility.toMessage( e ), e ); } }
LOGGER.warn( "Unable to load public key from file \"" + thePublicKeyFile.getAbsolutePath() + "\": " + ExceptionUtility.toMessage( e ) ); throw e;
LOGGER.error( "Unable to load private key from file \"" + thePrivateKeyFile.getAbsolutePath() + "\": " + ExceptionUtility.toMessage( e ) + "\"" ); throw e; LOGGER.error( "Unable to intantiate private key from file \"" + thePrivateKeyFile.getAbsolutePath() + " possibly due to a \"Java Cryptography Extension (JCE)\" with limited Strength (in that case please update to \"Java Cryptography Extension (JCE) Unlimited Strength\") \": " + ExceptionUtility.toMessage( e ) + "\"" );
/** * Run initialize. * * @param aContext the context * @throws ConfigureException the configure exception */ private void runInitialize( Stage aContext ) throws ConfigureException { try { if ( _stage != aContext ) { if ( _stageHandler != null ) { _stageHandler.dispose(); } _stage = aContext; _stageHandler = new ResizeEventHandler( _stage ); } fxResizeStage(); } catch ( Exception e ) { throw new ConfigureException( aContext, "Exception during initialization: " + ExceptionUtility.toMessage( e ), e ); } }
LOGGER.warn( "Unable to close the malfunctioning connection: " + ExceptionUtility.toMessage( e ), e ); LOGGER.warn( "Caught an exception in daemon while reading jobs from the transceiver (receiver); the connection status is " + getConnectionStatus() + " (will get closed if not already); the transceiver's connection status is " + getConnectionStatus() + ": " + ExceptionUtility.toMessage( aException ), aException ); throw new HiddenException( aException );
LOGGER.error( ExceptionUtility.toMessage( e ), e ); throw new HiddenException( e );
/** * To encoded text. * * @param aTrailingBytes the trailing bytes * @throws OpenException the open exception */ private void toEncodedText( int aTrailingBytes ) throws OpenException { int theWord = toWord( _buffer, 0, _baseCodecMetrics ); theWord <<= (BITS_PER_BYTE * (BYTES_PER_INT - _baseCodecMetrics.getBytesPerInt())); for ( int i = 0; i < _baseCodecMetrics.getDigitsPerInt() - aTrailingBytes; i++ ) { int eByte = (theWord >> (BITS_PER_INT - _baseCodecMetrics.getBitsPerDigit())) & _baseCodecMetrics.getDigitMask(); try { _byteSender.writeDatagram( (byte) (_baseCodecMetrics.toChar( eByte ) & 0xFF) ); } catch ( IOException e ) { throw new OpenException( "Unable to write to the provided output stream <" + _byteSender + ">: " + ExceptionUtility.toMessage( e ), e ); } theWord <<= _baseCodecMetrics.getBitsPerDigit(); } }
warn( "Unable to close malfunctioning connection as of: " + ExceptionUtility.toMessage( e ), e );
throw new OpenException( "Unable to read from the provided receiver <" + _byteReceiver + ">: " + ExceptionUtility.toMessage( e ), e );
throw new InitializeException( "Exception during initialization: " + ExceptionUtility.toMessage( e ), e );
/** * {@inheritDoc} */ @Override public CipherVersion next() { CipherVersion eCipherVersion = null; RetryCounter theRetryCounter = new RetryCounterImpl( RetryCount.NORM.getNumber(), LoopSleepTime.MIN.getMilliseconds() ); while ( theRetryCounter.nextRetry() ) { try { eCipherVersion = _cipherVersionGenerator.next(); // ------------------------------------------------------------- // Hotspot for persisting the cipher in a DB or a storage using // some kind of asymmetric encryption mechanism // ------------------------------------------------------------- _encryptionServer.addCipherVersion( _namespace, toEncryptedCipherVersion( eCipherVersion ) ); return eCipherVersion; } catch ( CipherUidAlreadyInUseException e ) { if ( !theRetryCounter.hasNextRetry() ) { // @formatter:off LOGGER.warn( "Failed to add a cipher UID \"" + eCipherVersion.getUniversalId() + "\", retry count is <" + theRetryCounter.getRetryCount() + "> of <" + theRetryCounter.getRetryNumber() + "> (waiting for <" + ( theRetryCounter.getNextRetryDelayInMs() / 1000 ) + "> seconds before next retry): \"" + ExceptionUtility.toMessage( e ) + "\"" ); // @formatter:on } } } throw new UnexpectedForwardSecrecyRuntimeException( "Unable to generate a Chipher-Version within <" + theRetryCounter.getRetryNumber() + "> tries, aborting as else we might loop infinte time!" ); }