Author: elecharny Date: Tue Jun 3 12:53:20 2008 New Revision: 662867 URL: http://svn.apache.org/viewvc?rev=662867&view=rev Log: o Added a lot of missing @{inheritDoc}
Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoConnector.java mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoService.java mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSession.java mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSessionConfig.java mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingConnectionlessIoAcceptor.java Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java?rev=662867&r1=662866&r2=662867&view=diff ============================================================================== --- mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java (original) +++ mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java Tue Jun 3 12:53:20 2008 @@ -60,6 +60,9 @@ defaultLocalAddresses.add(null); } + /** + * [EMAIL PROTECTED] + */ public SocketAddress getLocalAddress() { Set<SocketAddress> localAddresses = getLocalAddresses(); if (localAddresses.isEmpty()) { @@ -69,6 +72,9 @@ } } + /** + * [EMAIL PROTECTED] + */ public final Set<SocketAddress> getLocalAddresses() { Set<SocketAddress> localAddresses = new HashSet<SocketAddress>(); synchronized (bindLock) { @@ -77,6 +83,9 @@ return localAddresses; } + /** + * [EMAIL PROTECTED] + */ public SocketAddress getDefaultLocalAddress() { if (defaultLocalAddresses.isEmpty()) { return null; @@ -84,14 +93,23 @@ return defaultLocalAddresses.iterator().next(); } + /** + * [EMAIL PROTECTED] + */ public final void setDefaultLocalAddress(SocketAddress localAddress) { setDefaultLocalAddresses(localAddress); } + /** + * [EMAIL PROTECTED] + */ public final List<SocketAddress> getDefaultLocalAddresses() { return unmodifiableDefaultLocalAddresses; } + /** + * [EMAIL PROTECTED] + */ public final void setDefaultLocalAddresses(List<? extends SocketAddress> localAddresses) { if (localAddresses == null) { throw new NullPointerException("localAddresses"); @@ -99,6 +117,9 @@ setDefaultLocalAddresses((Iterable<? extends SocketAddress>) localAddresses); } + /** + * [EMAIL PROTECTED] + */ public final void setDefaultLocalAddresses(Iterable<? extends SocketAddress> localAddresses) { if (localAddresses == null) { throw new NullPointerException("localAddresses"); @@ -126,6 +147,9 @@ } } + /** + * [EMAIL PROTECTED] + */ public final void setDefaultLocalAddresses(SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses) { if (otherLocalAddresses == null) { otherLocalAddresses = new SocketAddress[0]; @@ -142,18 +166,30 @@ setDefaultLocalAddresses(newLocalAddresses); } + /** + * [EMAIL PROTECTED] + */ public final boolean isCloseOnDeactivation() { return disconnectOnUnbind; } + /** + * [EMAIL PROTECTED] + */ public final void setCloseOnDeactivation(boolean disconnectClientsOnUnbind) { this.disconnectOnUnbind = disconnectClientsOnUnbind; } + /** + * [EMAIL PROTECTED] + */ public final void bind() throws IOException { bind(getDefaultLocalAddresses()); } + /** + * [EMAIL PROTECTED] + */ public final void bind(SocketAddress localAddress) throws IOException { if (localAddress == null) { throw new NullPointerException("localAddress"); @@ -164,6 +200,9 @@ bind(localAddresses); } + /** + * [EMAIL PROTECTED] + */ public final void bind( SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses) throws IOException { @@ -180,6 +219,9 @@ bind(localAddresses); } + /** + * [EMAIL PROTECTED] + */ public final void bind(Iterable<? extends SocketAddress> localAddresses) throws IOException { if (isDisposing()) { throw new IllegalStateException("Already disposed."); @@ -224,10 +266,16 @@ } } + /** + * [EMAIL PROTECTED] + */ public final void unbind() { unbind(getLocalAddresses()); } + /** + * [EMAIL PROTECTED] + */ public final void unbind(SocketAddress localAddress) { if (localAddress == null) { throw new NullPointerException("localAddress"); @@ -238,6 +286,9 @@ unbind(localAddresses); } + /** + * [EMAIL PROTECTED] + */ public final void unbind(SocketAddress firstLocalAddress, SocketAddress... otherLocalAddresses) { if (firstLocalAddress == null) { @@ -253,6 +304,9 @@ unbind(localAddresses); } + /** + * [EMAIL PROTECTED] + */ public final void unbind(Iterable<? extends SocketAddress> localAddresses) { if (localAddresses == null) { throw new NullPointerException("localAddresses"); Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoConnector.java URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoConnector.java?rev=662867&r1=662866&r2=662867&view=diff ============================================================================== --- mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoConnector.java (original) +++ mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoConnector.java Tue Jun 3 12:53:20 2008 @@ -68,6 +68,9 @@ return (int)connectTimeoutInMillis/1000; } + /** + * [EMAIL PROTECTED] + */ public final long getConnectTimeoutMillis() { return connectTimeoutInMillis; } @@ -92,10 +95,16 @@ this.connectTimeoutInMillis = connectTimeoutInMillis; } + /** + * [EMAIL PROTECTED] + */ public SocketAddress getDefaultRemoteAddress() { return defaultRemoteAddress; } + /** + * [EMAIL PROTECTED] + */ public final void setDefaultRemoteAddress(SocketAddress defaultRemoteAddress) { if (defaultRemoteAddress == null) { throw new NullPointerException("defaultRemoteAddress"); @@ -110,6 +119,9 @@ this.defaultRemoteAddress = defaultRemoteAddress; } + /** + * [EMAIL PROTECTED] + */ public final ConnectFuture connect() { SocketAddress defaultRemoteAddress = getDefaultRemoteAddress(); if (defaultRemoteAddress == null) { @@ -119,6 +131,9 @@ return connect(defaultRemoteAddress, null, null); } + /** + * [EMAIL PROTECTED] + */ public ConnectFuture connect(IoSessionInitializer<? extends ConnectFuture> sessionInitializer) { SocketAddress defaultRemoteAddress = getDefaultRemoteAddress(); if (defaultRemoteAddress == null) { @@ -128,20 +143,32 @@ return connect(defaultRemoteAddress, null, sessionInitializer); } + /** + * [EMAIL PROTECTED] + */ public final ConnectFuture connect(SocketAddress remoteAddress) { return connect(remoteAddress, null, null); } + /** + * [EMAIL PROTECTED] + */ public ConnectFuture connect(SocketAddress remoteAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer) { return connect(remoteAddress, null, sessionInitializer); } + /** + * [EMAIL PROTECTED] + */ public ConnectFuture connect(SocketAddress remoteAddress, SocketAddress localAddress) { return connect(remoteAddress, localAddress, null); } + /** + * [EMAIL PROTECTED] + */ public final ConnectFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer) { if (isDisposing()) { @@ -236,6 +263,9 @@ }); } + /** + * [EMAIL PROTECTED] + */ @Override public String toString() { TransportMetadata m = getTransportMetadata(); Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoService.java URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoService.java?rev=662867&r1=662866&r2=662867&view=diff ============================================================================== --- mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoService.java (original) +++ mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoService.java Tue Jun 3 12:53:20 2008 @@ -175,10 +175,16 @@ executeWorker(idleStatusChecker.getNotifyingTask(), "idleStatusChecker"); } + /** + * [EMAIL PROTECTED] + */ public final IoFilterChainBuilder getFilterChainBuilder() { return filterChainBuilder; } + /** + * [EMAIL PROTECTED] + */ public final void setFilterChainBuilder(IoFilterChainBuilder builder) { if (builder == null) { builder = new DefaultIoFilterChainBuilder(); @@ -186,6 +192,9 @@ filterChainBuilder = builder; } + /** + * [EMAIL PROTECTED] + */ public final DefaultIoFilterChainBuilder getFilterChain() { if (filterChainBuilder instanceof DefaultIoFilterChainBuilder) { return (DefaultIoFilterChainBuilder) filterChainBuilder; @@ -195,26 +204,44 @@ } } + /** + * [EMAIL PROTECTED] + */ public final void addListener(IoServiceListener listener) { listeners.add(listener); } + /** + * [EMAIL PROTECTED] + */ public final void removeListener(IoServiceListener listener) { listeners.remove(listener); } + /** + * [EMAIL PROTECTED] + */ public final boolean isActive() { return listeners.isActive(); } + /** + * [EMAIL PROTECTED] + */ public final boolean isDisposing() { return disposing; } + /** + * [EMAIL PROTECTED] + */ public final boolean isDisposed() { return disposed; } + /** + * [EMAIL PROTECTED] + */ public final void dispose() { if (disposed) { return; @@ -262,26 +289,44 @@ */ protected abstract IoFuture dispose0() throws Exception; + /** + * [EMAIL PROTECTED] + */ public final Map<Long, IoSession> getManagedSessions() { return listeners.getManagedSessions(); } + /** + * [EMAIL PROTECTED] + */ public final long getCumulativeManagedSessionCount() { return listeners.getCumulativeManagedSessionCount(); } + /** + * [EMAIL PROTECTED] + */ public final int getLargestManagedSessionCount() { return listeners.getLargestManagedSessionCount(); } + /** + * [EMAIL PROTECTED] + */ public final int getManagedSessionCount() { return listeners.getManagedSessionCount(); } + /** + * [EMAIL PROTECTED] + */ public final IoHandler getHandler() { return handler; } + /** + * [EMAIL PROTECTED] + */ public final void setHandler(IoHandler handler) { if (handler == null) { throw new NullPointerException("handler"); @@ -294,14 +339,23 @@ this.handler = handler; } + /** + * [EMAIL PROTECTED] + */ public IoSessionConfig getSessionConfig() { return sessionConfig; } + /** + * [EMAIL PROTECTED] + */ public final IoSessionDataStructureFactory getSessionDataStructureFactory() { return sessionDataStructureFactory; } + /** + * [EMAIL PROTECTED] + */ public final void setSessionDataStructureFactory(IoSessionDataStructureFactory sessionDataStructureFactory) { if (sessionDataStructureFactory == null) { throw new NullPointerException("sessionDataStructureFactory"); @@ -315,6 +369,9 @@ this.sessionDataStructureFactory = sessionDataStructureFactory; } + /** + * [EMAIL PROTECTED] + */ public final long getReadBytes() { return readBytes.get(); } @@ -326,6 +383,9 @@ idleCountForRead = 0; } + /** + * [EMAIL PROTECTED] + */ public final long getReadMessages() { return readMessages.get(); } @@ -337,10 +397,16 @@ idleCountForRead = 0; } + /** + * [EMAIL PROTECTED] + */ public final int getThroughputCalculationInterval() { return throughputCalculationInterval; } + /** + * [EMAIL PROTECTED] + */ public final void setThroughputCalculationInterval(int throughputCalculationInterval) { if (throughputCalculationInterval < 0) { throw new IllegalArgumentException( @@ -350,42 +416,69 @@ this.throughputCalculationInterval = throughputCalculationInterval; } + /** + * [EMAIL PROTECTED] + */ public final long getThroughputCalculationIntervalInMillis() { return throughputCalculationInterval * 1000L; } + /** + * [EMAIL PROTECTED] + */ public final double getReadBytesThroughput() { resetThroughput(); return readBytesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getWrittenBytesThroughput() { resetThroughput(); return writtenBytesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getReadMessagesThroughput() { resetThroughput(); return readMessagesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getWrittenMessagesThroughput() { resetThroughput(); return writtenMessagesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getLargestReadBytesThroughput() { return largestReadBytesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getLargestWrittenBytesThroughput() { return largestWrittenBytesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getLargestReadMessagesThroughput() { return largestReadMessagesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getLargestWrittenMessagesThroughput() { return largestWrittenMessagesThroughput; } @@ -439,6 +532,9 @@ } } + /** + * [EMAIL PROTECTED] + */ public final int getScheduledWriteBytes() { return scheduledWriteBytes.get(); } @@ -447,6 +543,9 @@ scheduledWriteBytes.addAndGet(increment); } + /** + * [EMAIL PROTECTED] + */ public final int getScheduledWriteMessages() { return scheduledWriteMessages.get(); } @@ -459,14 +558,23 @@ scheduledWriteMessages.decrementAndGet(); } + /** + * [EMAIL PROTECTED] + */ public final long getActivationTime() { return listeners.getActivationTime(); } + /** + * [EMAIL PROTECTED] + */ public final long getLastIoTime() { return Math.max(lastReadTime, lastWriteTime); } + /** + * [EMAIL PROTECTED] + */ public final long getLastReadTime() { return lastReadTime; } @@ -475,6 +583,9 @@ this.lastReadTime = lastReadTime; } + /** + * [EMAIL PROTECTED] + */ public final long getLastWriteTime() { return lastWriteTime; } @@ -483,6 +594,9 @@ this.lastWriteTime = lastWriteTime; } + /** + * [EMAIL PROTECTED] + */ public final long getWrittenBytes() { return writtenBytes.get(); } @@ -494,6 +608,9 @@ idleCountForWrite = 0; } + /** + * [EMAIL PROTECTED] + */ public final long getWrittenMessages() { return writtenMessages.get(); } @@ -505,6 +622,9 @@ idleCountForWrite = 0; } + /** + * [EMAIL PROTECTED] + */ public final int getIdleTime(IdleStatus status) { if (status == IdleStatus.BOTH_IDLE) { return idleTimeForBoth; @@ -521,10 +641,16 @@ throw new IllegalArgumentException("Unknown idle status: " + status); } + /** + * [EMAIL PROTECTED] + */ public final long getIdleTimeInMillis(IdleStatus status) { return getIdleTime(status) * 1000L; } + /** + * [EMAIL PROTECTED] + */ public final void setIdleTime(IdleStatus status, int idleTime) { if (idleTime < 0) { throw new IllegalArgumentException("Illegal idle time: " + idleTime); @@ -551,6 +677,9 @@ } } + /** + * [EMAIL PROTECTED] + */ public final boolean isIdle(IdleStatus status) { if (status == IdleStatus.BOTH_IDLE) { return idleCountForBoth > 0; @@ -567,6 +696,9 @@ throw new IllegalArgumentException("Unknown idle status: " + status); } + /** + * [EMAIL PROTECTED] + */ public final int getIdleCount(IdleStatus status) { if (status == IdleStatus.BOTH_IDLE) { return idleCountForBoth; @@ -583,6 +715,9 @@ throw new IllegalArgumentException("Unknown idle status: " + status); } + /** + * [EMAIL PROTECTED] + */ public final long getLastIdleTime(IdleStatus status) { if (status == IdleStatus.BOTH_IDLE) { return lastIdleTimeForBoth; @@ -650,78 +785,135 @@ } } + /** + * [EMAIL PROTECTED] + */ public final int getBothIdleCount() { return getIdleCount(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getLastBothIdleTime() { return getLastIdleTime(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getLastReaderIdleTime() { return getLastIdleTime(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getLastWriterIdleTime() { return getLastIdleTime(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getReaderIdleCount() { return getIdleCount(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getWriterIdleCount() { return getIdleCount(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getBothIdleTime() { return getIdleTime(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getBothIdleTimeInMillis() { return getIdleTimeInMillis(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getReaderIdleTime() { return getIdleTime(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getReaderIdleTimeInMillis() { return getIdleTimeInMillis(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getWriterIdleTime() { return getIdleTime(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getWriterIdleTimeInMillis() { return getIdleTimeInMillis(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final boolean isBothIdle() { return isIdle(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final boolean isReaderIdle() { return isIdle(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final boolean isWriterIdle() { return isIdle(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final void setBothIdleTime(int idleTime) { setIdleTime(IdleStatus.BOTH_IDLE, idleTime); } + /** + * [EMAIL PROTECTED] + */ public final void setReaderIdleTime(int idleTime) { setIdleTime(IdleStatus.READER_IDLE, idleTime); } + /** + * [EMAIL PROTECTED] + */ public final void setWriterIdleTime(int idleTime) { setIdleTime(IdleStatus.WRITER_IDLE, idleTime); } + /** + * [EMAIL PROTECTED] + */ public final Set<WriteFuture> broadcast(Object message) { // Convert to Set. We do not return a List here because only the // direct caller of MessageBroadcaster knows the order of write Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSession.java URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSession.java?rev=662867&r1=662866&r2=662867&view=diff ============================================================================== --- mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSession.java (original) +++ mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSession.java Tue Jun 3 12:53:20 2008 @@ -120,6 +120,9 @@ closeFuture.addListener(SCHEDULED_COUNTER_RESETTER); } + /** + * [EMAIL PROTECTED] + */ public final long getId() { return hashCode() & 0xFFFFFFFFL; } @@ -127,14 +130,23 @@ @SuppressWarnings("unchecked") protected abstract IoProcessor getProcessor(); + /** + * [EMAIL PROTECTED] + */ public final boolean isConnected() { return !closeFuture.isClosed(); } + /** + * [EMAIL PROTECTED] + */ public final boolean isClosing() { return closing || closeFuture.isClosed(); } + /** + * [EMAIL PROTECTED] + */ public final CloseFuture getCloseFuture() { return closeFuture; } @@ -152,6 +164,9 @@ } } + /** + * [EMAIL PROTECTED] + */ public final CloseFuture close(boolean rightNow) { if (rightNow) { return close(); @@ -160,6 +175,9 @@ } } + /** + * [EMAIL PROTECTED] + */ public final CloseFuture close() { synchronized (lock) { if (isClosing()) { @@ -173,13 +191,18 @@ return closeFuture; } - @SuppressWarnings("unchecked") + /** + * [EMAIL PROTECTED] + */ public final CloseFuture closeOnFlush() { getWriteRequestQueue().offer(this, CLOSE_REQUEST); getProcessor().flush(this); return closeFuture; } + /** + * [EMAIL PROTECTED] + */ public final ReadFuture read() { if (!getConfig().isUseReadOperation()) { throw new IllegalStateException("useReadOperation is not enabled."); @@ -232,7 +255,6 @@ return future; } - @SuppressWarnings("unchecked") private Queue<ReadFuture> getReadyReadFutures() { Queue<ReadFuture> readyReadFutures = (Queue<ReadFuture>) getAttribute(READY_READ_FUTURES); @@ -249,7 +271,6 @@ return readyReadFutures; } - @SuppressWarnings("unchecked") private Queue<ReadFuture> getWaitingReadFutures() { Queue<ReadFuture> waitingReadyReadFutures = (Queue<ReadFuture>) getAttribute(WAITING_READ_FUTURES); @@ -266,10 +287,16 @@ return waitingReadyReadFutures; } + /** + * [EMAIL PROTECTED] + */ public final WriteFuture write(Object message) { return write(message, null); } + /** + * [EMAIL PROTECTED] + */ public final WriteFuture write(Object message, SocketAddress remoteAddress) { if (message == null) { throw new NullPointerException("message"); @@ -327,54 +354,93 @@ return future; } + /** + * [EMAIL PROTECTED] + */ public final Object getAttachment() { return getAttribute(""); } + /** + * [EMAIL PROTECTED] + */ public final Object setAttachment(Object attachment) { return setAttribute("", attachment); } + /** + * [EMAIL PROTECTED] + */ public final Object getAttribute(Object key) { return getAttribute(key, null); } + /** + * [EMAIL PROTECTED] + */ public final Object getAttribute(Object key, Object defaultValue) { return attributes.getAttribute(this, key, defaultValue); } + /** + * [EMAIL PROTECTED] + */ public final Object setAttribute(Object key, Object value) { return attributes.setAttribute(this, key, value); } + /** + * [EMAIL PROTECTED] + */ public final Object setAttribute(Object key) { return setAttribute(key, Boolean.TRUE); } + /** + * [EMAIL PROTECTED] + */ public final Object setAttributeIfAbsent(Object key, Object value) { return attributes.setAttributeIfAbsent(this, key, value); } + /** + * [EMAIL PROTECTED] + */ public final Object setAttributeIfAbsent(Object key) { return setAttributeIfAbsent(key, Boolean.TRUE); } + /** + * [EMAIL PROTECTED] + */ public final Object removeAttribute(Object key) { return attributes.removeAttribute(this, key); } + /** + * [EMAIL PROTECTED] + */ public final boolean removeAttribute(Object key, Object value) { return attributes.removeAttribute(this, key, value); } + /** + * [EMAIL PROTECTED] + */ public final boolean replaceAttribute(Object key, Object oldValue, Object newValue) { return attributes.replaceAttribute(this, key, oldValue, newValue); } + /** + * [EMAIL PROTECTED] + */ public final boolean containsAttribute(Object key) { return attributes.containsAttribute(this, key); } + /** + * [EMAIL PROTECTED] + */ public final Set<Object> getAttributeKeys() { return attributes.getAttributeKeys(this); } @@ -392,10 +458,16 @@ new CloseRequestAwareWriteRequestQueue(writeRequestQueue); } + /** + * [EMAIL PROTECTED] + */ public final TrafficMask getTrafficMask() { return trafficMask; } + /** + * [EMAIL PROTECTED] + */ public final void setTrafficMask(TrafficMask trafficMask) { if (trafficMask == null) { throw new NullPointerException("trafficMask"); @@ -412,50 +484,86 @@ this.trafficMask = trafficMask; } + /** + * [EMAIL PROTECTED] + */ public final void suspendRead() { setTrafficMask(getTrafficMask().and(TrafficMask.READ.not())); } + /** + * [EMAIL PROTECTED] + */ public final void suspendWrite() { setTrafficMask(getTrafficMask().and(TrafficMask.WRITE.not())); } + /** + * [EMAIL PROTECTED] + */ public final void resumeRead() { setTrafficMask(getTrafficMask().or(TrafficMask.READ)); } + /** + * [EMAIL PROTECTED] + */ public final void resumeWrite() { setTrafficMask(getTrafficMask().or(TrafficMask.WRITE)); } + /** + * [EMAIL PROTECTED] + */ public final long getReadBytes() { return readBytes; } + /** + * [EMAIL PROTECTED] + */ public final long getWrittenBytes() { return writtenBytes; } + /** + * [EMAIL PROTECTED] + */ public final long getReadMessages() { return readMessages; } + /** + * [EMAIL PROTECTED] + */ public final long getWrittenMessages() { return writtenMessages; } + /** + * [EMAIL PROTECTED] + */ public final double getReadBytesThroughput() { return readBytesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getWrittenBytesThroughput() { return writtenBytesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getReadMessagesThroughput() { return readMessagesThroughput; } + /** + * [EMAIL PROTECTED] + */ public final double getWrittenMessagesThroughput() { return writtenMessagesThroughput; } @@ -494,10 +602,16 @@ lastThroughputCalculationTime = currentTime; } + /** + * [EMAIL PROTECTED] + */ public final long getScheduledWriteBytes() { return scheduledWriteBytes.get(); } + /** + * [EMAIL PROTECTED] + */ public final int getScheduledWriteMessages() { return scheduledWriteMessages.get(); } @@ -614,10 +728,16 @@ return writeRequestQueue; } + /** + * [EMAIL PROTECTED] + */ public final WriteRequest getCurrentWriteRequest() { return currentWriteRequest; } + /** + * [EMAIL PROTECTED] + */ public final Object getCurrentWriteMessage() { WriteRequest req = getCurrentWriteRequest(); if (req == null) { @@ -654,22 +774,37 @@ deferDecreaseReadBuffer = true; } + /** + * [EMAIL PROTECTED] + */ public final long getCreationTime() { return creationTime; } + /** + * [EMAIL PROTECTED] + */ public final long getLastIoTime() { return Math.max(lastReadTime, lastWriteTime); } + /** + * [EMAIL PROTECTED] + */ public final long getLastReadTime() { return lastReadTime; } + /** + * [EMAIL PROTECTED] + */ public final long getLastWriteTime() { return lastWriteTime; } + /** + * [EMAIL PROTECTED] + */ public final boolean isIdle(IdleStatus status) { if (status == IdleStatus.BOTH_IDLE) { return idleCountForBoth > 0; @@ -686,18 +821,30 @@ throw new IllegalArgumentException("Unknown idle status: " + status); } + /** + * [EMAIL PROTECTED] + */ public final boolean isBothIdle() { return isIdle(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final boolean isReaderIdle() { return isIdle(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final boolean isWriterIdle() { return isIdle(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getIdleCount(IdleStatus status) { if (getConfig().getIdleTime(status) == 0) { if (status == IdleStatus.BOTH_IDLE) { @@ -728,6 +875,9 @@ throw new IllegalArgumentException("Unknown idle status: " + status); } + /** + * [EMAIL PROTECTED] + */ public final long getLastIdleTime(IdleStatus status) { if (status == IdleStatus.BOTH_IDLE) { return lastIdleTimeForBoth; @@ -759,30 +909,51 @@ } } + /** + * [EMAIL PROTECTED] + */ public final int getBothIdleCount() { return getIdleCount(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getLastBothIdleTime() { return getLastIdleTime(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getLastReaderIdleTime() { return getLastIdleTime(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getLastWriterIdleTime() { return getLastIdleTime(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getReaderIdleCount() { return getIdleCount(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getWriterIdleCount() { return getIdleCount(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public SocketAddress getServiceAddress() { IoService service = getService(); if (service instanceof IoAcceptor) { @@ -792,16 +963,25 @@ } } + /** + * [EMAIL PROTECTED] + */ @Override public final int hashCode() { return super.hashCode(); } + /** + * [EMAIL PROTECTED] + */ @Override public final boolean equals(Object o) { return super.equals(o); } + /** + * [EMAIL PROTECTED] + */ @Override public String toString() { if (getService() instanceof IoAcceptor) { Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSessionConfig.java URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSessionConfig.java?rev=662867&r1=662866&r2=662867&view=diff ============================================================================== --- mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSessionConfig.java (original) +++ mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoSessionConfig.java Tue Jun 3 12:53:20 2008 @@ -41,6 +41,9 @@ protected AbstractIoSessionConfig() { } + /** + * [EMAIL PROTECTED] + */ public final void setAll(IoSessionConfig config) { if (config == null) { throw new NullPointerException("config"); @@ -65,10 +68,16 @@ */ protected abstract void doSetAll(IoSessionConfig config); + /** + * [EMAIL PROTECTED] + */ public int getReadBufferSize() { return readBufferSize; } + /** + * [EMAIL PROTECTED] + */ public void setReadBufferSize(int readBufferSize) { if (readBufferSize <= 0) { throw new IllegalArgumentException("readBufferSize: " + readBufferSize + " (expected: 1+)"); @@ -76,10 +85,16 @@ this.readBufferSize = readBufferSize; } + /** + * [EMAIL PROTECTED] + */ public int getMinReadBufferSize() { return minReadBufferSize; } + /** + * [EMAIL PROTECTED] + */ public void setMinReadBufferSize(int minReadBufferSize) { if (minReadBufferSize <= 0) { throw new IllegalArgumentException("minReadBufferSize: " + minReadBufferSize + " (expected: 1+)"); @@ -91,10 +106,16 @@ this.minReadBufferSize = minReadBufferSize; } + /** + * [EMAIL PROTECTED] + */ public int getMaxReadBufferSize() { return maxReadBufferSize; } + /** + * [EMAIL PROTECTED] + */ public void setMaxReadBufferSize(int maxReadBufferSize) { if (maxReadBufferSize <= 0) { throw new IllegalArgumentException("maxReadBufferSize: " + maxReadBufferSize + " (expected: 1+)"); @@ -107,6 +128,9 @@ this.maxReadBufferSize = maxReadBufferSize; } + /** + * [EMAIL PROTECTED] + */ public int getIdleTime(IdleStatus status) { if (status == IdleStatus.BOTH_IDLE) { return idleTimeForBoth; @@ -123,10 +147,16 @@ throw new IllegalArgumentException("Unknown idle status: " + status); } + /** + * [EMAIL PROTECTED] + */ public long getIdleTimeInMillis(IdleStatus status) { return getIdleTime(status) * 1000L; } + /** + * [EMAIL PROTECTED] + */ public void setIdleTime(IdleStatus status, int idleTime) { if (idleTime < 0) { throw new IllegalArgumentException("Illegal idle time: " + idleTime); @@ -143,50 +173,86 @@ } } + /** + * [EMAIL PROTECTED] + */ public final int getBothIdleTime() { return getIdleTime(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getBothIdleTimeInMillis() { return getIdleTimeInMillis(IdleStatus.BOTH_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getReaderIdleTime() { return getIdleTime(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getReaderIdleTimeInMillis() { return getIdleTimeInMillis(IdleStatus.READER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final int getWriterIdleTime() { return getIdleTime(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public final long getWriterIdleTimeInMillis() { return getIdleTimeInMillis(IdleStatus.WRITER_IDLE); } + /** + * [EMAIL PROTECTED] + */ public void setBothIdleTime(int idleTime) { setIdleTime(IdleStatus.BOTH_IDLE, idleTime); } + /** + * [EMAIL PROTECTED] + */ public void setReaderIdleTime(int idleTime) { setIdleTime(IdleStatus.READER_IDLE, idleTime); } + /** + * [EMAIL PROTECTED] + */ public void setWriterIdleTime(int idleTime) { setIdleTime(IdleStatus.WRITER_IDLE, idleTime); } + /** + * [EMAIL PROTECTED] + */ public int getWriteTimeout() { return writeTimeout; } + /** + * [EMAIL PROTECTED] + */ public long getWriteTimeoutInMillis() { return writeTimeout * 1000L; } + /** + * [EMAIL PROTECTED] + */ public void setWriteTimeout(int writeTimeout) { if (writeTimeout < 0) { throw new IllegalArgumentException("Illegal write timeout: " @@ -195,18 +261,30 @@ this.writeTimeout = writeTimeout; } + /** + * [EMAIL PROTECTED] + */ public boolean isUseReadOperation() { return useReadOperation; } + /** + * [EMAIL PROTECTED] + */ public void setUseReadOperation(boolean useReadOperation) { this.useReadOperation = useReadOperation; } + /** + * [EMAIL PROTECTED] + */ public int getThroughputCalculationInterval() { return throughputCalculationInterval; } + /** + * [EMAIL PROTECTED] + */ public void setThroughputCalculationInterval(int throughputCalculationInterval) { if (throughputCalculationInterval < 0) { throw new IllegalArgumentException( @@ -216,6 +294,9 @@ this.throughputCalculationInterval = throughputCalculationInterval; } + /** + * [EMAIL PROTECTED] + */ public long getThroughputCalculationIntervalInMillis() { return throughputCalculationInterval * 1000L; } Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingConnectionlessIoAcceptor.java URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingConnectionlessIoAcceptor.java?rev=662867&r1=662866&r2=662867&view=diff ============================================================================== --- mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingConnectionlessIoAcceptor.java (original) +++ mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingConnectionlessIoAcceptor.java Tue Jun 3 12:53:20 2008 @@ -106,6 +106,9 @@ protected abstract T newSession(IoProcessor<T> processor, H handle, SocketAddress remoteAddress) throws Exception; protected abstract void setInterestedInWrite(T session, boolean interested) throws Exception; + /** + * [EMAIL PROTECTED] + */ @Override protected IoFuture dispose0() throws Exception { unbind(); @@ -116,6 +119,9 @@ return disposalFuture; } + /** + * [EMAIL PROTECTED] + */ @Override protected final Set<SocketAddress> bind0( List<? extends SocketAddress> localAddresses) throws Exception { @@ -138,6 +144,9 @@ return newLocalAddresses; } + /** + * [EMAIL PROTECTED] + */ @Override protected final void unbind0( List<? extends SocketAddress> localAddresses) throws Exception { @@ -154,6 +163,9 @@ } } + /** + * [EMAIL PROTECTED] + */ public final IoSession newSession(SocketAddress remoteAddress, SocketAddress localAddress) { if (isDisposing()) { throw new IllegalStateException("Already disposed.");