/** * Base method which loads the component type from the application-context attached to the * Spring implementation * */ public void load(SpringImplementation implementation, ModelResolver resolver, ProcessorContext context) throws ContributionReadException { //System.out.println("Spring TypeLoader - load method start"); ComponentType componentType = implementation.getComponentType(); /* Check that there is a component type object already set */ if (componentType == null) { throw new ContributionReadException("SpringXMLLoader load: implementation has no ComponentType object"); } if (componentType.isUnresolved()) { /* Fetch the location of the application-context file from the implementation */ loadFromXML(implementation, resolver, context); if (!componentType.isUnresolved()) implementation.setUnresolved(false); } // end if //System.out.println("Spring TypeLoader - load method complete"); } // end method load
private ComponentType getComponentType(ModelResolver resolver, JavaImplementation impl, ProcessorContext context) { String className = impl.getJavaClass().getName(); String componentTypeURI = className.replace('.', '/') + ".componentType"; ComponentType componentType = assemblyFactory.createComponentType(); componentType.setUnresolved(true); componentType.setURI(componentTypeURI); componentType = resolver.resolveModel(ComponentType.class, componentType, context); if (!componentType.isUnresolved()) { return componentType; } return null; }
if (!resolved.isUnresolved()) { return modelClass.cast(resolved);
if (!resolved.isUnresolved()) { return modelClass.cast(resolved);
public void resolve(WebImplementation implementation, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { // Resolve the component type String uri = implementation.getURI(); if (uri != null) { ComponentType componentType = assemblyFactory.createComponentType(); componentType.setURI("web.componentType"); componentType = resolver.resolveModel(ComponentType.class, componentType, context); if (!componentType.isUnresolved()) { // Initialize the implementation's services, references and properties implementation.getServices().addAll(componentType.getServices()); implementation.getReferences().addAll(componentType.getReferences()); implementation.getProperties().addAll(componentType.getProperties()); } } implementation.setUnresolved(false); }
if (componentType != null && !componentType.isUnresolved()) { Map<String, Reference> refMap = new HashMap<String, Reference>(); for (Reference ref : impl.getReferences()) {
if (ct.isUnresolved()) { if (componentType.isUnresolved()) { error(monitor, "UnableToResolveComponentType", resolver);
if (componentType != null && !componentType.isUnresolved()) {
if (componentType != null && !componentType.isUnresolved()) {
componentType.setURI(componentTypeURI); componentType = resolver.resolveModel(ComponentType.class, componentType, context); if (!componentType.isUnresolved()) { implementation.getProperties().addAll(componentType.getProperties()); implementation.getReferences().addAll(componentType.getReferences());
componentType.setUnresolved(true); componentType = resolver.resolveModel(ComponentType.class, componentType, context); if (componentType.isUnresolved()) { componentType = resolver.resolveModel(ComponentType.class, componentType, context); if (componentType.isUnresolved()) {