Search in sources :

Example 26 with ProviderRuntimeException

use of joynr.exceptions.ProviderRuntimeException in project joynr by bmwcarit.

the class IltProvider method overloadedMethod.

/*
     * overloadedMethod (2)
     */
@Override
public Promise<OverloadedMethod1Deferred> overloadedMethod(Boolean booleanArg) {
    logger.warn("*****************************************");
    logger.warn("* IltProvider.overloadedMethod called (2)");
    logger.warn("*****************************************");
    OverloadedMethod1Deferred deferred = new OverloadedMethod1Deferred();
    if (booleanArg != false) {
        logger.warn("overloadedMethod_2: invalid argument booleanArg");
        deferred.reject(new ProviderRuntimeException("overloadedMethod_2: invalid parameter baseStructArg"));
        return new Promise<OverloadedMethod1Deferred>(deferred);
    }
    String stringOut = "TestString 2";
    deferred.resolve(stringOut);
    return new Promise<OverloadedMethod1Deferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 27 with ProviderRuntimeException

use of joynr.exceptions.ProviderRuntimeException in project joynr by bmwcarit.

the class IltProvider method getAttributeWithExceptionFromGetter.

@Override
public Promise<Deferred<Boolean>> getAttributeWithExceptionFromGetter() {
    Deferred<Boolean> deferred = new Deferred<Boolean>();
    deferred.reject(new ProviderRuntimeException("Exception from getAttributeWithExceptionFromGetter"));
    return new Promise<Deferred<Boolean>>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) Deferred(io.joynr.provider.Deferred) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 28 with ProviderRuntimeException

use of joynr.exceptions.ProviderRuntimeException in project joynr by bmwcarit.

the class IltProvider method overloadedMethod.

/*
     * overloadedMethod (3)
     */
@Override
public Promise<OverloadedMethod2Deferred> overloadedMethod(ExtendedExtendedEnumeration[] enumArrayArg, Long int64Arg, BaseStruct baseStructArg, Boolean booleanArg) {
    logger.warn("*****************************************");
    logger.warn("* IltProvider.overloadedMethod called (3)");
    logger.warn("*****************************************");
    OverloadedMethod2Deferred deferred = new OverloadedMethod2Deferred();
    // check input parameter
    if (int64Arg != 1L || booleanArg != false) {
        logger.warn("overloadedMethod_3: invalid argument int64Arg or booleanArg");
        deferred.reject(new ProviderRuntimeException("overloadedMethod_3: invalid parameter int64Arg or booleanArg"));
        return new Promise<OverloadedMethod2Deferred>(deferred);
    }
    // check enumArrayArg
    if (!IltUtil.checkExtendedExtendedEnumerationArray(enumArrayArg)) {
        deferred.reject(new ProviderRuntimeException("overloadedMethod_3: invalid parameter enumArrayArg"));
        return new Promise<OverloadedMethod2Deferred>(deferred);
    }
    // check baseStructArg
    if (!IltUtil.checkBaseStruct(baseStructArg)) {
        logger.warn("overloadedMethod_3: invalid argument baseStructArg");
        deferred.reject(new ProviderRuntimeException("overloadedMethod_3: invalid parameter baseStructArg"));
        return new Promise<OverloadedMethod2Deferred>(deferred);
    }
    // setup output parameter
    Double doubleOut = 0d;
    String[] stringArrayOut = IltUtil.createStringArray();
    ExtendedBaseStruct extendedBaseStructOut = IltUtil.createExtendedBaseStruct();
    deferred.resolve(doubleOut, stringArrayOut, extendedBaseStructOut);
    return new Promise<OverloadedMethod2Deferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) ExtendedExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct) ExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 29 with ProviderRuntimeException

use of joynr.exceptions.ProviderRuntimeException in project joynr by bmwcarit.

the class IltProvider method methodWithSingleEnumParameters.

/*
     * methodWithSingleEnumParameters
     *
     * return fixed value for now
     */
@Override
public Promise<MethodWithSingleEnumParametersDeferred> methodWithSingleEnumParameters(ExtendedEnumerationWithPartlyDefinedValues enumerationArg) {
    logger.warn("***************************************************");
    logger.warn("* IltProvider.methodWithSingleEnumParameters called");
    logger.warn("***************************************************");
    MethodWithSingleEnumParametersDeferred deferred = new MethodWithSingleEnumParametersDeferred();
    // check input parameter
    if (enumerationArg != ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES) {
        logger.warn("methodWithSingleEnumParameters: invalid argument enumerationArg");
        deferred.reject(new ProviderRuntimeException("methodWithSingleEnumParameters: received wrong argument"));
        return new Promise<MethodWithSingleEnumParametersDeferred>(deferred);
    }
    // prepare output parameter
    ExtendedTypeCollectionEnumerationInTypeCollection enumerationOut = ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION;
    deferred.resolve(enumerationOut);
    return new Promise<MethodWithSingleEnumParametersDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) ExtendedTypeCollectionEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 30 with ProviderRuntimeException

use of joynr.exceptions.ProviderRuntimeException 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)

Aggregations

ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)67 Promise (io.joynr.provider.Promise)27 ApplicationException (joynr.exceptions.ApplicationException)23 Test (org.junit.Test)21 MapStringString (joynr.interlanguagetest.namedTypeCollection2.MapStringString)19 JoynrRuntimeException (io.joynr.exceptions.JoynrRuntimeException)13 DiscoveryException (io.joynr.exceptions.DiscoveryException)10 DeferredVoid (io.joynr.provider.DeferredVoid)10 JoynrIllegalStateException (io.joynr.exceptions.JoynrIllegalStateException)8 JoynrTimeoutException (io.joynr.exceptions.JoynrTimeoutException)8 JoynrWaitExpiredException (io.joynr.exceptions.JoynrWaitExpiredException)8 joynr.tests.testProxy (joynr.tests.testProxy)8 ExtendedExtendedBaseStruct (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct)6 InvocationTargetException (java.lang.reflect.InvocationTargetException)5 JoynrException (io.joynr.exceptions.JoynrException)4 ExtendedBaseStruct (joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct)4 JoynrVersion (io.joynr.JoynrVersion)3 DiscoveryQos (io.joynr.arbitration.DiscoveryQos)3 Deferred (io.joynr.provider.Deferred)3 PromiseListener (io.joynr.provider.PromiseListener)3