use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method setAttributeEnumeration.
@Override
public Promise<DeferredVoid> setAttributeEnumeration(Enumeration attributeEnumeration) {
DeferredVoid deferred = new DeferredVoid();
this.attributeEnumeration = attributeEnumeration;
attributeEnumerationChanged(attributeEnumeration);
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.Promise 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);
}
use of io.joynr.provider.Promise 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);
}
use of io.joynr.provider.Promise 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);
}
use of io.joynr.provider.Promise 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);
}
Aggregations