Skip to content

Instantly share code, notes, and snippets.

public class FaultInterceptor extends AbstractSoapInterceptor {
public FaultInterceptor() {
super(Phase.MARSHAL);
}
@Override
public void handleMessage(SoapMessage message) throws Fault {
Fault fault = (Fault) message.getContent(Exception.class);
@ricston-git
ricston-git / pom.xml
Created January 4, 2013 10:40
Using xjc plugin in a project.
<project ...>
...
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
@ricston-git
ricston-git / pom.xml
Created January 4, 2013 10:52
jaxb-xjc_dependency
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ricston</groupId>
<artifactId>xjc-plugin-blog</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>XJC plugin</name>
<dependencies>
<dependency>
@ricston-git
ricston-git / XJCPlugin.java
Created January 4, 2013 10:54
xjc-plugin
package com.ricston;
import java.io.IOException;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import com.sun.codemodel.JBlock;
import com.sun.codemodel.JCodeModel;
import com.sun.codemodel.JFieldVar;
package com.ricston.monitor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mule.construct.Flow;
public class ConsistentlyFailingMonitor {
private long lastRecordedEventsReceived = 0;
private long lastRecordedFailedEvents = 0;
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:fix="http://www.mulesource.org/schema/mule/fix/3.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd
http://www.mulesource.org/schema/mule/fix/3.3 http://www.mulesource.org/schema/mule/fix/3.3/mule-fix.xsd
@ricston-git
ricston-git / hello.erl
Last active December 12, 2015 07:48
hello module for "Erlang erl_syntax - usage example" blog post.
-module(hello).
-export([send_hello/1, receive_hello/0]).
send_hello(To) ->
To ! {hello, self()}.
receive_hello() ->
receive
{hello, From} ->
{ok, From};
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
xmlns:rest="http://www.mulesoft.org/schema/mule/rest"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
// [Header, MTI = 0800, Bitmap, Field 7 = 1226124404, field 11 = 102, Field 70 = 301]
private static final byte[] ECHO_REQUEST = { 0x30, 0x30, 0x35, 0x35, 0x30, 0x38, 0x30, 0x30, 0x38, 0x32, 0x32, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x34,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x31, 0x32, 0x32, 0x36, 0x31, 0x32, 0x34, 0x34, 0x30, 0x34, 0x30, 0x30,
0x30, 0x31, 0x30, 0x32, 0x33, 0x30, 0x31 };
// [Header, MTI = 0810, Bitmap, Field 7 = 1226124404, field 11 = 102, Field 35 = 00, Field 70 = 301]
private static final byte[] ECHO_REPLY = { 0x30, 0x30, 0x35, 0x35, 0x30, 0x38, 0x31, 0x30, 0x38, 0x32, 0x32, 0x30, 0x30,
<cordova>
...
<access origin="http://ricston.com" subdomains="true"/>
...
</cordova>