1<?xml version="1.0" encoding="UTF-8"?>
2<beans xmlns="http://www.springframework.org/schema/beans"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:u="http://www.adroitlogic.org/ultraesb"
5 xmlns:s="http://www.springframework.org/schema/security"
6 xsi:schemaLocation="
7http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
8http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
9http://www.adroitlogic.org/ultraesb http://schemas.adroitlogic.org/ultraesb/v2_6/ultraesb-artifacts.xsd">
10
11 <bean id="ultra-config" class="org.adroitlogic.ultraesb.core.ConfigurationImpl"/>
12
13 <bean id="fileCache" class="org.adroitlogic.ultraesb.core.PooledMessageFileCache">
14 <constructor-arg type="int" value="20"/>
15 </bean>
16
17 <bean id="http-8280" class="org.adroitlogic.ultraesb.transport.http.HttpNIOListener">
18 <constructor-arg ref="fileCache"/>
19 <property name="port" value="8280"/>
20 </bean>
21
22 <!--Demonstrates a basic query-only JSON data service. This only supports GET method, and is able to return one
23 or all rows from a table using the specified queries-->
24 <u:proxy id="basicEmployeeService">
25 <u:transport id="http-8280">
26 <u:property name="ultra.transport.url" value="basicEmployeeService*"/>
27 </u:transport>
28 <u:target>
29 <u:inSequence>
30 <u:java><![CDATA[
31 mediation.getJSONSupport().processBasicJSONDataServiceRequest(msg, "empJsonSvc", "dataSource");
32 ]]></u:java>
33 </u:inSequence>
34 </u:target>
35 </u:proxy>
36
37 <bean id="empJsonSvc" class="org.adroitlogic.ultraesb.core.helper.BasicJSONDataService" init-method="init">
38 <property name="queryMap">
39 <map>
40 <entry key="/getPermanentEmployees" value="select * from employee where permanent = 1"/>
41 <entry key="/getTaxPayers" value="select * from employee where salary > 20000"/>
42 <entry key="/getEmployee?{id:INTEGER}" value="SINGLE: select * from employee where employeeId = :id"/>
43 <entry key="/byDeptAndDivision/{department:INTEGER}/{division:INTEGER}?{age:INTEGER},{sex:VARCHAR}"
44 value="select * from employee where division = :division and department = :department and sex = :sex and age > :age"/>
45 <entry key="/{id:INTEGER}" value="SINGLE: select * from employee where employeeId = :id"/>
46 <entry key="" value="select * from employee"/>
47 </map>
48 </property>
49 </bean>
50
51 <!--Demonstrates a custom JSON data service, that supports GET, POST, PUT and DELETE operations on the Employee
52 domain object. Uses the Springframework to invoke JDBC calls, and the Jackson parser to generate and parse
53 requests and responses as JSON. Is exposed at a user specified custom URL /employees. The sequence may be easily
54 step-through debugged with a standard Java IDE -->
55 <u:proxy id="employees">
56 <u:transport id="http-8280">
57 <u:property name="ultra.transport.url" value="/employees*"/>
58 </u:transport>
59 <u:target>
60 <u:inSequence>
61 <u:class name="samples.json.JsonCRUDSequence"/>
62 </u:inSequence>
63 </u:target>
64 </u:proxy>
65
66 <!--Standard Spring transactional DataSource definition-->
67 <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
68 <property name="dataSource" ref="dataSource"/>
69 </bean>
70
71 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
72 <property name="driverClassName" value="org.apache.derby.jdbc.ClientDriver"/>
73 <property name="url" value="jdbc:derby://localhost:1527/localderby;create=true;user=admin;password=admin"/>
74 </bean>
75
76</beans>