Package org.switchyard

Examples of org.switchyard.Property


    }

    @Override
    @SuppressWarnings("unchecked")
    public <T> T getPropertyValue(String name) {
        Property property = getProperty(name);
        return property == null ? null : (T) property.getValue();
    }
View Full Code Here


        }
        _sequence.add(typeName);
    }

    private static TransformSequence get(final Exchange exchange) {
        Property sequenceProperty = exchange.getContext().getProperty(TransformSequence.class.getName());
        if (sequenceProperty != null) {
            return (TransformSequence)sequenceProperty.getValue();
        } else {
            return null;
        }
    }
View Full Code Here

        return containsPolicy(getRequired(exchange), policy);
    }

    @SuppressWarnings("unchecked")
    private static Set<Policy> getPolicies(Exchange exchange, String propertyName) {
        Property intentsProperty = exchange.getContext().getProperty(propertyName, Scope.EXCHANGE);
        Set<Policy> intents = new HashSet<Policy>();
        if (intentsProperty != null) {
            intents.addAll((Set<Policy>)intentsProperty.getValue());
        }
        return intents;
    }
View Full Code Here

            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        Property other = (Property) obj;
        if (getName() == null) {
            if (other.getName() != null) {
                return false;
            }
        } else if (!getName().equals(other.getName())) {
            return false;
        }
        if (getScope() != other.getScope()) {
            return false;
        }
        if (getValue() == null) {
            if (other.getValue() != null) {
                return false;
            }
        } else if (!getValue().equals(other.getValue())) {
            return false;
        }
        return true;
    }
View Full Code Here

        }
    }

    @Override
    public Property getProperty(String name) {
        Property property = getProperty(name, Scope.MESSAGE);
        return property == null ? getProperty(name, Scope.EXCHANGE) : property;
    }
View Full Code Here

    }

    @Override
    @SuppressWarnings("unchecked")
    public <T> T getPropertyValue(String name) {
        Property property = getProperty(name);
        return property == null ? null : (T) property.getValue();
    }
View Full Code Here

    }

    @Override
    @SuppressWarnings("unchecked")
    public <T> T getPropertyValue(String name) {
       Property prop = _properties.get(name);
       if (prop != null) {
           return (T) prop.getValue();
       }
       return null;
    }
View Full Code Here

        return _properties.get(name);
    }

    @Override
    public Property setProperty(String name, Object val) {
        Property p = new ContextProperty(name, _scope, val);
        _properties.put(p.getName(), p);
        return p;
    }
View Full Code Here

            _faultCount.incrementAndGet();
        } else {
            _successCount.incrementAndGet();
        }
       
        Property prop = exchange.getContext().getProperty(ExchangeCompletionEvent.EXCHANGE_DURATION);
        if (prop != null) {
            Long duration = (Long)prop.getValue();
            _totalTimeMS.addAndGet(duration);
            // check minTime
            if (_minTimeMS.intValue() == 0 || duration < _minTimeMS.intValue()) {
                _minTimeMS.set(duration.intValue());
            }
View Full Code Here

    }

    @Test
    public void testRemove() {
        _context.setProperty(PROP_NAME, PROP_VAL);
        Property p = _context.getProperty(PROP_NAME);
        Assert.assertEquals(PROP_VAL, p.getValue());
        _context.removeProperty(p);
        Assert.assertNull(_context.getProperty(PROP_NAME));
    }
View Full Code Here

TOP

Related Classes of org.switchyard.Property

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.