var obj = { outStream: new BufferList() }; var spawn = require('child_process').spawn' var child = spawn('gm', ['convert'], { stdio: ['pipe', obj.outStream, 'ignore'] });
/** Add a row to be held in the buffer. If the buffer is full the oldest one will be removed. */ public synchronized void addRow(Object[] row) { addRow((Object)row); }
/** * Set the number of Exceptions that can be stored in the buffer before the oldest entries must * be removed. A value of 0 will disable the collection of Exceptions in the buffer. Note if * MonProxy is disabled exceptions will also not be put in the buffer. * */ public synchronized void setBufferSize(int newBufferSize) { if (bufferSize>newBufferSize) resetBuffer(reduceBuffer(newBufferSize)); bufferSize=newBufferSize; }
private Object[] getAllRows(BufferList bufferList) { Object[] bufferListArray=null; synchronized(bufferList) { if (bufferList.getRowCount()>0) { bufferListArray=bufferList.getCollection().toArray(); } } return bufferListArray; }
public JAMonListener copy() { return new JAMonBufferListener(getName(), new BufferList(getHeader(), list.getBufferSize())); }
public Object[][] getData() { Object[][] data=list.getData(); for (int i=0;i<list.getRowCount();i++) { if (data[i][0] instanceof JAMonDetailRow) data[i]=((JAMonDetailRow)data[i][0]).getJAMonDetailRow(); } return data; }
/** Get the header that can be used to display the SQL buffer */ public String[] getSQLDetailHeader() { return params.sqlBuffer.getHeader(); }
/** Return true if the bufferList is empty */ public boolean isEmpty() { return getRowCount()==0; }
/** * Get the number of SQL statements that can be stored in the buffer before the * oldest entries must be removed. */ public int getSQLBufferSize() { return params.sqlBuffer.getBufferSize(); }
/** Get the sql buffer as an array, so it can be displayed */ public static Object[][] getSQLDetail() { return params.sqlBuffer.getData(); }
public boolean isEmpty() { return list.isEmpty(); }
public static void main(String[] args) { put(new CompositeListener("tester")); put(new JAMonBufferListener("helloListener", new BufferList(new String[]{"hey"},200))); String[] header=getHeader(); Object[][] data=getData(); for (int i=0;i<data.length;i++) for (int j=0;j<data[i].length;j++) System.out.println(header[j]+"="+data[i][j]); System.out.println("\ngetting listener="+get("JAMonBufferListener")); JAMonBufferListener jbl=(JAMonBufferListener)get("helloListener"); System.out.println("name="+jbl.getName()+", buffer="+jbl.getBufferList().getBufferSize()); }
/** * Set the number of Exceptions that can be stored in the buffer before the oldest entries must * be removed. A value of 0 will disable the collection of Exceptions in the buffer. Note if * MonProxy is disabled exceptions will also not be put in the buffer. * */ public synchronized void setBufferSize(int newBufferSize) { if (bufferSize>newBufferSize) resetBuffer(reduceBuffer(newBufferSize)); bufferSize=newBufferSize; }
/** Get the header that can be used to display the Exceptions buffer */ public static String[] getExceptionDetailHeader() { return params.exceptionBuffer.getHeader(); }
public boolean isEmpty() { return getRowCount()==0; }
/** * Get the number of SQL statements that can be stored in the buffer before the * oldest entries must be removed. * */ public static int getSQLBufferSize() { return params.sqlBuffer.getBufferSize(); }
/** Get the exception buffer as an array, so it can be displayed */ public static Object[][] getExceptionDetail() { return params.exceptionBuffer.getData(); }
/** Return true if the bufferList has data */ public boolean hasData() { return !isEmpty(); }
/** Pass in the jamonListener name */ public JAMonBufferListener(String name){ this(name, new BufferList(new String[] {"Label","Value","Active","Date"},50)); }