service.getRequiredIntents(),
service.getPolicySets());
// Read intents on the service interface methods
Method[] methods = javaInterface.getJavaClass().getMethods();
ConfiguredOperation confOp = null;
for (Method method: methods) {
if ( method.getAnnotation(Requires.class) != null ||
method.getAnnotation(PolicySets.class) != null ) {
confOp = assemblyFactory.createConfiguredOperation();
confOp.setName(method.getName());
confOp.setContractName(service.getName());
service.getConfiguredOperations().add(confOp);
readIntents(method.getAnnotation(Requires.class), confOp.getRequiredIntents());
readPolicySets(method.getAnnotation(PolicySets.class), confOp.getPolicySets());
}
}
}
}
// Read intents on the callback interface
if (javaInterfaceContract.getCallbackInterface() != null) {
JavaInterface javaCallbackInterface = (JavaInterface)javaInterfaceContract.getCallbackInterface();
if (javaCallbackInterface.getJavaClass() != null) {
Callback callback = service.getCallback();
if (callback == null) {
callback = assemblyFactory.createCallback();
service.setCallback(callback);
}
readIntentsAndPolicySets(javaCallbackInterface.getJavaClass(),
callback.getRequiredIntents(),
callback.getPolicySets());
// Read intents on the callback interface methods
Method[] methods = javaCallbackInterface.getJavaClass().getMethods();
ConfiguredOperation confOp = null;
for (Method method: methods) {
confOp = assemblyFactory.createConfiguredOperation();
confOp.setName(method.getName());
callback.getConfiguredOperations().add(confOp);
readIntents(method.getAnnotation(Requires.class), confOp.getRequiredIntents());
readPolicySets(method.getAnnotation(PolicySets.class), confOp.getPolicySets());
}
}
}
}
}