/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Base implementation of AsynchronousServerSocketChannel.
*/
abstract class AsynchronousServerSocketChannelImpl
extends AsynchronousServerSocketChannel
implements Cancellable, Groupable
{
// the local address to which the channel's socket is bound
// need this lock to set local address
// close support
private volatile boolean open = true;
// set true when accept operation is cancelled
private volatile boolean acceptKilled;
// set true when exclusive binding is on and SO_REUSEADDR is emulated
private boolean isReuseAddress;
}
public final boolean isOpen() {
return open;
}
/**
* Marks beginning of access to file descriptor/handle
*/
if (!isOpen())
throw new ClosedChannelException();
}
/**
* Marks end of access to file descriptor/handle
*/
final void end() {
}
/**
* Invoked to close file descriptor/handle.
*/
// synchronize with any threads using file descriptor/handle
try {
if (!open)
return; // already closed
open = false;
} finally {
}
implClose();
}
/**
* Invoked by accept to accept connection
*/
abstract Future<AsynchronousSocketChannel>
}
@SuppressWarnings("unchecked")
{
throw new NullPointerException("'handler' is null");
}
final boolean isAcceptKilled() {
return acceptKilled;
}
acceptKilled = true;
}
throws IOException
{
try {
begin();
synchronized (stateLock) {
if (localAddress != null)
throw new AlreadyBoundException();
}
} finally {
end();
}
return this;
}
if (!isOpen())
throw new ClosedChannelException();
}
T value)
throws IOException
{
throw new NullPointerException();
try {
begin();
{
// SO_REUSEADDR emulated when using exclusive bind
} else {
}
return this;
} finally {
end();
}
}
@SuppressWarnings("unchecked")
throw new NullPointerException();
try {
begin();
{
// SO_REUSEADDR emulated when using exclusive bind
}
} finally {
end();
}
}
private static class DefaultOptionsHolder {
}
}
return DefaultOptionsHolder.defaultOptions;
}
if (!isOpen())
else {
if (localAddress == null) {
} else {
}
}
}
}