Package org.amplafi.flow

Examples of org.amplafi.flow.FlowPropertyDefinition


     */
    protected void saveBack() {
        Map<String, FlowPropertyDefinition> definitions = this.getPropertyDefinitions();
        if ( isNotEmpty(definitions)) {
            for (Map.Entry<String, FlowPropertyDefinition> entry : definitions.entrySet()) {
                FlowPropertyDefinition flowPropertyDefinition = entry.getValue();
                if (!flowPropertyDefinition.isCacheOnly() && flowPropertyDefinition.isSaveBack()) {
                    Object cached = getCached(entry.getKey());
                    if (cached != null) {
                        // this means that we miss case when the value has been
                        // discarded.
                        // but otherwise much worse case when the value simply was
View Full Code Here


        // would allow user to upgrade their permissions.
        // 2) should persistence be sequenced?
        Map<String, FlowPropertyDefinition> definitions = this.getPropertyDefinitions();
        if ( isNotEmpty(definitions)) {
            for (Map.Entry<String, FlowPropertyDefinition> entry : definitions.entrySet()) {
                FlowPropertyDefinition flowPropertyDefinition = entry.getValue();
                FlowPropertyValuePersister flowPropertyValuePersister = flowPropertyDefinition.getFlowPropertyValuePersister();
                if ( flowPropertyValuePersister != null) {
                    getFlowManagement().wireDependencies(flowPropertyValuePersister);
                    flowPropertyValuePersister.saveChanges(this, flowPropertyDefinition);
                }
            }
View Full Code Here

        return def;
    }

    @Override
    public void addPropertyDefinition(FlowPropertyDefinition definition) {
        FlowPropertyDefinition currentLocal;
        if (getPropertyDefinitions() == null) {
            setPropertyDefinitions(new LinkedHashMap<String, FlowPropertyDefinition>());
            currentLocal = null;
        } else if ( (currentLocal = getLocalPropertyDefinition(definition.getName())) != null) {
            // check against the FlowPropertyDefinition
            if ( !definition.isDataClassMergeable(currentLocal)) {
                getLog().warn(this.getFlowPropertyProviderFullName()+": has new (overriding) definition '"+definition+
                    "' with different data type than the previous definition '"+currentLocal+"'. The overriding definition will be used.");
            } else if (!definition.merge(currentLocal)) {
                getLog().debug(this.getFlowPropertyProviderFullName()
                                        + " has a new FlowPropertyDefinition '"
                                        + definition
                                        + "'(overriding) with the same data type but different scope or initializations that conflicts with previous definition " + currentLocal +
                                            ". Previous definition discarded.");
            }
            getPropertyDefinitions().remove(currentLocal.getName());
        }
        if (!definition.isLocal()) {
            // this property may be from the Flow definition itself.
            FlowPropertyDefinition current = this.getFlowPropertyDefinitionDefinedInFlow(definition.getName());
            if ( current != null && !definition.merge(current)) {
                if ( definition.isDataClassMergeable(current)) {
                    getLog().debug(this.getFlowPropertyProviderFullName()
                                        + " has a FlowPropertyDefinition '"
                                        + definition.getName()
View Full Code Here

     *
     * @param key
     * @return raw string property.
     */
    public String getRawProperty(String key) {
        FlowPropertyDefinition flowPropertyDefinition = getFlowPropertyDefinitionWithCreate(key, null, null);
        return getRawProperty(flowPropertyDefinition);
    }
View Full Code Here

    }
    @SuppressWarnings("unchecked")
    @Override
    public <T> T getProperty(String key, Class<? extends T> expected) {
        // doing the FlowPropertyDefinition here so that the flow doesn't create a global property.
        FlowPropertyDefinition flowPropertyDefinition = getFlowPropertyDefinitionWithCreate(key, expected, null);
        T result = (T) getFlowStateImplementor().getPropertyWithDefinition(this, flowPropertyDefinition);
        return result;
    }
View Full Code Here

TOP

Related Classes of org.amplafi.flow.FlowPropertyDefinition

Copyright © 2018 www.massapicom. 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.