@Override public void startQueue() { if ( run ) return; executor = ExecutorFactory.newThreadPool(maxSpareThreads, maxThreads, keepAliveTime, TimeUnit.MILLISECONDS, new TcclThreadFactory("MessageDispatch15Interceptor.MessageDispatchThread")); run = true; }
public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit, ThreadFactory threadFactory) { TaskQueue taskqueue = new TaskQueue(); ThreadPoolExecutor service = new TribesThreadPoolExecutor(minThreads, maxThreads, maxIdleTime, unit,taskqueue, threadFactory); taskqueue.setParent(service); return service; }
public static int nextIndex(Member member, Member[] members) { int idx = indexOf(member,members)+1; if (idx >= members.length ) idx = ((members.length>0)?0:-1); //System.out.println("Next index:"+idx); //System.out.println("Member:"+member.getName()); //System.out.println("Members:"+toNameString(members)); return idx; }
public boolean equals(Object other) { boolean result = (other instanceof UniqueId); if ( result ) { UniqueId uid = (UniqueId)other; if ( this.id == null && uid.id == null ) result = true; else if ( this.id == null && uid.id != null ) result = false; else if ( this.id != null && uid.id == null ) result = false; else result = Arrays.equals(this.id,uid.id); }//end if return result; }
@Override public int hashCode() { if ( id == null ) return 0; return Arrays.hashCode(id); }
public static byte[] randomUUID(boolean secure) { byte[] result = new byte[UUID_LENGTH]; return randomUUID(secure,result,0); }
/** * Get a string from the underlying resource bundle and format it * with the given object argument. This argument can of course be * a String object. * * @param key The resource name * @param arg Formatting directive */ public String getString(String key, Object arg) { Object[] args = new Object[] {arg}; return getString(key, args); }
@Override protected boolean removeEldestEntry( Map.Entry<Locale,StringManager> eldest) { if (size() > (LOCALE_CACHE_SIZE - 1)) { return true; } return false; } };
public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit) { TaskQueue taskqueue = new TaskQueue(); ThreadPoolExecutor service = new TribesThreadPoolExecutor(minThreads, maxThreads, maxIdleTime, unit,taskqueue); taskqueue.setParent(service); return service; }
@Override public boolean equals(Object other) { boolean result = (other instanceof UniqueId); if ( result ) { UniqueId uid = (UniqueId)other; if ( this.id == null && uid.id == null ) result = true; else if ( this.id == null && uid.id != null ) result = false; else if ( this.id != null && uid.id == null ) result = false; else result = Arrays.equals(this.id,uid.id); }//end if return result; }
@Override public int hashCode() { if ( id == null ) return 0; return Arrays.hashCode(id); }
public static int nextIndex(Member member, Member[] members) { int idx = indexOf(member,members)+1; if (idx >= members.length ) idx = ((members.length>0)?0:-1); //System.out.println("Next index:"+idx); //System.out.println("Member:"+member.getName()); //System.out.println("Members:"+toNameString(members)); return idx; }
public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit, ThreadFactory threadFactory) { TaskQueue taskqueue = new TaskQueue(); ThreadPoolExecutor service = new TribesThreadPoolExecutor(minThreads, maxThreads, maxIdleTime, unit,taskqueue, threadFactory); taskqueue.setParent(service); return service; }
@Override public boolean equals(Object other) { boolean result = (other instanceof UniqueId); if ( result ) { UniqueId uid = (UniqueId)other; if ( this.id == null && uid.id == null ) result = true; else if ( this.id == null && uid.id != null ) result = false; else if ( this.id != null && uid.id == null ) result = false; else result = Arrays.equals(this.id,uid.id); }//end if return result; }
@Override public int hashCode() { if ( id == null ) return 0; return Arrays.hashCode(id); }
public static int nextIndex(Member member, Member[] members) { int idx = indexOf(member,members)+1; if (idx >= members.length ) idx = ((members.length>0)?0:-1); return idx; }
public static ExecutorService newThreadPool(int minThreads, int maxThreads, long maxIdleTime, TimeUnit unit) { TaskQueue taskqueue = new TaskQueue(); ThreadPoolExecutor service = new TribesThreadPoolExecutor(minThreads, maxThreads, maxIdleTime, unit,taskqueue); taskqueue.setParent(service); return service; }
@Override public boolean equals(Object other) { boolean result = (other instanceof UniqueId); if ( result ) { UniqueId uid = (UniqueId)other; if ( this.id == null && uid.id == null ) result = true; else if ( this.id == null && uid.id != null ) result = false; else if ( this.id != null && uid.id == null ) result = false; else result = Arrays.equals(this.id,uid.id); }//end if return result; }
@Override public int hashCode() { return Arrays.hashCode(this.mapContextName); }
public static int nextIndex(Member member, Member[] members) { int idx = indexOf(member,members)+1; if (idx >= members.length ) idx = ((members.length>0)?0:-1); //System.out.println("Next index:"+idx); //System.out.println("Member:"+member.getName()); //System.out.println("Members:"+toNameString(members)); return idx; }