Search in sources :

Example 31 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class IltProvider method methodWithSingleStructParameters.

/*
     * methodWithSingleStructParameters
     */
@Override
public Promise<MethodWithSingleStructParametersDeferred> methodWithSingleStructParameters(ExtendedBaseStruct extendedBaseStructArg) {
    logger.warn("*****************************************************");
    logger.warn("* IltProvider.methodWithSingleStructParameters called");
    logger.warn("*****************************************************");
    MethodWithSingleStructParametersDeferred deferred = new MethodWithSingleStructParametersDeferred();
    if (!IltUtil.checkExtendedBaseStruct(extendedBaseStructArg)) {
        logger.error("methodWithSingleStructParameters: invalid parameter extendedBaseStructArg");
        deferred.reject(new ProviderRuntimeException("methodWithSingleStructParameters: invalid parameter extendedBaseStructArg"));
        return new Promise<MethodWithSingleStructParametersDeferred>(deferred);
    }
    // prepare output parameters
    ExtendedStructOfPrimitives extendedStructOfPrimitivesOut = IltUtil.createExtendedStructOfPrimitives();
    deferred.resolve(extendedStructOfPrimitivesOut);
    return new Promise<MethodWithSingleStructParametersDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) ExtendedStructOfPrimitives(joynr.interlanguagetest.namedTypeCollection2.ExtendedStructOfPrimitives) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 32 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class IltProvider method setAttributeExtendedExtendedBaseStruct.

@Override
public Promise<DeferredVoid> setAttributeExtendedExtendedBaseStruct(ExtendedExtendedBaseStruct attributeExtendedExtendedBaseStruct) {
    DeferredVoid deferred = new DeferredVoid();
    this.attributeExtendedExtendedBaseStruct = attributeExtendedExtendedBaseStruct;
    attributeExtendedExtendedBaseStructChanged(attributeExtendedExtendedBaseStruct);
    deferred.resolve();
    return new Promise<DeferredVoid>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) DeferredVoid(io.joynr.provider.DeferredVoid)

Example 33 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class IltProvider method methodWithSingleArrayParameters.

/*
     * methodWithSingleArrayParameters
     *
     * Return an array with the stringified double entries
     */
@Override
public Promise<MethodWithSingleArrayParametersDeferred> methodWithSingleArrayParameters(Double[] doubleArrayArg) {
    logger.warn("****************************************************");
    logger.warn("* IltProvider.methodWithSingleArrayParameters called");
    logger.warn("****************************************************");
    MethodWithSingleArrayParametersDeferred deferred = new MethodWithSingleArrayParametersDeferred();
    // check input parameter
    if (!IltUtil.checkDoubleArray(doubleArrayArg)) {
        logger.warn("methodWithMultiplePrimitiveParameters: invalid argument doubleArrayArg");
        deferred.reject(new ProviderRuntimeException("methodWithSingleArrayParameters: received wrong argument"));
        return new Promise<MethodWithSingleArrayParametersDeferred>(deferred);
    }
    // prepare output parameter
    String[] stringArrayOut = IltUtil.createStringArray();
    deferred.resolve(stringArrayOut);
    return new Promise<MethodWithSingleArrayParametersDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 34 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class IltProvider method setAttributeMapStringString.

@Override
public Promise<DeferredVoid> setAttributeMapStringString(MapStringString attributeMapStringString) {
    DeferredVoid deferred = new DeferredVoid();
    this.attributeMapStringString = attributeMapStringString;
    attributeMapStringStringChanged(attributeMapStringString);
    deferred.resolve();
    return new Promise<DeferredVoid>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) DeferredVoid(io.joynr.provider.DeferredVoid)

Example 35 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class IltProvider method methodToFireBroadcastWithMultiplePrimitiveParameters.

/*
     * methodToFireBroadcastWithMultiplePrimitiveParameters
     */
@Override
public Promise<DeferredVoid> methodToFireBroadcastWithMultiplePrimitiveParameters(String[] partitions) {
    logger.warn("*************************************************************************");
    logger.warn("* IltProvider.methodToFireBroadcastWithMultiplePrimitiveParameters called");
    logger.warn("*************************************************************************");
    DeferredVoid deferred = new DeferredVoid();
    Double doubleOut = 1.1d;
    String stringOut = "boom";
    fireBroadcastWithMultiplePrimitiveParameters(doubleOut, stringOut, partitions);
    deferred.resolve();
    return new Promise<DeferredVoid>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) DeferredVoid(io.joynr.provider.DeferredVoid)

Aggregations

Promise (io.joynr.provider.Promise)79 DeferredVoid (io.joynr.provider.DeferredVoid)36 ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)27 MapStringString (joynr.interlanguagetest.namedTypeCollection2.MapStringString)13 Method (java.lang.reflect.Method)9 ProviderWrapper (io.joynr.jeeintegration.ProviderWrapper)6 JoynrProvider (io.joynr.provider.JoynrProvider)6 Test (org.junit.Test)6 JoynrException (io.joynr.exceptions.JoynrException)5 Deferred (io.joynr.provider.Deferred)4 PromiseListener (io.joynr.provider.PromiseListener)4 ExtendedExtendedBaseStruct (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct)4 GlobalDiscoveryEntry (joynr.types.GlobalDiscoveryEntry)4 StructWithStringArray (joynr.interlanguagetest.namedTypeCollection1.StructWithStringArray)3 ExtendedTypeCollectionEnumerationInTypeCollection (joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection)3 DiscoveryEntry (joynr.types.DiscoveryEntry)3 DiscoveryEntryWithMetaInfo (joynr.types.DiscoveryEntryWithMetaInfo)3 DiscoveryQos (io.joynr.arbitration.DiscoveryQos)2 DiscoveryScope (io.joynr.arbitration.DiscoveryScope)2 ProviderContainer (io.joynr.provider.ProviderContainer)2