Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * JBoss, Home of Professional Open Source.
   * Copyright 2011, Red Hat, Inc., and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site:
 import java.util.Set;

Holds the EJB component level security metadata.

For per method specific security metadata, take a look at EJBMethodSecurityMetaData

User: Jaikiran Pai

 public class EJBSecurityMetaData {
     private final String ejbName;
     private final String ejbClassName;

The security domain for this EJB component
     private final String securityDomain;

The run-as role (if any) for this EJB component
     private final String runAsRole;

The roles declared (via

on this EJB component
     private final Set<StringdeclaredRoles;


componentConfiguration Component configuration of the EJB component
     public EJBSecurityMetaData(final ComponentConfiguration componentConfiguration) {
         if (componentConfiguration.getComponentDescription() instanceof EJBComponentDescription == false) {
             throw new IllegalArgumentException(componentConfiguration.getComponentName() + " is not an EJB component");
         final EJBComponentDescription ejbComponentDescription = (EJBComponentDescriptioncomponentConfiguration.getComponentDescription();
         this. = ejbComponentDescription.getEJBClassName();
         this. = ejbComponentDescription.getEJBName();
         this. = ejbComponentDescription.getRunAs();
         this. = ejbComponentDescription.getSecurityDomain();
         // @DeclareRoles
         final Set<Stringroles = ejbComponentDescription.getDeclaredRoles();
         this. = roles == null ? Collections.<String>emptySet() : Collections.unmodifiableSet(roles);

Returns the roles that have been declared by the bean. Returns an empty set if there are no declared roles.

     public Set<StringgetDeclaredRoles() {
         return ;

Returns the run-as role associated with this bean. Returns null if there's no run-as role associated.

     public String getRunAs() {
         return this.;

Returns the security domain associated with the bean

    public String getSecurityDomain() {
        return this.;
New to GrepCode? Check out our FAQ X