/** * Logs through the servlet container logging facility. * If no HttpSession session has been started, nothing will get logged. */ public static void log (final HttpServletRequest req, final String message) { log(req, message, null); }
public Level (final String name, final Level previous) { this.name = name; this.previous = previous; this.fFilter = new DirectoryFilter(); }
static boolean isArrayByteBase64( byte[] arrayOctect ) { int length = arrayOctect.length; if ( length == 0 ) { return true; } for ( int i=0; i < length; i++ ) { if ( Base64.isBase64( arrayOctect[i] ) == false) { return false; } } return true; }
/** * Builds a monitor map with a capacity of 100 references. */ public MonitorMap () { super(); this.map = new Cache(); }
/** * Raw get from the cache. * If caching is disabled, will immediately return null. */ protected DocumentEntry getFromCache (final String key) { if (this.cache == null) return null; return (DocumentEntry)this.cache.get(key); }
/** * Returns the current size of the cache or null if the caching * of XML documents is disabled. */ protected int cacheSize () { if (this.cache == null) return -1; return this.cache.size(); }
/** * Returns the count of items currently stored in this cache. */ public int size () { return this.cache.size(); }
/** * Same as wget(d, u), but verbosity is off. * * @return true if the downloading actually happened */ public static boolean wget (final String downloadDir, final String sUrl) throws Exception { return wget(downloadDir, sUrl, false, false); }
/** * Like the get() method of a Map. */ public synchronized Object get (final Object key) { return this.cache.get(key); }
/** * Like the keySet() method of a Map. */ public java.util.Set keySet () { return this.cache.keySet(); }
public void run () { MethodJournal.this.flush(); } }).start();
/** * Like the put() method of a Map. */ public synchronized void put (final Object key, final Object value) { this.cache.put(key, value); }
/** * Like the values() method of a Map. */ public java.util.Collection values () { return this.cache.values(); }
public static byte[] objectToByteArray (Object o) throws ByteException { return objectsToByteArray(new Object[] { o }); }
/** * Like the entrySet() method of a Map. */ public java.util.Set entrySet () { return this.cache.entrySet(); }
/** * Like the remove() method of a Map. */ public synchronized Object remove (final Object key) { return this.cache.remove(key); }
/** * Launches the flushing of journallised methods in a dedicated thread */ public void flushInOwnThread () { (new Thread() { public void run () { MethodJournal.this.flush(); } }).start(); }
/** * Builds a monitor map with a given capacity. */ public MonitorMap (final int cacheSize) { super(); this.map = new Cache(cacheSize); }
/** * Logs through the servlet container logging facility. */ public static void log (final HttpSession ses, final String message) { log(ses, message, null); }
protected boolean removeEldestEntry (final java.util.Map.Entry eldest) { return (this.size() > this.capacity); } }