forked from wildfly/wildfly
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
839d51e
commit 04fe489
Showing
6 changed files
with
124 additions
and
81 deletions.
There are no files selected for viewing
70 changes: 0 additions & 70 deletions
70
ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/SecurityDomainProcessor.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
.../as/ejb3/deployment/processors/annotation/SecurityDomainAnnotationInformationFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2010, Red Hat Inc., and individual contributors as indicated | ||
* by the @authors tag. See the copyright.txt 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 | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* 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: http://www.fsf.org. | ||
*/ | ||
package org.jboss.as.ejb3.deployment.processors.annotation; | ||
|
||
import org.jboss.as.ee.metadata.ClassAnnotationInformationFactory; | ||
import org.jboss.ejb3.annotation.SecurityDomain; | ||
import org.jboss.jandex.AnnotationInstance; | ||
|
||
/** | ||
* Processes the {@link org.jboss.ejb3.annotation.SecurityDomain} annotation on a session bean | ||
* | ||
* @author Stuart Douglas | ||
*/ | ||
public class SecurityDomainAnnotationInformationFactory extends ClassAnnotationInformationFactory<SecurityDomain, String> { | ||
|
||
protected SecurityDomainAnnotationInformationFactory() { | ||
super(SecurityDomain.class, null); | ||
} | ||
|
||
@Override | ||
protected String fromAnnotation(final AnnotationInstance annotationInstance) { | ||
return annotationInstance.value().asString(); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
.../java/org/jboss/as/ejb3/deployment/processors/merging/SecurityDomainMergingProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2010, Red Hat Inc., and individual contributors as indicated | ||
* by the @authors tag. See the copyright.txt 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 | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* 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: http://www.fsf.org. | ||
*/ | ||
package org.jboss.as.ejb3.deployment.processors.merging; | ||
|
||
import org.jboss.as.ee.component.EEApplicationClasses; | ||
import org.jboss.as.ee.component.EEModuleClassDescription; | ||
import org.jboss.as.ee.metadata.ClassAnnotationInformation; | ||
import org.jboss.as.ejb3.component.EJBComponentDescription; | ||
import org.jboss.as.server.deployment.DeploymentUnit; | ||
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; | ||
import org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex; | ||
import org.jboss.ejb3.annotation.SecurityDomain; | ||
import org.jboss.logging.Logger; | ||
|
||
/** | ||
* @author Stuart Douglas | ||
*/ | ||
public class SecurityDomainMergingProcessor extends AbstractMergingProcessor<EJBComponentDescription> { | ||
|
||
private static final Logger logger = Logger.getLogger(SecurityDomainMergingProcessor.class); | ||
|
||
public SecurityDomainMergingProcessor() { | ||
super(EJBComponentDescription.class); | ||
} | ||
|
||
@Override | ||
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { | ||
final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); | ||
//we only care about annotations on the bean class itself | ||
if (clazz == null) { | ||
return; | ||
} | ||
final ClassAnnotationInformation<SecurityDomain, String> securityDomain = clazz.getAnnotationInformation(SecurityDomain.class); | ||
if (securityDomain == null) { | ||
return; | ||
} | ||
if (!securityDomain.getClassLevelAnnotations().isEmpty()) { | ||
if (logger.isDebugEnabled()) { | ||
logger.debug("EJB " + description.getEJBName() + " is part of security domain " + securityDomain.getClassLevelAnnotations().get(0)); | ||
} | ||
description.setSecurityDomain(securityDomain.getClassLevelAnnotations().get(0)); | ||
} | ||
} | ||
|
||
@Override | ||
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters