Skip to content

Commit

Permalink
Some more javadoc added
Browse files Browse the repository at this point in the history
  • Loading branch information
elecharny committed Apr 10, 2022
1 parent 8ec921a commit e70fa13
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,32 @@
*/
package org.apache.mina.filter.executor;

import org.apache.mina.core.session.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;
import java.util.concurrent.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

import org.apache.mina.core.session.AttributeKey;
import org.apache.mina.core.session.DummySession;
import org.apache.mina.core.session.IoEvent;
import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* A {@link ThreadPoolExecutor} that maintains the order of {@link IoEvent}s
* within a session (similar to {@link OrderedThreadPoolExecutor}) and allows
Expand Down Expand Up @@ -100,19 +117,23 @@ public PriorityThreadPoolExecutor() {
* Creates a default ThreadPool, with default values : - minimum pool size is 0
* - maximum pool size is 16 - keepAlive set to 30 seconds - A default
* ThreadFactory - All events are accepted
*
* @param comparator The comparator used to prioritize the queue
*/
public PriorityThreadPoolExecutor(Comparator<IoSession> comparator) {
this(DEFAULT_INITIAL_THREAD_POOL_SIZE, DEFAULT_MAX_THREAD_POOL, DEFAULT_KEEP_ALIVE, TimeUnit.SECONDS,
Executors.defaultThreadFactory(), null, comparator);
}

/**
* Creates a default ThreadPool, with default values : - minimum pool size is 0
* - keepAlive set to 30 seconds - A default ThreadFactory - All events are
* accepted
* Creates a default ThreadPool, with default values :
* <ul>
* <li>minimum pool size is 0</li>
* <li>keepAlive set to 30 seconds</li>
* <li>A default ThreadFactory - All events are accepted</li>
* </ul>
*
* @param maximumPoolSize
* The maximum pool size
* @param maximumPoolSize The maximum pool size
*/
public PriorityThreadPoolExecutor(int maximumPoolSize) {
this(DEFAULT_INITIAL_THREAD_POOL_SIZE, maximumPoolSize, DEFAULT_KEEP_ALIVE, TimeUnit.SECONDS,
Expand Down Expand Up @@ -186,16 +207,11 @@ public PriorityThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long ke
/**
* Creates a default ThreadPool, with default values : - A default ThreadFactory
*
* @param corePoolSize
* The initial pool sizePoolSize
* @param maximumPoolSize
* The maximum pool size
* @param keepAliveTime
* Default duration for a thread
* @param unit
* Time unit used for the keepAlive value
* @param threadFactory
* The factory used to create threads
* @param corePoolSize The initial pool sizePoolSize
* @param maximumPoolSize The maximum pool size
* @param keepAliveTime Default duration for a thread
* @param unit Time unit used for the keepAlive value
* @param threadFactory The factory used to create threads
*/
public PriorityThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
ThreadFactory threadFactory) {
Expand All @@ -205,18 +221,13 @@ public PriorityThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long ke
/**
* Creates a new instance of a PrioritisedOrderedThreadPoolExecutor.
*
* @param corePoolSize
* The initial pool sizePoolSize
* @param maximumPoolSize
* The maximum pool size
* @param keepAliveTime
* Default duration for a thread
* @param unit
* Time unit used for the keepAlive value
* @param threadFactory
* The factory used to create threads
* @param eventQueueHandler
* The queue used to store events
* @param corePoolSize The initial pool sizePoolSize
* @param maximumPoolSize The maximum pool size
* @param keepAliveTime Default duration for a thread
* @param unit Time unit used for the keepAlive value
* @param threadFactory The factory used to create threads
* @param eventQueueHandler The queue used to store events
* @param comparator The comparator used to prioritize the queue
*/
public PriorityThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
ThreadFactory threadFactory, IoEventQueueHandler eventQueueHandler, Comparator<IoSession> comparator) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.slf4j.LoggerFactory;

/**
* Default interface for SSL exposed to the {@link SSLFilter}
* Default interface for SSL exposed to the {@link SslFilter}
*
* @author Jonathan Valliere
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* {@link org.apache.mina.core.service.IoProcessor} but this is not always possible
* if a filter is being used that needs to modify the contents of the file
* before sending over the network (i.e. the
* {@link org.apache.mina.filter.ssl.SSLFilter} or a data compression filter.)
* {@link org.apache.mina.filter.ssl.SslFilter} or a data compression filter.)
* </p>
* <p> This filter will ignore written messages which aren't {@link FileRegion}
* instances. Such messages will be passed to the next filter directly.
Expand Down

0 comments on commit e70fa13

Please sign in to comment.