/** * Get the current client context for this thread. Delegates to {@link #getCurrent()}. * * @return the current client context for this thread */ public static EJBClientContext requireCurrent() { return getCurrent(); }
/** * Create a new EJB session. * * @param statelessLocator the stateless locator identifying the stateful EJB * @param authenticationContext the authentication context to use for the request and the resultant proxy * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ static <T> StatefulEJBLocator<T> createSession(StatelessEJBLocator<T> statelessLocator, AuthenticationContext authenticationContext) throws Exception { final EJBClientContext clientContext = EJBClientContext.getCurrent(); return clientContext.createSession(statelessLocator, authenticationContext, null); }
public void configure(final Consumer<DiscoveryProvider> discoveryProviderConsumer, final Consumer<RegistryProvider> registryProviderConsumer) { discoveryProviderConsumer.accept((serviceType, filterSpec, result) -> { final RemoteEJBReceiver receiver = EJBClientContext.getCurrent().getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (receiver == null) { result.complete(); return DiscoveryRequest.NULL; } return receiver.getDiscoveredNodeRegistry().discover(serviceType, filterSpec, result); }); } }
EJBTransactionOperations(final Connection connection) throws IOException { final EJBClientContext ejbClientContext = EJBClientContext.getCurrent(); final RemoteEJBReceiver receiver = ejbClientContext.getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (receiver != null) { this.channel = receiver.getClientChannel(connection); } else { throw Logs.REMOTING.noRemoteTransportOnEJBContext(); } }
static <T> T createSessionProxy(final StatelessEJBLocator<T> statelessLocator, Supplier<AuthenticationContext> authenticationContextSupplier, NamingProvider namingProvider) throws Exception { final EJBClientContext clientContext = EJBClientContext.getCurrent(); // this is the auth context to use just for the invocation final AuthenticationContext authenticationContext; if (authenticationContextSupplier != null) { authenticationContext = authenticationContextSupplier.get(); } else { authenticationContext = AuthenticationContext.captureCurrent(); } final EJBSessionCreationInvocationContext context = clientContext.createSessionCreationInvocationContext(statelessLocator, authenticationContext); final StatefulEJBLocator<T> statefulLocator = clientContext.createSession(context, statelessLocator, namingProvider); final T proxy = createProxy(statefulLocator, authenticationContextSupplier); final Affinity weakAffinity = context.getWeakAffinity(); if (weakAffinity != null && Affinity.NONE != weakAffinity) { setWeakAffinity(proxy, weakAffinity); } return proxy; }
final EJBClientContext clientContext = EJBClientContext.getCurrent();
return DiscoveryRequest.NULL; final EJBClientContext ejbClientContext = getCurrent(); final RemoteEJBReceiver ejbReceiver = ejbClientContext.getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (ejbReceiver == null) {
/** * Get the current client context for this thread. Delegates to {@link #getCurrent()}. * * @return the current client context for this thread */ public static EJBClientContext requireCurrent() { return getCurrent(); }
/** * Get the current client context for this thread. Delegates to {@link #getCurrent()}. * * @return the current client context for this thread */ public static EJBClientContext requireCurrent() { return getCurrent(); }
/** * Create a new EJB session. * * @param statelessLocator the stateless locator identifying the stateful EJB * @param authenticationContext the authentication context to use for the request and the resultant proxy * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ static <T> StatefulEJBLocator<T> createSession(StatelessEJBLocator<T> statelessLocator, AuthenticationContext authenticationContext) throws Exception { final EJBClientContext clientContext = EJBClientContext.getCurrent(); return clientContext.createSession(statelessLocator, authenticationContext, null); }
/** * Create a new EJB session. * * @param statelessLocator the stateless locator identifying the stateful EJB * @param authenticationContext the authentication context to use for the request and the resultant proxy * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ static <T> StatefulEJBLocator<T> createSession(StatelessEJBLocator<T> statelessLocator, AuthenticationContext authenticationContext) throws Exception { final EJBClientContext clientContext = EJBClientContext.getCurrent(); return clientContext.createSession(statelessLocator, authenticationContext, null); }
EJBTransactionOperations(final Connection connection) throws IOException { final EJBClientContext ejbClientContext = EJBClientContext.getCurrent(); final RemoteEJBReceiver receiver = ejbClientContext.getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (receiver != null) { this.channel = receiver.getClientChannel(connection); } else { throw Logs.REMOTING.noRemoteTransportOnEJBContext(); } }
public void configure(final Consumer<DiscoveryProvider> discoveryProviderConsumer, final Consumer<RegistryProvider> registryProviderConsumer) { discoveryProviderConsumer.accept((serviceType, filterSpec, result) -> { final RemoteEJBReceiver receiver = EJBClientContext.getCurrent().getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (receiver == null) { result.complete(); return DiscoveryRequest.NULL; } return receiver.getDiscoveredNodeRegistry().discover(serviceType, filterSpec, result); }); } }
EJBTransactionOperations(final Connection connection) throws IOException { final EJBClientContext ejbClientContext = EJBClientContext.getCurrent(); final RemoteEJBReceiver receiver = ejbClientContext.getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (receiver != null) { this.channel = receiver.getClientChannel(connection); } else { throw Logs.REMOTING.noRemoteTransportOnEJBContext(); } }
public void configure(final Consumer<DiscoveryProvider> discoveryProviderConsumer, final Consumer<RegistryProvider> registryProviderConsumer) { discoveryProviderConsumer.accept((serviceType, filterSpec, result) -> { final RemoteEJBReceiver receiver = EJBClientContext.getCurrent().getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (receiver == null) { result.complete(); return DiscoveryRequest.NULL; } return receiver.getDiscoveredNodeRegistry().discover(serviceType, filterSpec, result); }); } }
static <T> T createSessionProxy(final StatelessEJBLocator<T> statelessLocator, Supplier<AuthenticationContext> authenticationContextSupplier, NamingProvider namingProvider) throws Exception { final EJBClientContext clientContext = EJBClientContext.getCurrent(); // this is the auth context to use just for the invocation final AuthenticationContext authenticationContext; if (authenticationContextSupplier != null) { authenticationContext = authenticationContextSupplier.get(); } else { authenticationContext = AuthenticationContext.captureCurrent(); } final EJBSessionCreationInvocationContext context = clientContext.createSessionCreationInvocationContext(statelessLocator, authenticationContext); final StatefulEJBLocator<T> statefulLocator = clientContext.createSession(context, statelessLocator, namingProvider); final T proxy = createProxy(statefulLocator, authenticationContextSupplier); final Affinity weakAffinity = context.getWeakAffinity(); if (weakAffinity != null && Affinity.NONE != weakAffinity) { setWeakAffinity(proxy, weakAffinity); } return proxy; }
static <T> T createSessionProxy(final StatelessEJBLocator<T> statelessLocator, Supplier<AuthenticationContext> authenticationContextSupplier, NamingProvider namingProvider) throws Exception { final EJBClientContext clientContext = EJBClientContext.getCurrent(); // this is the auth context to use just for the invocation final AuthenticationContext authenticationContext; if (authenticationContextSupplier != null) { authenticationContext = authenticationContextSupplier.get(); } else { authenticationContext = AuthenticationContext.captureCurrent(); } final EJBSessionCreationInvocationContext context = clientContext.createSessionCreationInvocationContext(statelessLocator, authenticationContext); final StatefulEJBLocator<T> statefulLocator = clientContext.createSession(context, statelessLocator, namingProvider); final T proxy = createProxy(statefulLocator, authenticationContextSupplier); final Affinity weakAffinity = context.getWeakAffinity(); if (weakAffinity != null && Affinity.NONE != weakAffinity) { setWeakAffinity(proxy, weakAffinity); } return proxy; }
final EJBClientContext clientContext = EJBClientContext.getCurrent();
final EJBClientContext clientContext = EJBClientContext.getCurrent();
return DiscoveryRequest.NULL; final EJBClientContext ejbClientContext = getCurrent(); final RemoteEJBReceiver ejbReceiver = ejbClientContext.getAttachment(RemoteTransportProvider.ATTACHMENT_KEY); if (ejbReceiver == null) {