Examples of Intent


Examples of org.apache.tuscany.sca.policy.Intent

    public void resolvePolicies(Object attachPoint, ModelResolver resolver) {
        if ( attachPoint instanceof PolicySetAttachPoint ) {
            PolicySetAttachPoint policySetAttachPoint = (PolicySetAttachPoint)attachPoint;
           
            List<Intent> requiredIntents = new ArrayList<Intent>();
            Intent resolvedIntent = null;
           
            if ( policySetAttachPoint instanceof Binding ) {
                if ( policySetAttachPoint.getType().isUnresolved() ) {
                    IntentAttachPointType resolved =
                        resolver.resolveModel(IntentAttachPointType.class, policySetAttachPoint.getType());
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

     * @param policyIntents list of policy intents
     * @param resolver
     */
    protected void resolveIntents(List<Intent> policyIntents, ModelResolver resolver) {
        List<Intent> requiredIntents = new ArrayList<Intent>();
        Intent resolvedIntent = null;
        for (Intent intent : policyIntents) {
            resolvedIntent = resolver.resolveModel(Intent.class, intent);
            requiredIntents.add(resolvedIntent);
        }
        policyIntents.clear();
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

                            component.setImplementation(implementation);
                            policyProcessor.readPolicies(implementation, reader);
                        } else if (REQUIRES_QNAME.equals(name)) {
                            List<QName> intents = getQNames(reader, INTENTS);
                            for (QName i : intents) {
                                Intent intent = policyFactory.createIntent();
                                intent.setName(i);
                                if (composite != null) {
                                    composite.getRequiredIntents().add(intent);
                                } else if (component != null) {
                                    component.getRequiredIntents().add(intent);
                                } else if (contract != null) {
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

        if (policyIntent != null) {
            //resolve all required intents
            List<Intent> requiredIntents = new ArrayList<Intent>();
            for (Intent requiredIntent : policyIntent.getRequiredIntents()) {
                if (requiredIntent.isUnresolved()) {
                    Intent resolvedRequiredIntent = definedIntents.get(requiredIntent.getName());
                    if (resolvedRequiredIntent != null) {
                        requiredIntents.add(resolvedRequiredIntent);
                    } else {
                        throw new SCADefinitionsBuilderException("Required Intent - " + requiredIntent
                            + " not found for ProfileIntent "
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

    private void buildQualifiedIntent(QualifiedIntent policyIntent, Map<QName, Intent> definedIntents)
        throws SCADefinitionsBuilderException {
        if (policyIntent != null) {
            //resolve the qualifiable intent
            Intent qualifiableIntent = policyIntent.getQualifiableIntent();
            if (qualifiableIntent.isUnresolved()) {
                Intent resolvedQualifiableIntent = definedIntents.get(qualifiableIntent.getName());

                if (resolvedQualifiableIntent != null) {
                    policyIntent.setQualifiableIntent(resolvedQualifiableIntent);
                } else {
                    throw new SCADefinitionsBuilderException("Qualifiable Intent - " + qualifiableIntent
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

        if (extensionType != null) {
            // resolve all provided intents
            List<Intent> alwaysProvided = new ArrayList<Intent>();
            for (Intent providedIntent : extensionType.getAlwaysProvidedIntents()) {
                if (providedIntent.isUnresolved()) {
                    Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
                    if (resolvedProvidedIntent != null) {
                        alwaysProvided.add(resolvedProvidedIntent);
                    } else {
                        throw new SCADefinitionsBuilderException(
                                                                 "Always Provided Intent - " + providedIntent
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

        if (extensionType != null) {
            // resolve all provided intents
            List<Intent> mayProvide = new ArrayList<Intent>();
            for (Intent providedIntent : extensionType.getMayProvideIntents()) {
                if (providedIntent.isUnresolved()) {
                    Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
                    if (resolvedProvidedIntent != null) {
                        mayProvide.add(resolvedProvidedIntent);
                    } else {
                        throw new SCADefinitionsBuilderException(
                                                                 "May Provide Intent - " + providedIntent
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

        if (policySet != null) {
            //resolve all provided intents
            List<Intent> providedIntents = new ArrayList<Intent>();
            for (Intent providedIntent : policySet.getProvidedIntents()) {
                if (providedIntent.isUnresolved()) {
                    Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
                    if (resolvedProvidedIntent != null) {
                        providedIntents.add(resolvedProvidedIntent);
                    } else {
                        throw new SCADefinitionsBuilderException("Provided Intent - " + providedIntent
                            + " not found for PolicySet "
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

    private void buildIntentsInMappedPolicies(PolicySet policySet, Map<QName, Intent> definedIntents)
        throws SCADefinitionsBuilderException {
        Map<Intent, List<Object>> mappedPolicies = new Hashtable<Intent, List<Object>>();
        for (Map.Entry<Intent, List<Object>> entry : policySet.getMappedPolicies().entrySet()) {
            Intent mappedIntent = entry.getKey();
            if (mappedIntent.isUnresolved()) {
                Intent resolvedMappedIntent = definedIntents.get(mappedIntent.getName());

                if (resolvedMappedIntent != null) {
                    mappedPolicies.put(resolvedMappedIntent, entry.getValue());
                } else {
                    throw new SCADefinitionsBuilderException("Mapped Intent - " + mappedIntent
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Intent

            event = reader.getEventType();
            switch (event) {
                case START_ELEMENT : {
                    name = reader.getName();
                    if ( POLICY_INTENT_MAP_QNAME.equals(name) ) {
                        Intent mappedIntent = policyFactory.createIntent();
                        mappedIntent.setName(getQName(reader, PROVIDES));
                        if ( policySet.getProvidedIntents().contains(mappedIntent) ) {
                            readIntentMap(reader, policySet, mappedIntent);
                        } else {
                            throw new ContributionReadException("Intent Map provides for Intent not spcified as provided by parent PolicySet - " + policySetName);
                        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.