|
Avaya Conferencing Provider API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.avaya.conferencing.api.acp.control.ConnectionContext
public final class ConnectionContext
Provides control over how connections can create worker threads and event notification threads. Most consumers of this API will not require direct interaction with this class, as the default behaviours are generally sufficient.
The JavaEE specification allows JavaEE application servers to restrict the ability of applications to manage threads. If an application needs background threads, the JavaEE specification envisions that developers would either implement resource adapters to handle these background threads. When a resource adapter is deployed to a JavaEE container, the container provides the resource adapter with a WorkManager, which is essentially an ExecutorService that is managed by the JavaEE container.
At the time of development of this API, most JavaEE application servers do not enforce the restrictions on creating threads. This class allows the API to be used if it is deployed to a JavaEE application server that does restrict the creation of threads.
A Connection typically requires threads for two purposes:
ConferencingProvider. A Connection implementation will typically require
more than one worker thread and therefore a pool of worker threads is required. By default, Executors.newCachedThreadPool() will be used to create the ExecutorServices used for both worker and notification tasks. Closing a Connection will result in calls to ExecutorService.shutdown() for all ExecutorServices requested by the Connection. Additionally, the Connection may also call ExecutorService.shutdownNow() for any worker ExecutorServices in order to ensure that the Connection is closed. The connection cannot call the ExecutorService.shutdownNow() for the notification ExecutorService as this would interfer with the consumer of the API.
| Method Summary | |
|---|---|
boolean |
awaitDisposed(long timeout,
java.util.concurrent.TimeUnit unit)
Method awaitDisposed ... |
void |
dispose()
Disposes all connections established with this context. |
Connection |
getConnection(java.lang.String connectionUrl,
java.lang.String username,
char[] password)
Returns the required connection. |
java.lang.ClassLoader |
getContextClassLoader()
Getter for property 'contextClassLoader'. |
ExecutorServiceFactory |
getNotifyFactory()
Getter for property 'notifyFactory'. |
ExecutorServiceFactory |
getWorkerFactory()
Getter for property 'factory'. |
boolean |
isDisposed()
Getter for property 'disposed'. |
boolean |
isDisposing()
Getter for property 'disposing'. |
void |
setNotifyFactory(ExecutorServiceFactory notifyFactory)
Setter for property 'notifyFactory'. |
void |
setWorkerFactory(ExecutorServiceFactory workerFactory)
Setter for property 'factory'. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public java.lang.ClassLoader getContextClassLoader()
public ExecutorServiceFactory getNotifyFactory()
public void setNotifyFactory(ExecutorServiceFactory notifyFactory)
notifyFactory - Value to set for property 'notifyFactory'.public ExecutorServiceFactory getWorkerFactory()
public void setWorkerFactory(ExecutorServiceFactory workerFactory)
workerFactory - Value to set for property 'factory'.
public boolean awaitDisposed(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
timeout - of type longunit - of type TimeUnit
java.lang.InterruptedException - whenpublic void dispose()
public Connection getConnection(java.lang.String connectionUrl,
java.lang.String username,
char[] password)
throws java.net.MalformedURLException,
java.io.IOException
connectionUrl - The connection URI.username - The username to connect with.password - The password to connect with.
java.net.MalformedURLException - If the URI is malformed or if the protocol is not supported.
java.io.IOException - If there was an IOException trying to establish the connection.public boolean isDisposing()
public boolean isDisposed()
|
Avaya Conferencing Provider API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||