1 22 package org.jboss.annotation.ejb; 23 24 import java.lang.annotation.Annotation ; 25 import java.util.ArrayList ; 26 import java.util.HashMap ; 27 import java.util.Iterator ; 28 29 import javax.ejb.ActivationConfigProperty ; 30 31 import org.jboss.annotation.ejb.RemoteBinding; 32 33 37 public class ConsumerImpl implements Consumer 38 { 39 private String name = ""; 40 private HashMap <String , ActivationConfigProperty > activationConfig = new HashMap <String , ActivationConfigProperty >(); 41 42 public ConsumerImpl(Consumer consumer) 43 { 44 if (consumer != null) 45 { 46 name = consumer.name(); 47 if (consumer.activationConfig() != null) 48 { 49 for (ActivationConfigProperty prop : consumer.activationConfig()) 50 { 51 activationConfig.put(prop.propertyName(), prop); 52 } 53 } 54 } 55 } 56 57 public String name() 58 { 59 return name; 60 } 61 62 public void setName(String name) 63 { 64 this.name = name; 65 } 66 67 public ActivationConfigProperty [] activationConfig() 68 { 69 ActivationConfigProperty [] result = new ActivationConfigProperty [activationConfig.size()]; 70 int i = 0; 71 for (Iterator <ActivationConfigProperty > it = activationConfig.values().iterator() ; it.hasNext() ; ) 72 { 73 result[i++] = it.next(); 74 } 75 return result; 76 } 77 78 public void addActivationConfig(ActivationConfigProperty config) 79 { 80 activationConfig.put(config.propertyName(), config); 81 } 82 83 public Class <? extends Annotation > annotationType() 84 { 85 return null; 86 } 87 } 88 | Popular Tags |