/** Starts a task immediately. * @param pTask The task being started. * @return True, if the task could be started immediately. False, if * the maxmimum number of concurrent tasks was exceeded. If so, you * might consider to use the {@link #addTask(ThreadPool.Task)} method instead. */ public boolean startTask(Task pTask) { final Poolable poolable = getPoolable(pTask, false); if (poolable == null) { return false; } poolable.start(pTask); return true; }
protected XMLReader newXMLReader() throws XmlRpcException { return SAXParsers.newXMLReader(); }
public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { final Object cal; if (pCalendar != null && pCalendar instanceof Date) { Calendar calendar = Calendar.getInstance(getTimeZone()); calendar.setTime((Date) pCalendar); cal = calendar; } else { cal = pCalendar; } return super.format(cal, pBuffer, pPos); }
public InputStream newInputStream() throws IOException { int contentLength = requestData.getContentLength(); if (contentLength == -1) { return input; } else { return new LimitedInputStream(input, contentLength); } }
/** Closes the pool. */ public synchronized void shutdown() { while (!waitingThreads.isEmpty()) { Poolable poolable = (Poolable) waitingThreads.remove(waitingThreads.size()-1); poolable.shutdown(); } while (!runningThreads.isEmpty()) { Poolable poolable = (Poolable) runningThreads.remove(runningThreads.size()-1); poolable.shutdown(); } }
protected XMLReader newXMLReader() throws XmlRpcException { return SAXParsers.newXMLReader(); }
/** Adds a task for immediate or deferred execution. * @param pTask The task being added. * @return True, if the task was started immediately. False, if * the task will be executed later. * @deprecated No longer in use. */ public boolean addTask(Task pTask) { final Poolable poolable = getPoolable(pTask, true); if (poolable != null) { poolable.start(pTask); return true; } return false; }
public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { final Object cal; if (pCalendar != null && pCalendar instanceof Date) { Calendar calendar = Calendar.getInstance(getTimeZone()); calendar.setTime((Date) pCalendar); cal = calendar; } else { cal = pCalendar; } return super.format(cal, pBuffer, pPos); }
/** Closes the pool. */ public synchronized void shutdown() { while (!waitingThreads.isEmpty()) { Poolable poolable = (Poolable) waitingThreads.remove(waitingThreads.size()-1); poolable.shutdown(); } while (!runningThreads.isEmpty()) { Poolable poolable = (Poolable) runningThreads.remove(runningThreads.size()-1); poolable.shutdown(); } }
protected XMLReader newXMLReader() throws XmlRpcException { return SAXParsers.newXMLReader(); }
/** Starts a task immediately. * @param pTask The task being started. * @return True, if the task could be started immediately. False, if * the maxmimum number of concurrent tasks was exceeded. If so, you * might consider to use the {@link #addTask(ThreadPool.Task)} method instead. */ public boolean startTask(Task pTask) { final Poolable poolable = getPoolable(pTask, false); if (poolable == null) { return false; } poolable.start(pTask); return true; }
public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { final Object cal; if (pCalendar != null && pCalendar instanceof Date) { Calendar calendar = Calendar.getInstance(getTimeZone()); calendar.setTime((Date) pCalendar); cal = calendar; } else { cal = pCalendar; } return super.format(cal, pBuffer, pPos); }
protected XMLReader newXMLReader() throws XmlRpcException { return SAXParsers.newXMLReader(); }
/** Starts a task immediately. * @param pTask The task being started. * @return True, if the task could be started immediately. False, if * the maxmimum number of concurrent tasks was exceeded. If so, you * might consider to use the {@link #addTask(ThreadPool.Task)} method instead. */ public boolean startTask(Task pTask) { final Poolable poolable = getPoolable(pTask, false); if (poolable == null) { return false; } poolable.start(pTask); return true; }
protected XMLReader newXMLReader() throws XmlRpcException { return SAXParsers.newXMLReader(); }
/** Adds a task for immediate or deferred execution. * @param pTask The task being added. * @return True, if the task was started immediately. False, if * the task will be executed later. * @deprecated No longer in use. */ public boolean addTask(Task pTask) { final Poolable poolable = getPoolable(pTask, true); if (poolable != null) { poolable.start(pTask); return true; } return false; }
/** Adds a task for immediate or deferred execution. * @param pTask The task being added. * @return True, if the task was started immediately. False, if * the task will be executed later. * @deprecated No longer in use. */ public boolean addTask(Task pTask) { final Poolable poolable = getPoolable(pTask, true); if (poolable != null) { poolable.start(pTask); return true; } return false; }