1 15 package org.apache.hivemind.annotations; 16 17 import org.apache.hivemind.service.Autowiring; 18 19 25 public class AbstractAnnotatedModule 26 { 27 private TypedRegistry _typedRegistry; 28 29 32 public TypedRegistry getRegistry() 33 { 34 return _typedRegistry; 35 } 36 37 41 public void setRegistry(TypedRegistry typedRegistry) 42 { 43 _typedRegistry = typedRegistry; 44 } 45 46 49 protected Autowiring getAutowiring() 50 { 51 return _typedRegistry.getAutowiring(); 52 } 53 54 59 protected <T> T autowireProperties(T target) 60 { 61 return (T) getAutowiring().autowireProperties(target); 62 } 63 64 69 protected <T> T service(String serviceId, Class <T> serviceInterface) 70 { 71 return _typedRegistry.getService(serviceId, serviceInterface); 72 } 73 74 80 protected <T> T service(Class <T> serviceInterface) 81 { 82 return _typedRegistry.getService(serviceInterface); 83 } 84 85 90 protected <T> T configuration(String configurationId, Class <T> configurationType) 91 { 92 return _typedRegistry.getConfiguration(configurationId, configurationType); 93 } 94 95 101 protected <T> T configuration(Class <T> configurationType) 102 { 103 return _typedRegistry.getConfiguration(configurationType); 104 } 105 106 } 107 | Popular Tags |