/** * Test that the request and response messages in the supplied {@link MessageInfo} are compatible * * @param messageInfo the {@link MessageInfo} to test is compatible with the {@link ServerAuthModule} instances. * @throws IllegalArgumentException */ void testMessageInfo(MessageInfo messageInfo) throws IllegalArgumentException { Object requestMessage = messageInfo.getRequestMessage(); Object responseMessage = messageInfo.getResponseMessage(); for (AuthModuleWrapper wrapper : authModules) { ServerAuthModule sam = wrapper.getModule(); boolean requestAccepted = false; boolean responseAccepted = false; for (Class acceptedType : sam.getSupportedMessageTypes()) { if (acceptedType.isInstance(requestMessage)) requestAccepted = true; if (acceptedType.isInstance(responseMessage)) responseAccepted = true; if (responseAccepted && requestAccepted) { break; } } if (requestAccepted == false) throw log.unsupportedMessageType(requestMessage.getClass().getName(), sam.getClass().getName()); if (responseAccepted == false) throw log.unsupportedMessageType(responseMessage.getClass().getName(), sam.getClass().getName()); } }
List<Class> supportedTypes = Arrays.asList(sam.getSupportedMessageTypes());
List<Class> supportedTypes = Arrays.asList(sam.getSupportedMessageTypes());
/** * Test that the request and response messages in the supplied {@link MessageInfo} are compatible * * @param messageInfo the {@link MessageInfo} to test is compatible with the {@link ServerAuthModule} instances. * @throws IllegalArgumentException */ void testMessageInfo(MessageInfo messageInfo) throws IllegalArgumentException { Object requestMessage = messageInfo.getRequestMessage(); Object responseMessage = messageInfo.getResponseMessage(); for (AuthModuleWrapper wrapper : authModules) { ServerAuthModule sam = wrapper.getModule(); boolean requestAccepted = false; boolean responseAccepted = false; for (Class acceptedType : sam.getSupportedMessageTypes()) { if (acceptedType.isInstance(requestMessage)) requestAccepted = true; if (acceptedType.isInstance(responseMessage)) responseAccepted = true; if (responseAccepted && requestAccepted) { break; } } if (requestAccepted == false) throw log.unsupportedMessageType(requestMessage.getClass().getName(), sam.getClass().getName()); if (responseAccepted == false) throw log.unsupportedMessageType(responseMessage.getClass().getName(), sam.getClass().getName()); } }
/** * Test that the request and response messages in the supplied {@link MessageInfo} are compatible * * @param messageInfo the {@link MessageInfo} to test is compatible with the {@link ServerAuthModule} instances. * @throws IllegalArgumentException */ void testMessageInfo(MessageInfo messageInfo) throws IllegalArgumentException { Object requestMessage = messageInfo.getRequestMessage(); Object responseMessage = messageInfo.getResponseMessage(); for (AuthModuleWrapper wrapper : authModules) { ServerAuthModule sam = wrapper.getModule(); boolean requestAccepted = false; boolean responseAccepted = false; for (Class acceptedType : sam.getSupportedMessageTypes()) { if (acceptedType.isInstance(requestMessage)) requestAccepted = true; if (acceptedType.isInstance(responseMessage)) responseAccepted = true; if (responseAccepted && requestAccepted) { break; } } if (requestAccepted == false) throw log.unsupportedMessageType(requestMessage.getClass().getName(), sam.getClass().getName()); if (responseAccepted == false) throw log.unsupportedMessageType(responseMessage.getClass().getName(), sam.getClass().getName()); } }
checkMessageTypes(m[i].getSupportedMessageTypes()); m[i].initialize(requestPolicy, responsePolicy, cbh, acHelper.getInitProperties(i, properties));
checkMessageTypes(m[i].getSupportedMessageTypes()); m[i].initialize(requestPolicy, responsePolicy, cbh, acHelper.getInitProperties(i, properties));