componentModel.addService(serviceModel);
}
// Check to see if a policy requirements have been defined
Requires requires = serviceClass.getAnnotation(Requires.class);
if (requires != null) {
for (SecurityPolicy secPolicy : requires.security()) {
if (secPolicy == SecurityPolicy.AUTHORIZATION) {
// authorization supports both interaction and implementation,
// and we want to add it as implementation to be more correct.
beanModel.addPolicyRequirement(secPolicy.getQName());
} else if (secPolicy.supports(PolicyType.INTERACTION)) {
serviceModel.addPolicyRequirement(secPolicy.getQName());
} else if (secPolicy.supports(PolicyType.IMPLEMENTATION)) {
beanModel.addPolicyRequirement(secPolicy.getQName());
} else {
throw BeanMessages.MESSAGES.unknownPolicy(secPolicy.toString());
}
}
for (TransactionPolicy txPolicy : requires.transaction()) {
if (txPolicy.supports(PolicyType.INTERACTION)) {
serviceModel.addPolicyRequirement(txPolicy.getQName());
} else if (txPolicy.supports(PolicyType.IMPLEMENTATION)) {
beanModel.addPolicyRequirement(txPolicy.getQName());
} else {