[Design the new POJO MicroContainer] - Re: Field signature usage
by alesj
"adrian(a)jboss.org" wrote :
| You really need to learn to explain things from first principles.
|
Yup, known old problem. :-)
"adrian(a)jboss.org" wrote :
| I don't even understand if there is a question in your post
| let alone what it is or what problem you are considering.
|
The problem that I have is that non-public fields are not part of MetaData.
The AEMDL only handles public fields:
| public MetaDataRetrieval getComponentMetaDataRetrieval(Signature signature)
| {
| ...
| else if (signature instanceof FieldSignature)
| {
| try
| {
| Field field = clazz.getField(signature.getName());
| return new AnnotatedElementMetaDataLoader(field);
| }
| catch (NoSuchFieldException e)
| {
| return null;
| }
| }
| }
|
Which means I cannot use the MetaData to get the underlying annotations for non-public fields, like I do it in my AbstractBeanAnnotationAdapter.
The question is, should/can I change the impl of AEMDL to handle non-public fields as well?
Better? :-)
"adrian(a)jboss.org" wrote :
| Assume I know nothing about AnnotatedElementMetaDataLoader
| (which I don't, other than it exists - you wrote it and I've never reviewed this code :-)
| or how it fits into the MC deployment protocol.
Nope, you wrote it, I just filled some of the missing pieces. ;-)
| /**
| * AnnotatedElementMetaDataLoader.
| *
| * @author <a href="adrian(a)jboss.com">Adrian Brock</a>
| * @version $Revision: 67291 $
| */
| public class AnnotatedElementMetaDataLoader extends BasicMetaDataLoader
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137077#4137077
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137077
18 years
[Design the new POJO MicroContainer] - Re: Field signature usage
by adrian@jboss.org
By way of example, let me take your post apart.... ;-)
"alesj" wrote : "adrian(a)jboss.org" wrote :
| | If you've done the field properties correctly, then this should just be
| | a case of using propertyInfo.get(Underlying)Annotations()
| | i.e. no getters/setters means use the field to get the annotations, but this
| | is all hidden from the caller - they are "property annotations"
| I'll still need that AnnotatedElementMetaDataLoader field change, for non-public fields.
|
Why? Is that your implementation choice, it is a fundamental requirement
for this to work? etc. State the problem not the solution.
anonymous wrote :
| It's the way I do annotation lookup in AbstractBeanAnnotationAdapter, going over MetaData to do the lookup:
|
| | FieldInfo field = pi.getFieldInfo();
| | if (field != null)
| | {
| | Signature sis = new FieldSignature(field);
| | MetaData cmdr = retrieval.getComponentMetaData(sis);
| | if (cmdr != null)
| | {
| | for(AnnotationPlugin plugin : fieldAnnotationPlugins)
| | {
| | if (isApplyPhase)
| | plugin.applyAnnotation(field, cmdr, visitor);
| | else
| | plugin.cleanAnnotation(field, cmdr, visitor);
| | }
| | }
| | else if (trace)
| | log.trace("No annotations for field " + field.getName());
| | }
| | [/code
| |
This shows you using the MetaData Repository (MDR)
not the field annotations. So if there's an issue, it is with the population
of the repository not this code.
I don't understand how the code you show has any relation
to field annotaions, since it doesn't use that api (at least directly).
And as I said above, I don't know this code and certainly can't assertain
how it works from a partial code snippet.
anonymous wrote :
| If the field is non-public and the mode is non-standard, this field will be a part of propertys, but I don't want to distinct between underlying annotations and instance annotations (which are only in metadata, right).
The conclusion is true, but what relevance that fact has to the rest of the sentence
is unclear to me. You need to "join the dots" :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137076#4137076
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137076
18 years
[Design the new POJO MicroContainer] - Re: Field signature usage
by adrian@jboss.org
"alesj" wrote : "adrian(a)jboss.org" wrote :
| | If you've done the field properties correctly, then this should just be
| | a case of using propertyInfo.get(Underlying)Annotations()
| | i.e. no getters/setters means use the field to get the annotations, but this
| | is all hidden from the caller - they are "property annotations"
| I'll still need that AnnotatedElementMetaDataLoader field change, for non-public fields.
| It's the way I do annotation lookup in AbstractBeanAnnotationAdapter, going over MetaData to do the lookup:
|
| | FieldInfo field = pi.getFieldInfo();
| | if (field != null)
| | {
| | Signature sis = new FieldSignature(field);
| | MetaData cmdr = retrieval.getComponentMetaData(sis);
| | if (cmdr != null)
| | {
| | for(AnnotationPlugin plugin : fieldAnnotationPlugins)
| | {
| | if (isApplyPhase)
| | plugin.applyAnnotation(field, cmdr, visitor);
| | else
| | plugin.cleanAnnotation(field, cmdr, visitor);
| | }
| | }
| | else if (trace)
| | log.trace("No annotations for field " + field.getName());
| | }
| |
| If the field is non-public and the mode is non-standard, this field will be a part of propertys, but I don't want to distinct between underlying annotations and instance annotations (which are only in metadata, right).
You really need to learn to explain things from first princples.
I don't even understand if there is a question in your post
let alone what it is or what problem you are considering.
Assume I know nothing about AnnotatedElementMetaDataLoader
(which I don't, other than it exists - you wrote it and I've never reviewed this code :-)
or how it fits into the MC deployment protocol.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137074#4137074
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137074
18 years
[Design the new POJO MicroContainer] - Re: Field signature usage
by alesj
"adrian(a)jboss.org" wrote :
| If you've done the field properties correctly, then this should just be
| a case of using propertyInfo.get(Underlying)Annotations()
| i.e. no getters/setters means use the field to get the annotations, but this
| is all hidden from the caller - they are "property annotations"
I'll still need that AnnotatedElementMetaDataLoader field change, for non-public fields.
It's the way I do annotation lookup in AbstractBeanAnnotationAdapter, going over MetaData to do the lookup:
| FieldInfo field = pi.getFieldInfo();
| if (field != null)
| {
| Signature sis = new FieldSignature(field);
| MetaData cmdr = retrieval.getComponentMetaData(sis);
| if (cmdr != null)
| {
| for(AnnotationPlugin plugin : fieldAnnotationPlugins)
| {
| if (isApplyPhase)
| plugin.applyAnnotation(field, cmdr, visitor);
| else
| plugin.cleanAnnotation(field, cmdr, visitor);
| }
| }
| else if (trace)
| log.trace("No annotations for field " + field.getName());
| }
|
If the field is non-public and the mode is non-standard, this field will be a part of propertys, but I don't want to distinct between underlying annotations and instance annotations (which are only in metadata, right).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137066#4137066
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137066
18 years
[Design the new POJO MicroContainer] - Re: Field injection
by adrian@jboss.org
"alesj" wrote : "adrian(a)jboss.org" wrote : In case its not clear
| Nope, not clear. :-)
| OK, I'm glad I didn't introduce security hole :-), but I don't see why your example will fail with the current code?
|
It won't fail with the current code.
anonymous wrote :
| And you're saying this field.setAcceessible should be in privileged block?
Yes, this object gets cached and used across threads. You can't guarantee
that the caller will be able to setAccessible(), but they still want to be able
to use the FieldInfo (even if they can't invoke on it).
Write some tests for the security stuff then you'll understand.
e.g. A caller doesn't have permission to setAccessible()
but still wants to generate a BeanInfo for the class (without the private fields).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137053#4137053
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137053
18 years
[Design of JBoss jBPM] - New jBPM Console
by fady.matar
We're currently building the new jBPM console that will be compliant with future versions of jBPM and I would like to get feedback from different members of the community before we finalize on the adopted strategy / environment for development.
The application will be built on top of JBoss Seam + Richfaces and in here we have a number of options:
1. The application can be built using POJOs and hence doesn't become dependent on EJB 3. The persistence mechanism will be either JPA or Hibernate and then the application can be deployed on Tomcat / JBoss AS
2. The application can be built using an enterprise methodology i.e. Entity Beans for persistence and Session Beans for all kind of business logic / actions. This will require a bootstrapped Tomcat installation or JBoss AS or any other EJB 3.0 compliant application server.
I would like to get the feedback to see what strategy to adopt, any thoughts on this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137051#4137051
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137051
18 years