Search in sources :

Example 6 with ProviderRuntimeException

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

the class IltProvider method setAttributeWithExceptionFromSetter.

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

Example 7 with ProviderRuntimeException

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

the class IltProvider method overloadedMethodWithSelector.

/*
     * overloadedMethodWithSelector (3)
     */
@Override
public Promise<OverloadedMethodWithSelector2Deferred> overloadedMethodWithSelector(ExtendedExtendedEnumeration[] enumArrayArg, Long int64Arg, BaseStruct baseStructArg, Boolean booleanArg) {
    logger.warn("*************************************************");
    logger.warn("* IltProvider.overloadedMethodWithSelector called");
    logger.warn("*************************************************");
    OverloadedMethodWithSelector2Deferred deferred = new OverloadedMethodWithSelector2Deferred();
    /* check input */
    if (!IltUtil.checkExtendedExtendedEnumerationArray(enumArrayArg)) {
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare enumArrayArg"));
        return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
    }
    if (int64Arg != 1L) {
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare int64Arg"));
        return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
    }
    if (!IltUtil.checkBaseStruct(baseStructArg)) {
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare baseStructArg"));
        return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
    }
    if (booleanArg != false) {
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare booleanArg"));
        return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
    }
    /* prepare output */
    Double doubleOut = 1.1d;
    String[] stringArrayOut = IltUtil.createStringArray();
    ExtendedBaseStruct extendedBaseStructOut = IltUtil.createExtendedBaseStruct();
    deferred.resolve(doubleOut, stringArrayOut, extendedBaseStructOut);
    return new Promise<OverloadedMethodWithSelector2Deferred>(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 8 with ProviderRuntimeException

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

the class IltProviderBean method methodWithSingleEnumParameters.

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

Example 9 with ProviderRuntimeException

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

the class IltProviderBean method methodWithSingleStructParameters.

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

Example 10 with ProviderRuntimeException

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

the class IltProviderBean method methodWithMultipleEnumParameters.

/*
     * methodWithMultipleEnumParameters
     *
     * return fixed values for now
     */
@Override
public MethodWithMultipleEnumParametersReturned methodWithMultipleEnumParameters(Enumeration enumerationArg, ExtendedTypeCollectionEnumerationInTypeCollection extendedEnumerationArg) {
    logger.warn("*****************************************************");
    logger.warn("* IltProvider.methodWithMultipleEnumParameters called");
    logger.warn("*****************************************************");
    // check input parameters
    if (enumerationArg != joynr.interlanguagetest.Enumeration.ENUM_0_VALUE_3 || extendedEnumerationArg != ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION) {
        logger.warn("methodWithMultipleEnumParameters: invalid argument enumerationArg or extendedEnumerationArg");
        throw new ProviderRuntimeException("methodWithMultipleEnumParameters: received wrong argument");
    }
    // prepare output parameters
    ExtendedEnumerationWithPartlyDefinedValues extendedEnumerationOut = ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES;
    Enumeration enumerationOut = Enumeration.ENUM_0_VALUE_1;
    return new MethodWithMultipleEnumParametersReturned(extendedEnumerationOut, enumerationOut);
}
Also used : Enumeration(joynr.interlanguagetest.Enumeration) ExtendedExtendedEnumeration(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration) ExtendedEnumerationWithPartlyDefinedValues(joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues) 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