[Design the new POJO MicroContainer] - Re: MDR doesn't work on annotated privates
by wolfc
"adrian(a)jboss.org" wrote : Why a new signature? The idea of the MetaData is that it should be able to
| load relevant metadata and the caller doesn't have to think too hard.
|
| If we are going to support I'd prefer to have something like:
|
|
| | <bean name="MetaDataRepository" ...>
| | <property name="joinpointInheritableAnnotations">
| | <set class="java.lang.Class">
| | <value>javax.ejb.PostConstruct</value>
| | </set>
| | ...
| |
|
| Then it would be configuratble which annotations you need to do
| the wangy search (no suprises or extra work for other annotations)
| and it would be transparent to the user of MetaData.
Doesn't this contradict the example you're about to give?
There the Sub.postConstruct override doesn't have the annotation, but if it's inheritable it would get one.
That's not what I want.
"adrian(a)jboss.org" wrote : Incidently, I think this semantic is broken, since it means you cannot
| override the annotations of the super class. Not very OOPS. :-)
|
|
| | public Sub extends Super
| | {
| | @Override
| | // No annotations here
| | public void postConstruct() {}
| |
| | // This is my postConstruct method
| | @PostConstruct
| | public void myPostConstruct() {}
| | }
| |
Yes you can, see EJB 3 12.4.1 the last bullet.
It's just that if there is a private method with a @PostConstruct it must be invoked regardless of the sub class (which is the weird part).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170310#4170310
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170310
17 years, 7 months
[Design of POJO Server] - Re: Integrating aop-mc-int bean metadata with AS5
by kabir.khan@jboss.com
Seems it was getting confused about the scopes. In the standalone version, the Bean MetaData annotations are added to the mutable scope by
| [INSTANCE=SomeRandomName]
|
In the AS version the mutable scope was
| [APPLICATION=vfszip:/Users/kabir/sourcecontrol/jboss-head/testsuite/output/lib/aop-scopeddependency-scoped.sar, INSTANCE=ScopedAlias_17_Factory$ScopedInterceptor]
|
When calling BasicKernelMetaDataRepository.getMetaData() with the context's scope
| [JVM=THIS, CLASS=class org.jboss.aop.asintegration.jboss5.ScopedVFSClassLoaderDomain, INSTANCE=ScopedManager_4_vfszip:/Users/kabir/sourcecontrol/jboss-head/testsuite/output/lib/aop-scopeddependency-scoped.sar]
|
the returned MetaData does not contain the added annotations in AS.
Modifying the code I copied from BeanMetaDataDeployer to
| KernelControllerContext context = new AbstractKernelControllerContext(null, deployment, null);
| //Make sure that the metadata from the deployment gets put into the context
| ScopeInfo scopeInfo = context.getScopeInfo();
| if (scopeInfo != null)
| {
| mergeScopes(scopeInfo.getScope(), unit.getScope());
| //mergeScopes(scopeInfo.getMutableScope(), unit.getMutableScope());
| }
|
| try
| {
| controller.install(context);
| }
|
So that the scope is simply
| [INSTANCE=ScopedAlias_17_Factory$ScopedInterceptor]
|
seems to get the aliases installed.
So that the alias is
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170305#4170305
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170305
17 years, 7 months
[Design the new POJO MicroContainer] - Re: MDR doesn't work on annotated privates
by adrian@jboss.org
"wolfc" wrote : "adrian(a)jboss.org" wrote :
| | I think we need a DeclaredMethodSignature. That should also solve the interfaces issue. Then I can put ejb3 meta data bridge on that one.
|
| Why a new signature? The idea of the MetaData is that it should be able to
| load relevant metadata and the caller doesn't have to think too hard.
|
| If we are going to support I'd prefer to have something like:
|
|
| | <bean name="MetaDataRepository" ...>
| | <property name="joinpointInheritableAnnotations">
| | <set class="java.lang.Class">
| | <value>javax.ejb.PostConstruct</value>
| | </set>
| | ...
| |
|
| Then it would be configuratble which annotations you need to do
| the wangy search (no suprises or extra work for other annotations)
| and it would be transparent to the user of MetaData.
|
| Incidently, I think this semantic is broken, since it means you cannot
| override the annotations of the super class. Not very OOPS. :-)
|
|
| | public Sub extends Super
| | {
| | @Override
| | // No annotations here
| | public void postConstruct() {}
| |
| | // This is my postConstruct method
| | @PostConstruct
| | public void myPostConstruct() {}
| | }
| |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170304#4170304
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170304
17 years, 7 months