|
JBoss EJB client 2.0.0.Beta4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.ejb.client.Attachable
org.jboss.ejb.client.EJBClientContext
public final class EJBClientContext
The public API for an EJB client context. An EJB client context may be associated with (and used by) one or more threads concurrently.
| Method Summary | |
|---|---|
void |
close()
Closes the EJB client context and notifies any registered EJBClientContextListeners about
the context being closed. |
static EJBClientContext |
create()
Creates and returns a new client context. |
static EJBClientContext |
create(ClassLoader classLoader)
Creates and returns a new client context, using the given class loader to look for initializers. |
static EJBClientContext |
create(EJBClientConfiguration ejbClientConfiguration)
Creates and returns a new client context. |
static EJBClientContext |
create(EJBClientConfiguration ejbClientConfiguration,
ClassLoader classLoader)
Creates and returns a new client context, using the given class loader to look for initializers. |
protected void |
finalize()
|
ClusterContext |
getClusterContext(String clusterName)
Deprecated. |
static EJBClientContext |
getCurrent()
Get the current client context for this thread. |
EJBClientConfiguration |
getEJBClientConfiguration()
Returns the EJBClientConfiguration applicable to this EJB client context. |
ClusterContext |
getOrCreateClusterContext(String clusterName)
Deprecated. |
static ContextSelector<EJBClientContext> |
getSelector()
Returns the current EJB client context selector |
static boolean |
isSelectorLocked()
Returns true if the EJB client context cannot be changed because it has been lockSelector(). |
static void |
lockSelector()
Prevent the selector from being changed again. |
void |
registerConnection(org.jboss.remoting3.Connection connection)
Deprecated. |
void |
registerConnection(org.jboss.remoting3.Connection connection,
String remotingProtocol)
Register a Remoting connection with this client context. |
boolean |
registerEJBClientContextListener(EJBClientContextListener listener)
Registers a EJBClientContextListener for this EJBClientContext. |
boolean |
registerEJBReceiver(EJBReceiver receiver)
Register an EJB receiver with this client context. |
EJBClientInterceptor.Registration |
registerInterceptor(int priority,
EJBClientInterceptor clientInterceptor)
Register a client interceptor with this client context. |
void |
registerReconnectHandler(ReconnectHandler reconnectHandler)
Registers a ReconnectHandler in this EJBClientContext |
void |
removeCluster(String clusterName)
Deprecated. |
static EJBClientContext |
require(EJBClientContextIdentifier ejbClientContextIdentifier)
Returns a EJBClientContext which is identified by the passed ejbClientContextIdentifier. |
static EJBClientContext |
requireCurrent()
Get the current client context for this thread, throwing an exception if none is set. |
static ContextSelector<EJBClientContext> |
setConstantContext(EJBClientContext context)
Set a constant EJB client context. |
static ContextSelector<EJBClientContext> |
setSelector(ContextSelector<EJBClientContext> newSelector)
Sets the EJB client context selector. |
void |
unregisterEJBReceiver(EJBReceiver receiver)
Unregister (a previously registered) EJB receiver from this client context. |
void |
unregisterReconnectHandler(ReconnectHandler reconnectHandler)
Unregisters a ReconnectHandler from this EJBClientContext |
| Methods inherited from class org.jboss.ejb.client.Attachable |
|---|
getAttachment, getAttachments, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static EJBClientContext create()
public static EJBClientContext create(ClassLoader classLoader)
classLoader - the class loader. Cannot be null
public static EJBClientContext create(EJBClientConfiguration ejbClientConfiguration)
ejbClientConfiguration will
be used by this client context during any of the context management activities (like auto-creation
of remoting EJB receivers)
ejbClientConfiguration - The EJB client configuration. Can be null.
public static EJBClientContext create(EJBClientConfiguration ejbClientConfiguration,
ClassLoader classLoader)
ejbClientConfiguration will be used by this client context during any of
the context management activities (like auto-creation of remoting EJB receivers)
ejbClientConfiguration - The EJB client configuration. Can be null.classLoader - The class loader. Cannot be null
public static ContextSelector<EJBClientContext> setSelector(ContextSelector<EJBClientContext> newSelector)
newSelector - The selector to set. Cannot be null
SecurityException - if a security manager is installed and you do not have the setEJBClientContextSelector
RuntimePermissionpublic static ContextSelector<EJBClientContext> setConstantContext(EJBClientContext context)
context - the context to set
SecurityException - if a security manager is installed and you do not have the setEJBClientContextSelector RuntimePermissionpublic static ContextSelector<EJBClientContext> getSelector()
public static void lockSelector()
SecurityException.
SecurityException - if a security manager is installed and you do not have the setEJBClientContextSelector
RuntimePermissionpublic static boolean isSelectorLocked()
lockSelector().
Returns false otherwise.
public static EJBClientContext getCurrent()
public static EJBClientContext requireCurrent()
throws IllegalStateException
IllegalStateException - if the current client context is not set
public static EJBClientContext require(EJBClientContextIdentifier ejbClientContextIdentifier)
throws IllegalStateException
EJBClientContext which is identified by the passed ejbClientContextIdentifier.
The EJBClientContext is identified with the help of the current selector. If the
current selector is not of type IdentityEJBClientContextSelector or if that selector
can't return a EJBClientContext
for the passed ejbClientContextIdentifier then this method throws an IllegalStateException
ejbClientContextIdentifier - The EJB client context identifier
IllegalStateException - If this method couldn't find a EJBClientContext for the passed ejbClientContextIdentifierpublic boolean registerEJBReceiver(EJBReceiver receiver)
EJBReceiver has already been associated in this client context or if a receiver
with the same node name has already been associated in this client
context, then this method does not register the passed receiver and returns false.
receiver - the receiver to register
IllegalArgumentException - If the passed receiver is nullpublic void unregisterEJBReceiver(EJBReceiver receiver)
receiver - The EJB receiver to unregister
IllegalArgumentException - If the passed receiver is null@Deprecated public void registerConnection(org.jboss.remoting3.Connection connection)
connection - the connection to register
public void registerConnection(org.jboss.remoting3.Connection connection,
String remotingProtocol)
connection - the connection to registerremotingProtocol - The remoting protocol. Can be 'remote', 'http-remoting' or 'https-remoting'
public EJBClientInterceptor.Registration registerInterceptor(int priority,
EJBClientInterceptor clientInterceptor)
throws IllegalArgumentException
clientInterceptor is already added to this context with the same priority
then this method just returns the old EJBClientInterceptor.Registration. If however,
the clientInterceptor is already registered in this context with a different priority then this method
throws an IllegalArgumentException
priority - the absolute priority of this interceptor (lower runs earlier; higher runs later)clientInterceptor - the interceptor to register
IllegalArgumentException - if the given interceptor is null, the priority is less than 0, or the
given interceptor is already registered with a different prioritypublic EJBClientConfiguration getEJBClientConfiguration()
EJBClientConfiguration applicable to this EJB client context. Returns null
if this EJB client context isn't configured with a EJBClientConfiguration
public void registerReconnectHandler(ReconnectHandler reconnectHandler)
ReconnectHandler in this EJBClientContext
reconnectHandler - The reconnect handler. Cannot be nullpublic void unregisterReconnectHandler(ReconnectHandler reconnectHandler)
ReconnectHandler from this EJBClientContext
reconnectHandler - The reconnect handler to unregisterpublic boolean registerEJBClientContextListener(EJBClientContextListener listener)
EJBClientContextListener for this EJBClientContext. The EJBClientContextListener
will be notified of lifecycle events related to the EJBClientContext
listener - The EJB client context listener. Cannot be null.
listener was registered with this EJB client context. False otherwise.@Deprecated public ClusterContext getOrCreateClusterContext(String clusterName)
ClusterContext corresponding to the passed clusterName. If no
such cluster context exists, a new one is created and returned. Subsequent invocations on this
EJBClientContext for the same cluster name will return this same ClusterContext, unless
the cluster has been removed from this client context.
clusterName - The name of the cluster
@Deprecated public ClusterContext getClusterContext(String clusterName)
ClusterContext corresponding to the passed clusterName. If no
such cluster context exists, then this method returns null.
clusterName - The name of the cluster
@Deprecated public void removeCluster(String clusterName)
clusterName from this client context
clusterName - The name of the cluster
public void close()
throws IOException
EJBClientContextListeners about
the context being closed.
close in interface CloseableIOException
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
JBoss EJB client 2.0.0.Beta4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||