
public abstract class Xnio
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
Xnio(java.lang.String name)
Construct an XNIO provider instance.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allowBlocking(boolean newSetting)
Allow (or disallow) blocking I/O on the current thread.
|
static void |
checkBlockingAllowed()
Perform a check for whether blocking is allowed on the current thread.
|
XnioWorker |
createWorker(OptionMap optionMap)
Construct a new XNIO worker.
|
XnioWorker |
createWorker(java.lang.ThreadGroup threadGroup,
OptionMap optionMap)
Construct a new XNIO worker.
|
abstract XnioWorker |
createWorker(java.lang.ThreadGroup threadGroup,
OptionMap optionMap,
java.lang.Runnable terminationTask)
Construct a new XNIO worker.
|
static Xnio |
getInstance()
Get an XNIO provider instance from XNIO's class loader.
|
static Xnio |
getInstance(java.lang.ClassLoader classLoader)
Get an XNIO provider instance.
|
static Xnio |
getInstance(java.lang.String provider)
Get a specific XNIO provider instance from XNIO's class loader.
|
static Xnio |
getInstance(java.lang.String provider,
java.lang.ClassLoader classLoader)
Get a specific XNIO provider instance.
|
java.lang.String |
getName()
Get the name of this XNIO provider.
|
protected java.lang.String |
getProperty(java.lang.String name)
Get an XNIO property.
|
protected java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Get an XNIO property.
|
XnioSsl |
getSslProvider(javax.net.ssl.KeyManager[] keyManagers,
javax.net.ssl.TrustManager[] trustManagers,
OptionMap optionMap)
Get an SSL provider for this XNIO provider.
|
XnioSsl |
getSslProvider(OptionMap optionMap)
Get an SSL provider for this XNIO provider.
|
static boolean |
isBlockingAllowed()
Determine whether blocking I/O is allowed from the current thread.
|
java.nio.channels.FileChannel |
openFile(java.io.File file,
FileAccess access)
Open a file on the filesystem.
|
java.nio.channels.FileChannel |
openFile(java.io.File file,
OptionMap options)
Open a file on the filesystem.
|
java.nio.channels.FileChannel |
openFile(java.lang.String fileName,
FileAccess access)
Open a file on the filesystem.
|
java.nio.channels.FileChannel |
openFile(java.lang.String fileName,
OptionMap options)
Open a file on the filesystem.
|
java.lang.String |
toString()
Get a string representation of this XNIO provider.
|
protected Xnio(java.lang.String name)
getInstance() methods.name - the provider namepublic static boolean allowBlocking(boolean newSetting)
throws java.lang.SecurityException
changeThreadBlockingSetting
RuntimePermission.newSetting - true to allow blocking I/O, false to disallow itjava.lang.SecurityException - if a security manager is present and disallows changing the changeThreadBlockingSetting RuntimePermissionpublic static boolean isBlockingAllowed()
true if blocking I/O is allowed, false otherwisepublic static void checkBlockingAllowed()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if blocking is not allowed on the current threadpublic static Xnio getInstance(java.lang.ClassLoader classLoader)
classLoader - the class loader to search inpublic static Xnio getInstance()
public static Xnio getInstance(java.lang.String provider, java.lang.ClassLoader classLoader)
provider - the provider name, or null for the first availableclassLoader - the class loader to search inpublic static Xnio getInstance(java.lang.String provider)
provider - the provider name, or null for the first availablepublic XnioSsl getSslProvider(OptionMap optionMap) throws java.security.GeneralSecurityException
optionMap - the option map to use for configuring SSLjava.security.GeneralSecurityException - if an exception occurred configuring the SSL providerpublic XnioSsl getSslProvider(javax.net.ssl.KeyManager[] keyManagers, javax.net.ssl.TrustManager[] trustManagers, OptionMap optionMap) throws java.security.GeneralSecurityException
optionMap - the option map to use for configuring SSLkeyManagers - the key managers to use, or null to configure from the option maptrustManagers - the trust managers to use, or null to configure from the option mapjava.security.GeneralSecurityException - if an exception occurred configuring the SSL providerpublic java.nio.channels.FileChannel openFile(java.io.File file,
OptionMap options)
throws java.io.IOException
file - the file to openoptions - the file-open optionsjava.io.IOException - if an I/O error occurspublic java.nio.channels.FileChannel openFile(java.lang.String fileName,
OptionMap options)
throws java.io.IOException
fileName - the file name of the file to openoptions - the file-open optionsjava.io.IOException - if an I/O error occurspublic java.nio.channels.FileChannel openFile(java.io.File file,
FileAccess access)
throws java.io.IOException
file - the file to openaccess - the file access level to usejava.io.IOException - if an I/O error occurspublic java.nio.channels.FileChannel openFile(java.lang.String fileName,
FileAccess access)
throws java.io.IOException
fileName - the file name of the file to openaccess - the file access level to usejava.io.IOException - if an I/O error occurspublic XnioWorker createWorker(OptionMap optionMap) throws java.io.IOException, java.lang.IllegalArgumentException
optionMap - the options to use to configure the workerjava.io.IOException - if the worker failed to be openedjava.lang.IllegalArgumentException - if an option value is invalid for this workerpublic XnioWorker createWorker(java.lang.ThreadGroup threadGroup, OptionMap optionMap) throws java.io.IOException, java.lang.IllegalArgumentException
threadGroup - the thread group for worker threadsoptionMap - the options to use to configure the workerjava.io.IOException - if the worker failed to be openedjava.lang.IllegalArgumentException - if an option value is invalid for this workerpublic abstract XnioWorker createWorker(java.lang.ThreadGroup threadGroup, OptionMap optionMap, java.lang.Runnable terminationTask) throws java.io.IOException, java.lang.IllegalArgumentException
threadGroup - the thread group for worker threadsoptionMap - the options to use to configure the workerterminationTask - the task to run after the worker has shut downjava.io.IOException - if the worker failed to be openedjava.lang.IllegalArgumentException - if an option value is invalid for this workerpublic final java.lang.String getName()
public final java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String getProperty(java.lang.String name)
"xnio.".name - the property namenull if it wasn't foundprotected java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
"xnio.".name - the property namedefaultValue - the default valuedefaultValue if it wasn't foundCopyright © 2010 JBoss, a division of Red Hat, Inc.