FileDocCategorySizeDatePackage
MergeMetaDataInterceptor.javaAPI DocJBoss 4.2.13088Fri Jul 13 21:02:26 BST 2007org.jboss.aspects.remoting

MergeMetaDataInterceptor

public class MergeMetaDataInterceptor extends Object implements org.jboss.aop.advice.Interceptor, Serializable
Prepare Metadata to be marshalled across the wire. This interceptor iterates through an Invocation's metadata resolver list to pull out transportable metadata and stuff it into the invocation
author
Bill Burke
version
$Revision: 57186 $

Fields Summary
private static final long
serialVersionUID
public static final MergeMetaDataInterceptor
singleton
Constructors Summary
Methods Summary
public java.lang.StringgetName()


       return "MergeMetaDataInterceptor"; 
public java.lang.Objectinvoke(org.jboss.aop.joinpoint.Invocation invocation)

      org.jboss.aop.metadata.SimpleMetaData merged = null;
      merged = merge(invocation, ((InvocationBase)invocation).getInstanceResolver(), merged);

      org.jboss.aop.metadata.MetaDataResolver threadMetaData = org.jboss.aop.metadata.ThreadMetaData.instance().getAllMetaData(invocation);
      merged = merge(invocation, threadMetaData, merged);

      if (merged != null)
      {
         // Invocation data should override all merged data
         merged.mergeIn(invocation.getMetaData());

         // replace invocation's metadata with merged
         invocation.setMetaData(merged);
      }
      return invocation.invokeNext();
   
protected org.jboss.aop.metadata.SimpleMetaDatamerge(org.jboss.aop.joinpoint.Invocation invocation, org.jboss.aop.metadata.MetaDataResolver resolver, org.jboss.aop.metadata.SimpleMetaData merged)

      if (resolver == null) return merged;
      org.jboss.aop.metadata.SimpleMetaData metadata =  resolver.getAllMetaData(invocation);
      if (metadata == null) return merged;
      if (merged == null)
      {
         merged = new org.jboss.aop.metadata.SimpleMetaData();
      }
      merged.mergeIn(metadata);
      return merged;