-
1. Re: Injection of Security Domain annotation into the contain
starksm64 Mar 11, 2008 12:02 PM (in response to anil.saldhana)The JBossMetaData.securityDomain should be the authoritative source for this info. What is the plan on replacing the deprecated container.resolveAnnotation(SecurityDomain.class) with accessing the JBossMetaData.securityDomain value?
We also need to map the @SecurityDomain annotation onto the metadata model. The jboss-metadata does not process the jboss-ejb3-ext-api annotations. Are we going to integrate the ejb3 annotation into its annotation processing? -
2. Re: Injection of Security Domain annotation into the contain
anil.saldhana Mar 11, 2008 12:16 PM (in response to anil.saldhana)Yes, my follow up question for Carlo was how do I get hold of the metadata in the interceptors the right way.....
As you said, Scott, the meta model is the authoritative source.
container.resolveAnnotation has been deprecated by Carlo to prefer container.getAnnotation -
3. Re: Injection of Security Domain annotation into the contain
wolfc Mar 11, 2008 12:33 PM (in response to anil.saldhana)Which delegates to a MetaDataBridge which is a construct on top of MetaDataRetrieval which retrieves it from the attached meta data.
Currently the MetaDataBridges are configured in org.jboss.ejb3.aop.BeanContainer (core). In the future these should come from beans.xml. -
4. Re: Injection of Security Domain annotation into the contain
anil.saldhana Mar 11, 2008 2:33 PM (in response to anil.saldhana)org.jboss.ejb.deployers.MergedJBossMetaDataDeployer creates a merged metadata view (this takes care of the security domain cascading from the parent ear to the children aka war,ejb-jars). But the ejb3 container.getAnnotation is not taking the merged meta data into consideration.
The merged meta data view is available as:// Output the merged JBossMetaData unit.getTransientManagedObjects().addAttachment(JBossMetaData.class, mergedMetaData);
Reference: Carlo tells me - JBCTS-756 is related. -
5. Re: Injection of Security Domain annotation into the contain
starksm64 Mar 11, 2008 2:46 PM (in response to anil.saldhana)So the SecurityDomainMetaDataBridge should be mapping from the SecurityDomain annotation to the bean JBossEnterpriseBeanMetaData.securityDomain. I don't see that the SecurityDomainMetaDataBridge is being added to the AnnotationRepositoryToMetaData in BeanContainer. I guess that is all that is missing?
-
6. Re: Injection of Security Domain annotation into the contain
anil.saldhana Mar 11, 2008 3:21 PM (in response to anil.saldhana)SecurityDomainMetaDataBridge is currently a test class. I will try to clone it and see if that solves the issue.
-
7. Re: Injection of Security Domain annotation into the contain
starksm64 Mar 11, 2008 4:05 PM (in response to anil.saldhana)I tried it and its not getting seeing a security domain from the JBossEnterpriseBeanMetaData:
13:02:44,468 INFO [SecurityDomainMetaDataBridge] interface org.jboss.ejb3.annotation.SecurityDomain, BMD: null -
8. Re: Injection of Security Domain annotation into the contain
anil.saldhana Mar 12, 2008 2:42 PM (in response to anil.saldhana)The metadata instance in SecurityDomainMetaDataBridge is JBossSessionMetaData. The Merged Meta Data (JBossMetaData) is not picked up at all. Where is the link to get SecurityDMBridge to start seeing the merged meta data?
-
9. Re: Injection of Security Domain annotation into the contain
wolfc Mar 12, 2008 2:59 PM (in response to anil.saldhana)I have a sneaky suspicion that the merged meta data is not the input of Ejb3Deployer, that would also explain why I see generic bean meta data there.
-
10. Re: Injection of Security Domain annotation into the contain
anil.saldhana Mar 12, 2008 5:17 PM (in response to anil.saldhana)public Ejb3Deployer() { // TODO: when the annotation scanner deployer comes on, we will always have JBossMetaData //super(JBossMetaData.class); //addInput(JBossMetaData.class); addInput(MergedJBossMetaDataDeployer.EJB_MERGED_ATTACHMENT_NAME);
I tried setting the input in EJB3Deployer to use the mergedmetadata. So in the deploy method of ejb3deployer, I am seeing the merged meta data. But when the SecurityDomainMetaDataBridge is invoked, it is back to square one. Not the merged meta data. -
11. Re: Injection of Security Domain annotation into the contain
anil.saldhana Mar 12, 2008 5:28 PM (in response to anil.saldhana)Think I have figured it out.
-
12. Re: Injection of Security Domain annotation into the contain
anil.saldhana Mar 14, 2008 3:02 AM (in response to anil.saldhana)In SecurityDomainMetaDataBridge, the metadata is an instance of SessionMetaData whose parent is the MergedMetaData, so if I do beanmetadata.getJBossMetaData, I get hold of the merged meta data (from which I can pick the security domain)...
public class SecurityDomainMetaDataBridge implements MetaDataBridge<JBossEnterpriseBeanMetaData> { private static final Logger log = Logger.getLogger(SecurityDomainMetaDataBridge.class); public <A extends Annotation> A retrieveAnnotation(Class<A> annotationClass, JBossEnterpriseBeanMetaData beanMetaData, ClassLoader classLoader) { if (annotationClass == SecurityDomain.class) { String securityDomain = beanMetaData.getSecurityDomain(); if(securityDomain == null) securityDomain = beanMetaData.getJBossMetaData().getSecurityDomain(); //<==THIS ONE if (securityDomain != null) return annotationClass.cast(new SecurityDomainImpl(securityDomain)); } return null; }
Anything wrong here? -
13. Re: Injection of Security Domain annotation into the contain
anil.saldhana Mar 18, 2008 3:35 PM (in response to anil.saldhana)I have put in an implementation of the AnnotationMergedView in the JBoss MetaData project as per http://jira.jboss.com/jira/browse/JBMETA-7
Scott, can you give a cursory look at org.jboss.metadata.web.spec.AnnotatedMergedView? -
14. Re: Injection of Security Domain annotation into the contain
starksm64 Mar 18, 2008 5:04 PM (in response to anil.saldhana)I added a org.jboss.test.metadata.annotation.web.AnnotationWebUnitTestCase.testAnnotationMergedViewWithNoXml as a basic test of whether merging is working, and that is currently failing so take a look at that.
There needs to be merging of the xml/annotation info at the WebMetaData.