protected JavaImplementation createImplementation(Class<?> clazz, IntrospectionContext context) { JavaImplementation implementation = new JavaImplementation(); implementation.setImplementationClass(clazz); InjectingComponentType componentType = new InjectingComponentType(clazz); implementation.setComponentType(componentType); return implementation; }
/** * Sets the ManagementInfo for this implementation. * * @param managementInfo the ManagementInfo */ public void setManagementInfo(ManagementInfo managementInfo) { managementInfo.setParent(this); this.managementInfo = managementInfo; }
public void visitType(Stateless annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { componentType.setScope(org.fabric3.api.model.type.component.Scope.STATELESS); } }
/** * Add a reference and its associated with an injection site. * * @param reference the reference to add * @param injectionSite the injection site for the reference */ public void add(Reference<ComponentType> reference, InjectionSite injectionSite) { super.add(reference); Injectable injectable = new Injectable(InjectableType.REFERENCE, reference.getName()); addInjectionSite(injectionSite, injectable); injectionSiteMapping.put(reference, injectionSite); }
public void applyHeuristics(InjectingComponentType componentType, Class<?> implClass, IntrospectionContext context) { // if there is already a defined constructor then do nothing if (componentType.getConstructor() != null) { return; } Constructor<?> ctor = findConstructor(implClass, componentType, context); componentType.setConstructor(ctor); }
public Signature(Constructor constructor) { name = "init"; setParameterTypes(constructor.getParameterTypes()); isConstructor = true; } /**
public void visitType(EagerInit annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { componentType.setInitLevel(50); }
/** * Adds an operation to be exposed to the runtime management framework. * * @param info the operation information */ public void addOperation(ManagementOperationInfo info) { info.setParent(this); operations.add(info); }
@Override public int hashCode() { return type.hashCode() * 31 + name.hashCode(); } }
public void visitMethod(Init annotation, Method method, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { if (!validate(method, context, componentType)) { return; } componentType.setInitMethod(method); }
public void visitMethod(Destroy annotation, Method method, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { if (!validate(method, context, componentType)) { return; } componentType.setDestroyMethod(method); }
protected JavaComponentBuilder(String name, Class<?> clazz) { String className = clazz.getName(); InjectingComponentType componentType = new InjectingComponentType(clazz); JavaImplementation implementation = new JavaImplementation(); implementation.setImplementationClass(clazz); implementation.setComponentType(componentType); component = new Component<>(name); component.setImplementation(implementation); }
/** * Add a property and its associated with an injection site. * * @param property the property to add * @param injectionSite the injection site for the property */ public void add(Property property, InjectionSite injectionSite) { super.add(property); Injectable injectable = new Injectable(InjectableType.PROPERTY, property.getName()); addInjectionSite(injectionSite, injectable); injectionSiteMapping.put(property, injectionSite); }
public void visitType(Composite annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { componentType.setScope(org.fabric3.api.model.type.component.Scope.COMPOSITE); } }
/** * Constructor that initializes this signature based on the supplied method. The name is taken from the method and the parameter types from the * method's parameter classes. * * @param method the method to initialize from */ public Signature(Method method) { name = method.getName(); setParameterTypes(method.getParameterTypes()); }
protected JavaComponentBuilder(String name, Object instance) { Class<?> clazz = instance.getClass(); String className = clazz.getName(); InjectingComponentType componentType = new InjectingComponentType(clazz); JavaImplementation implementation = new JavaImplementation(instance); implementation.setComponentType(componentType); implementation.setImplementationClass(clazz); component = new Component<>(name); component.setImplementation(implementation); }
/** * Adds a callback proxy definition and its associated injection site * * @param definition the callback proxy definition * @param injectionSite the proxy injection site */ public void add(Callback definition, InjectionSite injectionSite) { definition.setParent(this); String name = definition.getName(); callbacks.put(name, definition); Injectable injectable = new Injectable(InjectableType.CALLBACK, name); addInjectionSite(injectionSite, injectable); injectionSiteMapping.put(definition, injectionSite); }
public void visitType(Domain annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { componentType.setScope(org.fabric3.api.model.type.component.Scope.DOMAIN); } }
/** * Add a producer and its associated injection site. * * @param producer the producer to add * @param injectionSite the injection site for the producer */ public void add(Producer<ComponentType> producer, InjectionSite injectionSite) { super.add(producer); Injectable injectable = new Injectable(InjectableType.PRODUCER, producer.getName()); addInjectionSite(injectionSite, injectable); injectionSiteMapping.put(producer, injectionSite); }