Tag: deltaspike

Deltaspike和@Stateless Bean

我想用DeltaSpike-API保护我的“无状态”EJb。 @Stateless @Remote(UserServiceRemote.class) public class UserService implements UserServiceRemote 在方法级别,我有一个自定义注释“支持” @Support public void doSomething() {} 因此我写了一个自定义注释“@Support”: @Retention(value = RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD }) @Documented @SecurityBindingType public @interface Support { 我的自定义授权器看起来像: @Secures @Support public boolean doAdminCheck(Identity identity, IdentityManager identityManager, RelationshipManager relationshipManager) throws Exception { return hasRole(relationshipManager, identity.getAccount(), getRole(identityManager, “Support”)); } 在我的“beans.xml”文件中,我包括: org.apache.deltaspike.security.impl.extension.SecurityInterceptor 但是在我登录我的应用程序并在每次远程调用时调用“doSomething”方法后,无论我是否拥有该角色,都会忽略“支持”注释。 我做错了什么? 所有建议的Thanx!