Search in sources :

Example 51 with ProviderRuntimeException

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

the class IltProviderBean method methodWithExtendedErrorEnum.

/*
     * methodWithExtendedErrorEnum
     */
@Override
public void methodWithExtendedErrorEnum(String wantedExceptionArg) throws ApplicationException {
    logger.warn("************************************************");
    logger.warn("* IltProvider.methodWithExtendedErrorEnum called");
    logger.warn("************************************************");
    if (wantedExceptionArg.equals("ProviderRuntimeException")) {
        throw new ProviderRuntimeException("Exception from methodWithExtendedErrorEnum");
    } else if (wantedExceptionArg.equals("ApplicationException_1")) {
        throw new ApplicationException(MethodWithExtendedErrorEnumErrorEnum.ERROR_3_3_NTC);
    } else if (wantedExceptionArg.equals("ApplicationException_2")) {
        throw new ApplicationException(MethodWithExtendedErrorEnumErrorEnum.ERROR_2_1_TC2);
    }
}
Also used : ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 52 with ProviderRuntimeException

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

the class IltProviderBean method overloadedMethodWithSelector.

/*
     * overloadedMethodWithSelector (3)
     */
@Override
public OverloadedMethodWithSelectorOverloadedMethodWithSelector1Returned overloadedMethodWithSelector(ExtendedExtendedEnumeration[] enumArrayArg, Long int64Arg, BaseStruct baseStructArg, Boolean booleanArg) {
    logger.warn("*************************************************");
    logger.warn("* IltProvider.overloadedMethodWithSelector called");
    logger.warn("*************************************************");
    /* check input */
    if (!IltUtil.checkExtendedExtendedEnumerationArray(enumArrayArg)) {
        throw new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare enumArrayArg");
    }
    if (int64Arg != 1L) {
        throw new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare int64Arg");
    }
    if (!IltUtil.checkBaseStruct(baseStructArg)) {
        throw new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare baseStructArg");
    }
    if (booleanArg) {
        throw new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare booleanArg");
    }
    /* prepare output */
    Double doubleOut = 1.1d;
    String[] stringArrayOut = IltUtil.createStringArray();
    ExtendedBaseStruct extendedBaseStructOut = IltUtil.createExtendedBaseStruct();
    return new OverloadedMethodWithSelectorOverloadedMethodWithSelector1Returned(doubleOut, stringArrayOut, extendedBaseStructOut);
}
Also used : ExtendedExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct) ExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 53 with ProviderRuntimeException

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

the class IltProviderBean method overloadedMethod.

/*
     * overloadedMethod (2)
     */
@Override
public String overloadedMethod(Boolean booleanArg) {
    logger.warn("*****************************************");
    logger.warn("* IltProvider.overloadedMethod called (2)");
    logger.warn("*****************************************");
    if (booleanArg) {
        logger.warn("overloadedMethod_2: invalid argument booleanArg");
        throw new ProviderRuntimeException("overloadedMethod_2: invalid parameter baseStructArg");
    }
    String stringOut = "TestString 2";
    return stringOut;
}
Also used : MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 54 with ProviderRuntimeException

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

the class IltProviderBean method overloadedMethod.

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

Example 55 with ProviderRuntimeException

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

the class IltProviderBean method overloadedMethodWithSelector.

/*
     * overloadedMethodWithSelector (2)
     */
@Override
public String overloadedMethodWithSelector(Boolean booleanArg) {
    logger.warn("*************************************************");
    logger.warn("* IltProvider.overloadedMethodWithSelector called");
    logger.warn("*************************************************");
    // check input parameter
    if (booleanArg) {
        logger.warn("overloadedMethodWithSelector: invalid argument booleanArg");
        throw new ProviderRuntimeException("overloadedMethodWithSelector: invalid parameter booleanArg");
    }
    // setup output parameter
    String stringOut = "Return value from overloadedMethodWithSelector 2";
    return stringOut;
}
Also used : MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) 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