This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HibernateSessionAdvice { | |
private static Log logger = LogFactory.getLog(HibernateSessionAdvice.class); | |
public static final String DEFAULT_SESSION_FACTORY_BEAN_NAME = "sessionFactory"; | |
private String sessionFactoryBeanName = DEFAULT_SESSION_FACTORY_BEAN_NAME; | |
private boolean singleSession = true; | |
private FlushMode flushMode = FlushMode.MANUAL; | |
private SessionFactory sessionFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CloseHibernateSessionMP implements MessageProcessor { | |
private HibernateSessionAdvice advice; | |
public MuleEvent process(MuleEvent event) throws MuleException { | |
advice.closeSession(); | |
return event; | |
} | |
public HibernateSessionAdvice getAdvice() { | |
return advice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OpenHibernateSessionMP implements MessageProcessor { | |
private HibernateSessionAdvice advice; | |
public MuleEvent process(MuleEvent event) throws MuleException { | |
advice.openSession(); | |
return event; | |
} | |
public HibernateSessionAdvice getAdvice() { | |
return advice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="hibernateFlow"> | |
<http:inbound-endpoint address="${hibernateFlow}" exchange-pattern="request-response"> | |
<http:body-to-parameter-map-transformer/> | |
</http:inbound-endpoint> | |
... | |
<component> | |
<method-entry-point-resolver> | |
<include-entry-point method="methodA"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mulexml:jaxb-context name="jaxbContext" packageNames="com.democompany.models.transactions"/> | |
<flow name="validateXML"> | |
<vm:inbound-endpoint path="in" /> | |
<mulexml:jaxb-xml-to-object-transformer name="XmlToTrade" jaxbContext-ref="jaxbContext"/> | |
<enricher target="#[header:INVOCATION:validationResult]"> | |
<absoluterule:validation ruleSetClasses="com.democompany.rules.transactionvalidation.RuleSetTransactionRules" /> | |
</enricher> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="sendToServer"> | |
<http:inbound-endpoint address="http://localhost:1789/receiveRequest" exchange-pattern="request-response" /> | |
<http:body-to-parameter-map-transformer /> | |
<expression-transformer> | |
<return-argument evaluator="map-payload" expression="description" /> | |
</expression-transformer> | |
<!-- Add attachment.xml as an attachment to be sent to the WS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class R1 implements IValidationRule { | |
private Set<String> standingorderEtc; | |
... | |
public boolean validate(Transaction context) throws Exception { | |
Transaction current = context; | |
if (standingorderEtc.contains(current.getType())) { | |
return current.getAmount().compareTo(BigDecimal.valueOf(0)) < 0; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context: Transaction | |
Validation Rule "r1" | |
If the type is one of 'STANDINGORDER', 'BANKFEE' then the amount is less than 0 | |
Context: Transactions | |
Validation Rule "r2" | |
startBalance + the sum of transaction.amount = endBalance | |
Context: Transactions | |
Validation Rule "r3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<expression-transformer> | |
<return-argument evaluator="header" expression="INVOCATION:cxf_attachments" /> | |
</expression-transformer> | |
<expression-transformer> | |
<return-argument evaluator="groovy" expression="payload.iterator().next().getDataHandler().getContent()" /> | |
</expression-transformer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<http:inbound-endpoint address="http://localhost:1234/webServiceUrl" exchange-pattern="request-response"> | |
<cxf:jaxws-service serviceClass="com.WebService"> | |
<cxf:inInterceptors> | |
<spring:bean class="org.mule.module.cxf.support.CopyAttachmentInInterceptor"/> | |
</cxf:inInterceptors> | |
</cxf:jaxws-service> | |
</http:inbound-endpoint> |