public interface ClientAdapter
In cases when your client side code depends on finer-grained interaction that would be unsuitable for stateless client invocation (for example JMS resources), ClientAdapter allow you to intercept the lookup process and construct client-side wrappers to return instead of direct remote proxy.
Adapter is registered in RemoteEJBContext via property
"fish.payara.clientAdapter". The property should refer to an instance
of ClientAdapter. To construct more complex sets of adapters, you can use CompositeClientAdapter and
ClientAdapterCustomizer
RemoteEJBContextFactory,
CompositeClientAdapter| Modifier and Type | Method and Description |
|---|---|
Optional<Object> |
makeLocalProxy(String jndiName,
Context remoteContext)
Construct local (client-side) proxy if name matches.
|
Optional<Object> makeLocalProxy(String jndiName, Context remoteContext) throws NamingException
jndiName being
looked up and if it matches adapter's adaptation, construct a local proxy and return it wrapped in an Optional<>.
Otherwise it must return Optional.empty().
Generated proxy intends calling other remote resources, it may use provided remoteContext, which
refers to instance of RemoteEJBContext. Note that provided
instance still applies this ClientAdapter, so it is not possible to wrap a remote object with behavior.
jndiName - jndi name requested for lookupremoteContext - naming context for remote EJB invocationNamingException - if downstream lookup fails, or other validation doesn't passCopyright © 2019. All rights reserved.