|
JBoss EJB client 1.0.5.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 | |
---|---|
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. |
ClusterContext |
getClusterContext(String clusterName)
Returns a ClusterContext corresponding to the passed clusterName . |
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)
Returns a ClusterContext corresponding to the passed clusterName . |
static void |
lockSelector()
Prevent the selector from being changed again. |
void |
registerConnection(org.jboss.remoting3.Connection connection)
Register a Remoting connection with this client context. |
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)
Removes the cluster identified by the clusterName from this client context |
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, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, 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
RuntimePermission
public 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
RuntimePermission
public static void lockSelector()
SecurityException
.
SecurityException
- if a security manager is installed and you do not have the setEJBClientContextSelector
RuntimePermission
public static EJBClientContext getCurrent()
public static EJBClientContext requireCurrent() throws IllegalStateException
IllegalStateException
- if the current client context is not setpublic 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 nullpublic void registerConnection(org.jboss.remoting3.Connection connection)
connection
- the connection to registerpublic 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 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
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
public void removeCluster(String clusterName)
clusterName
from this client context
clusterName
- The name of the cluster
|
JBoss EJB client 1.0.5.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |