if (!Message.MEPConstants.IN_OUT_PATTERN.equals(exchange.getPattern())) { final String msg = "The operation '" + operation + "' must use the pattern 'InOut'."; exchange.setError(new Exception(msg));
|| IN_OUT_PATTERN.equals(this.pattern) || IN_OPTIONAL_OUT_PATTERN.equals(this.pattern) || AbsItfOperation.MEPPatternConstants.IN_ONLY.equals(this.pattern) || AbsItfOperation.MEPPatternConstants.ROBUST_IN_ONLY.equals(this.pattern) || AbsItfOperation.MEPPatternConstants.IN_OUT.equals(this.pattern) || AbsItfOperation.MEPPatternConstants.IN_OPTIONAL_OUT .equals(this.pattern))) { return; } else if (OUT_MSG.equalsIgnoreCase(name) && (IN_OUT_PATTERN.equals(this.pattern) || IN_OPTIONAL_OUT_PATTERN.equals(this.pattern) || AbsItfOperation.MEPPatternConstants.IN_OUT.equals(this.pattern) || AbsItfOperation.MEPPatternConstants.IN_OPTIONAL_OUT .equals(this.pattern))) { return;
if (!Message.MEPConstants.IN_OUT_PATTERN.equals(exchange.getPattern())) { errorMsg = "The operation '" + operation + "' must use the pattern '" + Message.MEPConstants.IN_OUT_PATTERN + "'."; if (!Message.MEPConstants.IN_OUT_PATTERN.equals(exchange.getPattern())) { errorMsg = "The operation '" + operation + "' must use the pattern '" + Message.MEPConstants.IN_OUT_PATTERN + "'.";
onJBIResponseTransformation.value = null; if (MEPConstants.IN_ONLY_PATTERN.equals(jbiExchange.getPattern())) { this.lookForJBITransformationAsInOnly(jbiExchange, onJBIResponseTransformation); } else if (MEPConstants.IN_OUT_PATTERN.equals(jbiExchange.getPattern())) { this.lookForJBITransformationAsInOut(jbiExchange, onJBIResponseTransformation, outgoingXmlPayload); } else if (MEPConstants.ROBUST_IN_ONLY_PATTERN.equals(jbiExchange.getPattern())) { this.lookForJBITransformationAsRobustInOnly(jbiExchange, onJBIResponseTransformation, outgoingXmlPayload);
/** * Return a <code>MessageExchangeDecorator</code>, as * <code>InOnlyExchange, InOutExchange,...</code>, or * <code>MessageExchangeDecorator</code> if pattern is unknown. The * 'observer' role is set with the current MessageExchangeImpl.getRole() * property. * * @see javax.jbi.messaging.MessageExchangeFactory#createExchange(java.net.URI) */ public MessageExchange createExchangeDecorator(MessageExchangeImpl exchange, URI pattern) throws MessagingException { this.log.call(pattern); if (MessageExchangeImpl.IN_ONLY_PATTERN.equals(pattern) || AbsItfOperation.MEPPatternConstants.IN_ONLY.equals(pattern)) { return new InOnlyImpl(exchange, exchange.getRole()); } else if (MessageExchangeImpl.ROBUST_IN_ONLY_PATTERN.equals(pattern) || AbsItfOperation.MEPPatternConstants.ROBUST_IN_ONLY.equals(pattern)) { return new RobustInOnlyImpl(exchange, exchange.getRole()); } else if (MessageExchangeImpl.IN_OUT_PATTERN.equals(pattern) || AbsItfOperation.MEPPatternConstants.IN_OUT.equals(pattern)) { return new InOutImpl(exchange, exchange.getRole()); } else if (MessageExchangeImpl.IN_OPTIONAL_OUT_PATTERN.equals(pattern) || AbsItfOperation.MEPPatternConstants.IN_OPTIONAL_OUT.equals(pattern)) { return new InOptionalOutImpl(exchange, exchange.getRole()); } else { return new MessageExchangeDecorator(exchange, exchange.getRole()); } }
/** * @see javax.jbi.messaging.MessageExchange#getPattern() */ public URI getPattern() { // TODO : remove this test when the deprecated MEP constants are removed String version = null; final Package _package = Package.getPackage("org.ow2.petals.cdk"); if (_package != null) { version = _package.getImplementationVersion(); } if (version != null && "5.1".compareTo(version) <= 0) { return this.pattern; } else { if (AbsItfOperation.MEPPatternConstants.IN_ONLY.equals(this.pattern)) { return IN_ONLY_PATTERN; } else if (AbsItfOperation.MEPPatternConstants.ROBUST_IN_ONLY.equals(this.pattern)) { return ROBUST_IN_ONLY_PATTERN; } else if (AbsItfOperation.MEPPatternConstants.IN_OUT.equals(this.pattern)) { return IN_OUT_PATTERN; } else if (AbsItfOperation.MEPPatternConstants.IN_OPTIONAL_OUT.equals(this.pattern)) { return IN_OPTIONAL_OUT_PATTERN; } } return null; }
/** * Used to ensure the created decorator is coherent with the pattern set * * Note: it important to test RobustInOnly before InOnly and InOptionalOut before InOut because of the inheritance * of the implementation classes! */ private boolean mepIsValid(final MessageExchangeWrapper decorator) { if (decorator instanceof RobustInOnly) { return MEPPatternConstants.ROBUST_IN_ONLY.equals(decorator.getPattern()); } if (decorator instanceof InOnly) { return MEPPatternConstants.IN_ONLY.equals(decorator.getPattern()); } if (decorator instanceof InOptionalOut) { return MEPPatternConstants.IN_OPTIONAL_OUT.equals(decorator.getPattern()); } if (decorator instanceof InOut) { return MEPPatternConstants.IN_OUT.equals(decorator.getPattern()); } return true; }
/** * Return a <code>MessageExchangeDecorator</code> for Consumer, as * <code>InOnlyExchange, InOutExchange,...</code> * * @see javax.jbi.messaging.MessageExchangeFactory#createExchange(java.net.URI) */ public MessageExchange createExchange(URI pattern) throws MessagingException { this.log.call(pattern); if (!MessageExchangeImpl.IN_ONLY_PATTERN.equals(pattern) && !MessageExchangeImpl.ROBUST_IN_ONLY_PATTERN.equals(pattern) && !MessageExchangeImpl.IN_OUT_PATTERN.equals(pattern) && !MessageExchangeImpl.IN_OPTIONAL_OUT_PATTERN.equals(pattern) && !AbsItfOperation.MEPPatternConstants.IN_ONLY.equals(pattern) && !AbsItfOperation.MEPPatternConstants.ROBUST_IN_ONLY.equals(pattern) && !AbsItfOperation.MEPPatternConstants.IN_OUT.equals(pattern) && !AbsItfOperation.MEPPatternConstants.IN_OPTIONAL_OUT.equals(pattern)) { throw new MessagingException("This Message Exchange Pattern is not recognized by JBI."); } return this.createExchangeDecorator(this.createExchange(), pattern); }
private boolean isInOut() { return MEPPatternConstants.IN_OUT.equals(this.pattern); }
private boolean isInOptionalOut() { return MEPPatternConstants.IN_OPTIONAL_OUT.equals(this.pattern); }
protected boolean isRobustInOnlyPattern(final URI pattern) { return MEPPatternConstants.ROBUST_IN_ONLY.equals(pattern); }
protected boolean isInOutPattern(final URI pattern) { return MEPPatternConstants.IN_OUT.equals(pattern); }
protected boolean isInOptionalOutPattern(final URI pattern) { return MEPPatternConstants.IN_OPTIONAL_OUT.equals(pattern); }
private boolean isRobustInOnly() { return MEPPatternConstants.ROBUST_IN_ONLY.equals(this.pattern); }
private boolean isInOnly() { return MEPPatternConstants.IN_ONLY.equals(this.pattern); }
public void onJBIMessage(Exchange exchange) throws PEtALSCDKException { if (MEPConstants.IN_ONLY_PATTERN.equals(exchange.getPattern())) { sendJMSMessage(exchange); } else { throw new PEtALSCDKException("MessageExchangePattern not allowed :" + exchange.getPattern()); } }
@Override public Message pollResponseFromProvider() { try { MessageExchange msgExchange = ((MockDeliveryChannel) this.component.getContext() .getDeliveryChannel()).dequeueResponseToClient(); assert !MEPConstants.IN_ONLY_PATTERN.equals(msgExchange.getPattern()) : "Polling response from provider while processing an in only exchange is meaningless."; return new WrappedResponseFromProviderMessage(msgExchange); } catch (MessagingException e) { throw new UncheckedException("Impossible to poll response to consumer message", e); } }
private void checkPatternIsJBISupportedPattern(final URI pattern) throws MessagingException { if (!MEPPatternConstants.IN_ONLY.equals(pattern) && !MEPPatternConstants.ROBUST_IN_ONLY.equals(pattern) && !MEPPatternConstants.IN_OUT.equals(pattern) && !MEPPatternConstants.IN_OPTIONAL_OUT.equals(pattern)) { throw new MessagingException("This Message Exchange Pattern is not recognized by JBI."); } }
protected boolean isInOnlyPattern(final URI pattern) { return MEPPatternConstants.IN_ONLY.equals(pattern); } }