public MethodContext getMethodContext(final Method method) { MethodContext methodContext = methodContextMap.get(method); if (methodContext == null) { methodContext = new MethodContext(this, method); methodContextMap.put(method, methodContext); } return methodContext; }
public void addCdiMethodInterceptor(final Method method, final InterceptorData interceptor) { getMethodContext(method).addCdiInterceptor(interceptor); instanceScopedInterceptors.add(interceptor); }
public Duration getAccessTimeout(final Method beanMethod) { return getMethodContext(beanMethod).getAccessTimeout(); }
final MethodContext methodContext = beanContext.getMethodContext(entry.getKey()); final String s = value.concurrencyAttribute.toUpperCase(); methodContext.setLockType(LockType.valueOf(s)); final MethodContext methodContext = beanContext.getMethodContext(entry.getKey()); final Duration accessTimeout = new Duration(value.accessTimeout.time, TimeUnit.valueOf(value.accessTimeout.unit)); methodContext.setAccessTimeout(accessTimeout);
final Map.Entry<Method, MethodContext> entry = it.next(); final MethodContext methodContext = entry.getValue(); if (methodContext.getSchedules().size() > 0) { timerServiceRequired = true; final Method method = entry.getKey(); final Map.Entry<Method, MethodContext> entry = it.next(); final MethodContext methodContext = entry.getValue(); for (final ScheduleData scheduleData : methodContext.getSchedules()) { timerStore.createCalendarTimer(timerService, (String) beanContext.getDeploymentID(), if (entry.getValue().isAsynchronous() && beanContext.getTransactionType(entry.getKey()) == TransactionType.RequiresNew) { beanContext.setMethodTransactionAttribute(entry.getKey(), TransactionType.Required);
public boolean isAsynchronous(final Method method) { final Method matchingBeanMethod = getMatchingBeanMethod(method); final Class<?> returnType = matchingBeanMethod.getReturnType(); if (returnType != void.class && returnType != Future.class) { return false; } if (asynchronousClasses.contains(matchingBeanMethod.getDeclaringClass())) { return true; } final MethodContext methodContext = methodContextMap.get(matchingBeanMethod); return methodContext != null && methodContext.isAsynchronous(); }
public TransactionType getTransactionType() { return transactionType != null ? transactionType : beanMethod.getTransactionType(); }
private TimerService getTimerService() throws IllegalStateException { final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext beanContext = threadContext.getBeanContext(); final EjbTimerService timerService = beanContext.getEjbTimerService(); if (timerService == null) { throw new IllegalStateException("This ejb does not support timers " + beanContext.getDeploymentID()); } else if (beanContext.getEjbTimeout() == null) { boolean hasSchedules = false; for (final Iterator<Map.Entry<Method, MethodContext>> it = beanContext.iteratorMethodContext(); it.hasNext(); ) { final Map.Entry<Method, MethodContext> entry = it.next(); final MethodContext methodContext = entry.getValue(); if (methodContext.getSchedules().size() > 0) { hasSchedules = true; } } if (!hasSchedules) { log.error("This ejb does not support timers " + beanContext.getDeploymentID() + " due to no timeout method nor schedules in methodContext is configured"); } } return new TimerServiceImpl(timerService, threadContext.getPrimaryKey(), beanContext.getEjbTimeout()); } }
public LockType getConcurrencyAttribute(final Method beanMethod) { return getMethodContext(beanMethod).getLockType(); }
public List<InterceptorData> getMethodInterceptors(final Method method) { return getMethodContext(method).getInterceptors(); }
final Method method = methodContext.getBeanMethod(); if (method != null && method.getName().equals(mtd)) { // maybe we should check parameters too setTimeoutMethod(method);
final MethodContext methodContext = beanContext.getMethodContext(entry.getKey()); final String s = value.concurrencyAttribute.toUpperCase(); methodContext.setLockType(LockType.valueOf(s)); final MethodContext methodContext = beanContext.getMethodContext(entry.getKey()); final Duration accessTimeout = new Duration(value.accessTimeout.time, TimeUnit.valueOf(value.accessTimeout.unit)); methodContext.setAccessTimeout(accessTimeout);
final Map.Entry<Method, MethodContext> entry = it.next(); final MethodContext methodContext = entry.getValue(); if (methodContext.getSchedules().size() > 0) { timerServiceRequired = true; final Method method = entry.getKey(); final Map.Entry<Method, MethodContext> entry = it.next(); final MethodContext methodContext = entry.getValue(); for (final ScheduleData scheduleData : methodContext.getSchedules()) { timerStore.createCalendarTimer(timerService, (String) beanContext.getDeploymentID(), if (entry.getValue().isAsynchronous() && beanContext.getTransactionType(entry.getKey()) == TransactionType.RequiresNew) { beanContext.setMethodTransactionAttribute(entry.getKey(), TransactionType.Required);
public boolean isAsynchronous(final Method method) { final Method matchingBeanMethod = getMatchingBeanMethod(method); final Class<?> returnType = matchingBeanMethod.getReturnType(); if (returnType != void.class && returnType != Future.class) { return false; } if (asynchronousClasses.contains(matchingBeanMethod.getDeclaringClass())) { return true; } final MethodContext methodContext = methodContextMap.get(matchingBeanMethod); return methodContext != null && methodContext.isAsynchronous(); }
public TransactionType getTransactionType() { return transactionType != null ? transactionType : beanMethod.getTransactionType(); }
final Map.Entry<Method, MethodContext> entry = it.next(); final MethodContext methodContext = entry.getValue(); if (methodContext.getSchedules().size() > 0) { hasSchedules = true;
public LockType getConcurrencyAttribute(final Method beanMethod) { return getMethodContext(beanMethod).getLockType(); }
public List<InterceptorData> getMethodInterceptors(final Method method) { return getMethodContext(method).getInterceptors(); }
final Method method = methodContext.getBeanMethod(); if (method != null && method.getName().equals(mtd)) { // maybe we should check parameters too setTimeoutMethod(method);
public MethodContext getMethodContext(final Method method) { MethodContext methodContext = methodContextMap.get(method); if (methodContext == null) { methodContext = new MethodContext(this, method); methodContextMap.put(method, methodContext); } return methodContext; }