Search in sources :

Example 6 with Promise

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

the class IltProvider method overloadedMethodWithSelector.

/*
     * overloadedMethodWithSelector (2)
     */
@Override
public Promise<OverloadedMethodWithSelector1Deferred> overloadedMethodWithSelector(Boolean booleanArg) {
    logger.warn("*************************************************");
    logger.warn("* IltProvider.overloadedMethodWithSelector called");
    logger.warn("*************************************************");
    OverloadedMethodWithSelector1Deferred deferred = new OverloadedMethodWithSelector1Deferred();
    // check input parameter
    if (booleanArg != false) {
        logger.warn("overloadedMethodWithSelector: invalid argument booleanArg");
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: invalid parameter booleanArg"));
        return new Promise<OverloadedMethodWithSelector1Deferred>(deferred);
    }
    // setup output parameter
    String stringOut = "Return value from overloadedMethodWithSelector 2";
    deferred.resolve(stringOut);
    return new Promise<OverloadedMethodWithSelector1Deferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 7 with Promise

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

the class IltProvider method methodToFireBroadcastWithMultipleByteBufferParameters.

/*
     * methodToFireBroadcastWithMultipleByteBufferParameters
     */
@Override
public Promise<DeferredVoid> methodToFireBroadcastWithMultipleByteBufferParameters(Byte[] byteBufferIn1, Byte[] byteBufferIn2, String[] partitions) {
    logger.info("**************************************************************************");
    logger.info("* IltProvider.methodToFireBroadcastWithMultipleByteBufferParameters called");
    logger.info("**************************************************************************");
    DeferredVoid deferred = new DeferredVoid();
    fireBroadcastWithMultipleByteBufferParameters(byteBufferIn1, byteBufferIn2, partitions);
    deferred.resolve();
    return new Promise<DeferredVoid>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) DeferredVoid(io.joynr.provider.DeferredVoid)

Example 8 with Promise

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

the class IltProvider method methodToFireBroadcastWithSingleEnumerationParameter.

/*
     * methodToFireBroadcastWithSingleEnumerationParameter
     */
@Override
public Promise<DeferredVoid> methodToFireBroadcastWithSingleEnumerationParameter(String[] partitions) {
    logger.warn("************************************************************************");
    logger.warn("* IltProvider.methodToFireBroadcastWithSingleEnumerationParameter called");
    logger.warn("************************************************************************");
    DeferredVoid deferred = new DeferredVoid();
    ExtendedTypeCollectionEnumerationInTypeCollection enumerationOut = ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION;
    fireBroadcastWithSingleEnumerationParameter(enumerationOut, partitions);
    deferred.resolve();
    return new Promise<DeferredVoid>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) ExtendedTypeCollectionEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection) DeferredVoid(io.joynr.provider.DeferredVoid)

Example 9 with Promise

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

the class IltProvider method methodWithoutErrorEnum.

/*
     * methodWithoutErrorEnum
     */
@Override
public Promise<DeferredVoid> methodWithoutErrorEnum(String wantedExceptionArg) {
    logger.warn("*******************************************");
    logger.warn("* IltProvider.methodWithoutErrorEnum called");
    logger.warn("*******************************************");
    DeferredVoid deferred = new DeferredVoid();
    if (wantedExceptionArg.equals("ProviderRuntimeException")) {
        deferred.reject(new ProviderRuntimeException("Exception from methodWithoutErrorEnum"));
    } else {
        deferred.resolve();
    }
    return new Promise<DeferredVoid>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) DeferredVoid(io.joynr.provider.DeferredVoid) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 10 with Promise

use of io.joynr.provider.Promise 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)

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