Search in sources :

Example 1 with ReferenceMetadataImpl

use of org.apache.aries.blueprint.reflect.ReferenceMetadataImpl in project aries by apache.

the class Parser method parseReference.

private ComponentMetadata parseReference(Element element, boolean topElement) {
    ReferenceMetadataImpl reference = new ReferenceMetadataImpl();
    if (topElement) {
        reference.setId(getId(element));
    }
    parseReference(element, reference, topElement);
    String timeout = element.hasAttribute(TIMEOUT_ATTRIBUTE) ? element.getAttribute(TIMEOUT_ATTRIBUTE) : this.defaultTimeout;
    try {
        reference.setTimeout(Long.parseLong(timeout));
    } catch (NumberFormatException e) {
        throw new ComponentDefinitionException("Attribute " + TIMEOUT_ATTRIBUTE + " must be a valid long (was: " + timeout + ")");
    }
    ComponentMetadata r = reference;
    // Parse custom attributes
    r = handleCustomAttributes(element.getAttributes(), r);
    // Parse custom elements;
    r = handleCustomElements(element, r);
    return r;
}
Also used : ComponentDefinitionException(org.osgi.service.blueprint.container.ComponentDefinitionException) ComponentMetadata(org.osgi.service.blueprint.reflect.ComponentMetadata) ReferenceMetadataImpl(org.apache.aries.blueprint.reflect.ReferenceMetadataImpl) ServiceReferenceMetadataImpl(org.apache.aries.blueprint.reflect.ServiceReferenceMetadataImpl)

Aggregations

ReferenceMetadataImpl (org.apache.aries.blueprint.reflect.ReferenceMetadataImpl)1 ServiceReferenceMetadataImpl (org.apache.aries.blueprint.reflect.ServiceReferenceMetadataImpl)1 ComponentDefinitionException (org.osgi.service.blueprint.container.ComponentDefinitionException)1 ComponentMetadata (org.osgi.service.blueprint.reflect.ComponentMetadata)1