|
XNIO API 3.0.7.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xnio.Xnio
public abstract class Xnio
The XNIO provider class.
| Constructor Summary | |
|---|---|
protected |
Xnio(String name)
Construct an XNIO provider instance. |
| Method Summary | |
|---|---|
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(ThreadGroup threadGroup,
OptionMap optionMap)
Construct a new XNIO worker. |
abstract XnioWorker |
createWorker(ThreadGroup threadGroup,
OptionMap optionMap,
Runnable terminationTask)
Construct a new XNIO worker. |
static Xnio |
getInstance()
Get an XNIO provider instance from XNIO's class loader. |
static Xnio |
getInstance(ClassLoader classLoader)
Get an XNIO provider instance. |
static Xnio |
getInstance(String provider)
Get a specific XNIO provider instance from XNIO's class loader. |
static Xnio |
getInstance(String provider,
ClassLoader classLoader)
Get a specific XNIO provider instance. |
String |
getName()
Get the name of this XNIO provider. |
protected String |
getProperty(String name)
Get an XNIO property. |
protected String |
getProperty(String name,
String defaultValue)
Get an XNIO property. |
XnioSsl |
getSslProvider(KeyManager[] keyManagers,
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. |
FileChannel |
openFile(File file,
FileAccess access)
Open a file on the filesystem. |
FileChannel |
openFile(File file,
OptionMap options)
Open a file on the filesystem. |
FileChannel |
openFile(String fileName,
FileAccess access)
Open a file on the filesystem. |
FileChannel |
openFile(String fileName,
OptionMap options)
Open a file on the filesystem. |
String |
toString()
Get a string representation of this XNIO provider. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Xnio(String name)
getInstance() methods.
name - the provider name| Method Detail |
|---|
public static boolean allowBlocking(boolean newSetting)
throws SecurityException
changeThreadBlockingSetting
RuntimePermission.
newSetting - true to allow blocking I/O, false to disallow it
SecurityException - if a security manager is present and disallows changing the changeThreadBlockingSetting RuntimePermissionpublic static boolean isBlockingAllowed()
true if blocking I/O is allowed, false otherwise
public static void checkBlockingAllowed()
throws IllegalStateException
IllegalStateException - if blocking is not allowed on the current threadpublic static Xnio getInstance(ClassLoader classLoader)
classLoader - the class loader to search in
public static Xnio getInstance()
public static Xnio getInstance(String provider,
ClassLoader classLoader)
provider - the provider name, or null for the first availableclassLoader - the class loader to search in
public static Xnio getInstance(String provider)
provider - the provider name, or null for the first available
public XnioSsl getSslProvider(OptionMap optionMap)
throws GeneralSecurityException
optionMap - the option map to use for configuring SSL
GeneralSecurityException - if an exception occurred configuring the SSL provider
public XnioSsl getSslProvider(KeyManager[] keyManagers,
TrustManager[] trustManagers,
OptionMap optionMap)
throws 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 map
GeneralSecurityException - if an exception occurred configuring the SSL provider
public FileChannel openFile(File file,
OptionMap options)
throws IOException
file - the file to openoptions - the file-open options
IOException - if an I/O error occurs
public FileChannel openFile(String fileName,
OptionMap options)
throws IOException
fileName - the file name of the file to openoptions - the file-open options
IOException - if an I/O error occurs
public FileChannel openFile(File file,
FileAccess access)
throws IOException
file - the file to openaccess - the file access level to use
IOException - if an I/O error occurs
public FileChannel openFile(String fileName,
FileAccess access)
throws IOException
fileName - the file name of the file to openaccess - the file access level to use
IOException - if an I/O error occurs
public XnioWorker createWorker(OptionMap optionMap)
throws IOException,
IllegalArgumentException
optionMap - the options to use to configure the worker
IOException - if the worker failed to be opened
IllegalArgumentException - if an option value is invalid for this worker
public XnioWorker createWorker(ThreadGroup threadGroup,
OptionMap optionMap)
throws IOException,
IllegalArgumentException
threadGroup - the thread group for worker threadsoptionMap - the options to use to configure the worker
IOException - if the worker failed to be opened
IllegalArgumentException - if an option value is invalid for this worker
public abstract XnioWorker createWorker(ThreadGroup threadGroup,
OptionMap optionMap,
Runnable terminationTask)
throws IOException,
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 down
IOException - if the worker failed to be opened
IllegalArgumentException - if an option value is invalid for this workerpublic final String getName()
public final String toString()
toString in class Objectprotected String getProperty(String name)
"xnio.".
name - the property name
null if it wasn't found
protected String getProperty(String name,
String defaultValue)
"xnio.".
name - the property namedefaultValue - the default value
defaultValue if it wasn't found
|
XNIO API 3.0.7.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||