1 22 package org.jboss.repository.plugins; 23 24 import org.jboss.repository.spi.MetaDataCombiner; 25 import org.jboss.repository.spi.Key; 26 import org.jboss.repository.spi.MetaData; 27 28 32 public class ThreadMetaDataCombiner 33 implements MetaDataCombiner 34 { 35 private static ThreadLocal metaData = new ThreadLocal (); 36 37 private MetaDataCombiner next; 38 39 public ThreadMetaDataCombiner(MetaDataCombiner next) 40 { 41 this.next = next; 42 } 43 44 public static Object getMetaData() 45 { 46 return metaData.get(); 47 } 48 public static void setMetaData(Object data) 49 { 50 metaData.set(data); 51 } 52 53 public MetaDataCombiner getNext() 54 { 55 return next; 56 } 57 public void setNext(MetaDataCombiner next) 58 { 59 this.next = next; 60 } 61 62 public Object combine(Key key, MetaData[] levelData) 63 { 64 Object value = metaData.get(); 65 if( value != null ) 66 return value; 67 value = next.combine(key, levelData); 68 return value; 69 } 70 } 71 | Popular Tags |