"mikezzz" wrote : I think including class metadata in the chain is a good idea.  The 
case I was looking at was similar to the following:
  | 
  | /**
  |   |  * @@persistent pk=Id
  |   |  */
  |   | public POJO {
  |   |   String Id;
  |   |   String name;
  |   |   /**
  |   |    * @@persistent_getter
  |   |    */
  |   |   public void getName() {
  |   |      return name;
  |   |   }
  |   | }
  |   | 
  |   | public GetInterceptor implements Interceptor
  |   | {
  |   |   public Object invoke(Invocation inv) throws Throwable {
  |   |      String pkFieldName = inv.getMetaData("persistent", "pk");
  |   |      Object o = inv.targetObject;
  |   |      Field f = o.getClass().getField(pkFieldName);
  |   |      selectFromDatabase("select * from POJO where id = ?", f.get(o));
  |   |      // Set the results in the target object.
  |   |     
  |   |      return inv.invokeNext();
  |   |   }
  |   | }
  | 
  | I would of thought that metadata could have similar semantics to variables with 
regard to scoping.  Class metadata could be overridden by Method or invocation 
metadata.  I realise it is still possible to get the class metadata from the advisor, 
but I am still confused as to why it isn't part of the chain.  Is it merely a JSR-175 
compliance thing (if so I'll stop my whining)?
  | 
  | Mike.

I think your suggestion is correct AND incorrect.

The metadata should model how JSR-175 models metadata.  A Class is a different thing 
than a method.  So, I disagree that classmetadata should be overriden with Method 
data.  That is what default metadata is for.

BUT, where I do agree is that Class metadata should be overridable from the invocation 
or ThreadMetaData.  In other words, there should be a getClassMetadata method on 
invocation or something like that.  I need to think about the correct semantics.

Bill

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834214#3834214

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834214


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to