/** * Log the message with the associated Throwable object at a error logging level. * * @param message the message * @param e the e */ public void logError( String message, Throwable e ) { log.logError( message, e ); }
/** * Log the message at a error logging level. * * @param message the message */ public void logError( String message ) { log.logError( message ); }
/** * Log the message with arguments at a error logging level. * * @param message the message * @param arguments the arguments */ public void logError( String message, Object... arguments ) { log.logError( message, arguments ); }
public void logError( String message ) { log.logError( message ); }
public void logError( String message, Object... arguments ) { log.logError( message, arguments ); }
public void logError( String message ) { log.logError( message ); }
public void logError( String message, Throwable e ) { log.logError( message, e ); }
public static byte[] encryptUsingKey( byte[] data, Key key ) { byte[] result = null; try { Cipher cipher = Cipher.getInstance( PUBLIC_KEY_ALGORITHM ); cipher.init( Cipher.ENCRYPT_MODE, key ); result = cipher.doFinal( data ); } catch ( Exception ex ) { log.logError( ex.getLocalizedMessage(), ex ); } return result; }
public static KeyPair generateKeyPair() { KeyPair pair = null; try { KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance( PUBLIC_KEY_ALGORITHM ); keyPairGen.initialize( KEY_SIZE ); pair = keyPairGen.generateKeyPair(); } catch ( Exception ex ) { log.logError( ex.getLocalizedMessage(), ex ); } return pair; }
public static byte[] decryptUsingKey( byte[] data, Key key ) { byte[] result = null; try { Cipher cipher = Cipher.getInstance( PUBLIC_KEY_ALGORITHM ); cipher.init( Cipher.DECRYPT_MODE, key ); result = cipher.doFinal( data ); } catch ( Exception ex ) { log.logError( ex.getLocalizedMessage(), ex ); } return result; } }
/** * Marks the source paused (if not already) and acquires the permit, which will cause acceptRows to block. */ @Override public synchronized void pause() { if ( !paused.getAndSet( true ) ) { try { assert acceptingRowsSemaphore.availablePermits() == 1; acceptingRowsSemaphore.acquire(); } catch ( InterruptedException e ) { logChannel.logError( getString( PKG, "BlockingQueueStream.PauseInterrupt" ) ); } } }
default void logError( final String message, final Exception exception ) { getLogChannel().logError( message, exception ); }
default void logError( final String message ) { getLogChannel().logError( message ); }
public BaseStepXulDialog( String xulFile, Shell parent, BaseStepMeta baseStepMeta, TransMeta transMeta, String stepname ) { super( xulFile, parent, baseStepMeta, transMeta, stepname ); this.backupChanged = baseStepMeta.hasChanged(); this.props = PropsUI.getInstance(); try { initializeXul(); } catch ( Exception e ) { e.printStackTrace(); log.logError( "Error initializing (" + stepname + ") step dialog", e ); throw new IllegalStateException( "Cannot load dialog due to error in initialization", e ); } }
public AbstractPreviewRowsXulDialog( Object parent, BaseStepMeta stepMeta, int maxRows ) { this.xulFile = "org/pentaho/di/ui/xul/common/preview/xul/preview_rows.xul"; this.parent = parent; this.meta = stepMeta; this.maxRows = maxRows; log = new LogChannel( "Row Preview" ); try { initializeXul(); progressMeter = (XulProgressmeter) document.getElementById( "progress" ); } catch ( Exception e ) { log.logError( "Error initializing dialog...", e ); throw new IllegalStateException( "Cannot load dialog due to error in initialization.", e ); } }
@Test @SuppressWarnings ( "unchecked" ) public void errorLoggedIfInterruptedInAcceptRows() throws InterruptedException { streamSource.acceptingRowsSemaphore = semaphore; streamSource.logChannel = logChannel; doThrow( new InterruptedException( "interrupt" ) ) .when( semaphore ).acquire(); streamSource.acceptRows( singletonList( "new row" ) ); verify( logChannel ).logError( any() ); verify( semaphore ).release(); }
@Test @SuppressWarnings ( "unchecked" ) public void errorLoggedIfInterruptedInPause() throws InterruptedException { streamSource.acceptingRowsSemaphore = semaphore; when( semaphore.availablePermits() ).thenReturn( 1 ); streamSource.logChannel = logChannel; doThrow( new InterruptedException( "interrupt" ) ) .when( semaphore ).acquire(); streamSource.pause(); verify( logChannel ).logError( any() ); }
private void buildSnippitList( Document doc ) { List<Node> nodes = XMLHandler.getNodes( XMLHandler.getSubNode( doc, "codeSnippits" ), "codeSnippit" ); for ( Node node : nodes ) { Snippit snippit = new Snippit( Category.valueOf( XMLHandler.getTagValue( node, "category" ) ), XMLHandler.getTagValue( node, "name" ), XMLHandler.getTagValue( node, "sample" ), XMLHandler.getTagValue( node, "code" ) ); snippits.add( snippit ); Snippit oldSnippit = snippitsMap.put( snippit.name, snippit ); if ( oldSnippit != null ) { log.logError( "Multiple code snippits for name: " + snippit.name ); } } } }
public void showMessage( final String message, final String title ) { try { final XulMessageBox msg = (XulMessageBox) document.createElement( "messagebox" ); msg.setModalParent( modalParent ); msg.setTitle( title ); msg.setMessage( message ); msg.open(); } catch ( XulException e ) { log.logError( "Error displaying message: {0}", message ); } }
public int showPromptMessage( final String message, final String title, Object[] buttons ) { try { final XulMessageBox msg = (XulMessageBox) document.createElement( "messagebox" ); msg.setModalParent( modalParent ); msg.setTitle( title ); msg.setMessage( message ); msg.setButtons( buttons ); return msg.open(); } catch ( XulException e ) { log.logError( "Error displaying message: {0}", message ); } return -1; }