@Override public void authorizeAccess() { AllowedMethodsInformation.checkAllowed(MethodType.GET_USER_TRANSACTION); } };
@Override public boolean getRollbackOnly() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_ROLLBACK_ONLY); return super.getRollbackOnly(); } }
@Override public void setRollbackOnly() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.SET_ROLLBACK_ONLY); super.setRollbackOnly(); }
public Principal getCallerPrincipal() { AllowedMethodsInformation.checkAllowed(MethodType.GET_CALLER_PRINCIPLE); // per invocation return instance.getComponent().getCallerPrincipal(); }
@Override public TimerService getTimerService() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_TIMER_SERVICE); if (stateful) { throw EjbLogger.ROOT_LOGGER.notAllowedFromStatefulBeans("getTimerService()"); } return super.getTimerService(); }
@Override public UserTransaction getUserTransaction() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_USER_TRANSACTION); return getComponent().getUserTransaction(); }
public UserTransaction getUserTransaction() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_USER_TRANSACTION); return getComponent().getUserTransaction(); }
public boolean isCallerInRole(String roleName) { AllowedMethodsInformation.checkAllowed(MethodType.IS_CALLER_IN_ROLE); return instance.getComponent().isCallerInRole(roleName); }
public TimerService getTimerService() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_TIMER_SERVICE); return instance.getComponent().getTimerService(); }
/** * Asserts that the timer is <i>not</i> in any of the following states: * <ul> * <li>{@link TimerState#CANCELED}</li> * <li>{@link TimerState#EXPIRED}</li> * </ul> * * @throws javax.ejb.NoSuchObjectLocalException if the txtimer was canceled or has expired */ protected void assertTimerState() { if (timerState == TimerState.EXPIRED) throw EjbLogger.EJB3_TIMER_LOGGER.timerHasExpired(); if (timerState == TimerState.CANCELED) throw EjbLogger.EJB3_TIMER_LOGGER.timerWasCanceled(); AllowedMethodsInformation.checkAllowed(MethodType.TIMER_SERVICE_METHOD); }
private void assertTimerServiceState() { AllowedMethodsInformation.checkAllowed(MethodType.TIMER_SERVICE_METHOD); if (isLifecycleCallbackInvocation() && !this.isSingletonBeanInvocation()) { throw EJB3_TIMER_LOGGER.failToInvokeTimerServiceDoLifecycle(); } }
public EJBLocalObject getEJBLocalObject() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_EJB_LOCAL_OBJECT); // to allow override per invocation final InterceptorContext invocation = CurrentInvocationContext.get(); return getComponent().getEJBLocalObject(invocation); }
public EJBObject getEJBObject() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_EJB_OBJECT); // to allow override per invocation final InterceptorContext invocation = CurrentInvocationContext.get(); return getComponent().getEJBObject(invocation); }
private void assertInvocationAllowed() { AllowedMethodsInformation.checkAllowed(MethodType.TIMER_SERVICE_METHOD); final InterceptorContext currentInvocationContext = CurrentInvocationContext.get(); if (currentInvocationContext == null) { return; } // If the method in current invocation context is null, // then it represents a lifecycle callback invocation Method invokedMethod = currentInvocationContext.getMethod(); if (invokedMethod == null) { // it's a lifecycle callback Component component = currentInvocationContext.getPrivateData(Component.class); if (!(component instanceof SingletonComponent)) { throw EjbLogger.EJB3_TIMER_LOGGER.failToInvokeTimerServiceDoLifecycle(); } } }
@Override public void setRollbackOnly() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.SET_ROLLBACK_ONLY); super.setRollbackOnly(); }
@Override public boolean getRollbackOnly() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_ROLLBACK_ONLY); return super.getRollbackOnly(); } }
@Override public UserTransaction getUserTransaction() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_USER_TRANSACTION); return getComponent().getUserTransaction(); }
public EJBLocalObject getEJBLocalObject() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_EJB_LOCAL_OBJECT); // to allow override per invocation final InterceptorContext invocation = CurrentInvocationContext.get(); return getComponent().getEJBLocalObject(invocation); }
private void assertTimerServiceState() { AllowedMethodsInformation.checkAllowed(MethodType.TIMER_SERVICE_METHOD); if (isLifecycleCallbackInvocation() && !this.isSingletonBeanInvocation()) { throw MESSAGES.failToInvokeTimerServiceDoLifecycle(); } }
public EJBObject getEJBObject() throws IllegalStateException { AllowedMethodsInformation.checkAllowed(MethodType.GET_EJB_OBJECT); // to allow override per invocation final InterceptorContext invocation = CurrentInvocationContext.get(); return getComponent().getEJBObject(invocation); }