<T> StatefulEJBLocator<T> createSession(final StatelessEJBLocator<T> statelessLocator, final AuthenticationContext authenticationContext, final NamingProvider namingProvider) throws Exception { EJBSessionCreationInvocationContext context = createSessionCreationInvocationContext(statelessLocator, authenticationContext); return createSession(context, statelessLocator, namingProvider); }
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; }
<T> StatefulEJBLocator<T> createSession(final StatelessEJBLocator<T> statelessLocator, final AuthenticationContext authenticationContext, final NamingProvider namingProvider) throws Exception { EJBSessionCreationInvocationContext context = createSessionCreationInvocationContext(statelessLocator, authenticationContext); return createSession(context, statelessLocator, namingProvider); }
<T> StatefulEJBLocator<T> createSession(final StatelessEJBLocator<T> statelessLocator, final AuthenticationContext authenticationContext, final NamingProvider namingProvider) throws Exception { EJBSessionCreationInvocationContext context = createSessionCreationInvocationContext(statelessLocator, authenticationContext); return createSession(context, statelessLocator, namingProvider); }
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; }