<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://zkybase.org/schema/kite"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:util="http://www.springframework.org/schema/util"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
		http://www.springframework.org/schema/aop
		http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
		http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
		http://www.springframework.org/schema/context
		http://www.springframework.org/schema/context/spring-context-3.1.xsd
		http://www.springframework.org/schema/util
		http://www.springframework.org/schema/util/spring-util-3.1.xsd
		http://zkybase.org/schema/kite
		http://zkybase.org/schema/kite/kite-0.5.xsd">
	
	<context:mbean-export />
	
	<circuit-breaker id="messageServiceBreaker" exceptionThreshold="4" timeout="30000" />
	
	<util:list id="guardList">
		<beans:ref bean="messageServiceBreaker" />
	</util:list>
	
	<guard-list-advice id="messageServiceGuardListAdvice" guards="guardList" />
	
	<!-- Use AOP to guard message service calls -->
	<aop:config>
		<aop:pointcut id="messageServicePointcut"
			expression="execution(* com.springinpractice.ch14.kite.sample.service.impl.MessageServiceImpl.*(..))" />
		<aop:advisor advice-ref="messageServiceGuardListAdvice" pointcut-ref="messageServicePointcut" />
	</aop:config>
</beans:beans>
