com.sun.sgs.impl.nio
Class AsyncProviderImpl

java.lang.Object
  extended by com.sun.sgs.nio.channels.spi.AsynchronousChannelProvider
      extended by com.sun.sgs.impl.nio.AsyncProviderImpl
Direct Known Subclasses:
ReactiveAsyncChannelProvider

abstract class AsyncProviderImpl
extends AsynchronousChannelProvider

Common base implementation of AsynchronousChannelProvider.


Constructor Summary
protected AsyncProviderImpl(SelectorProvider selProvider)
          Creates an asynchronous channel provider using the given SelectorProvider.
 
Method Summary
protected  ThreadPoolFactory createDefaultThreadPoolFactory()
          Creates a default ThreadPoolFactory when none has been specified by other mechanisms.
 Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()
          Returns the uncaught exception handler for the default group.
abstract  AsyncGroupImpl openAsynchronousChannelGroup(ExecutorService executor)
          Constructs a new asynchronous channel group.
 AsyncDatagramChannelImpl openAsynchronousDatagramChannel(ProtocolFamily pf, AsynchronousChannelGroup group)
          Opens an asynchronous datagram channel.
 AsyncServerSocketChannelImpl openAsynchronousServerSocketChannel(AsynchronousChannelGroup group)
          Opens an asynchronous server-socket channel.
 AsyncSocketChannelImpl openAsynchronousSocketChannel(AsynchronousChannelGroup group)
          Opens an asynchronous socket channel.
(package private)  SelectorProvider selectorProvider()
          Returns the SelectorProvider for this async provider.
 void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
          Set the uncaught exception handler for the default group.
 
Methods inherited from class com.sun.sgs.nio.channels.spi.AsynchronousChannelProvider
provider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncProviderImpl

protected AsyncProviderImpl(SelectorProvider selProvider)
Creates an asynchronous channel provider using the given SelectorProvider. If the parameter is {code null}, the system default SelectorProvider will be used.

Parameters:
selProvider - the SelectorProvider, or null to use the system default SelectorProvider
See Also:
SelectorProvider.provider()
Method Detail

selectorProvider

SelectorProvider selectorProvider()
Returns the SelectorProvider for this async provider.

Returns:
the SelectorProvider for this async provider

createDefaultThreadPoolFactory

protected ThreadPoolFactory createDefaultThreadPoolFactory()
Creates a default ThreadPoolFactory when none has been specified by other mechanisms.

Returns:
a ThreadPoolFactory

openAsynchronousChannelGroup

public abstract AsyncGroupImpl openAsynchronousChannelGroup(ExecutorService executor)
                                                     throws IOException
Constructs a new asynchronous channel group.

Specified by:
openAsynchronousChannelGroup in class AsynchronousChannelProvider
Parameters:
executor - the executor service
Returns:
a new asynchronous channel group
Throws:
IOException - if an I/O error occurs

openAsynchronousDatagramChannel

public AsyncDatagramChannelImpl openAsynchronousDatagramChannel(ProtocolFamily pf,
                                                                AsynchronousChannelGroup group)
                                                         throws IOException
Opens an asynchronous datagram channel.

Specified by:
openAsynchronousDatagramChannel in class AsynchronousChannelProvider
Parameters:
pf - the protocol family, or null for the default protocol family
group - the group to which the channel is bound, or null to bind to the default group
Returns:
the new channel
Throws:
IOException - if an I/O error occurs

openAsynchronousServerSocketChannel

public AsyncServerSocketChannelImpl openAsynchronousServerSocketChannel(AsynchronousChannelGroup group)
                                                                 throws IOException
Opens an asynchronous server-socket channel.

Specified by:
openAsynchronousServerSocketChannel in class AsynchronousChannelProvider
Parameters:
group - the group to which the channel is bound, or null to bind to the default group
Returns:
the new channel
Throws:
IOException - if an I/O error occurs

openAsynchronousSocketChannel

public AsyncSocketChannelImpl openAsynchronousSocketChannel(AsynchronousChannelGroup group)
                                                     throws IOException
Opens an asynchronous socket channel.

Specified by:
openAsynchronousSocketChannel in class AsynchronousChannelProvider
Parameters:
group - the group to which the channel is bound, or null to bind to the default group
Returns:
the new channel
Throws:
IOException - if an I/O error occurs

getUncaughtExceptionHandler

public Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()
Returns the uncaught exception handler for the default group.

Specified by:
getUncaughtExceptionHandler in class AsynchronousChannelProvider
Returns:
the uncaught exception handler for the default group, or null if there is no default handler

setUncaughtExceptionHandler

public void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
Set the uncaught exception handler for the default group.

Specified by:
setUncaughtExceptionHandler in class AsynchronousChannelProvider
Parameters:
eh - the object to use as the default uncaught exception handler, or null for no default handler

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved