alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Spring Framework example source code file (jruby-with-xsd.xml)

This example Spring Framework source code file (jruby-with-xsd.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Spring Framework tags/keywords

cdata, hello, hello, rubycalculatingmessenger, rubycalculator, rubycalculator, utf-8, utf-8, world, world

The Spring Framework jruby-with-xsd.xml source code

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xmlns:lang="http://www.springframework.org/schema/lang"
		xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
				http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd">

	<lang:jruby id="messenger"
			script-source="classpath:org/springframework/scripting/jruby/Messenger.rb"
			script-interfaces="org.springframework.scripting.Messenger">
		<lang:property name="message" value="Hello World!"/>
	</lang:jruby>

	<lang:jruby id="messengerPrototype"
			script-source="classpath:org/springframework/scripting/jruby/Messenger.rb"
			script-interfaces="org.springframework.scripting.ConfigurableMessenger" scope="prototype">
		<lang:property name="message" value="Hello World!"/>
	</lang:jruby>

	<lang:jruby id="messengerByType"
			script-source="classpath:org/springframework/scripting/jruby/Messenger.rb"
			script-interfaces="org.springframework.scripting.TestBeanAwareMessenger" scope="prototype"
			autowire="byType" dependency-check="objects">
	</lang:jruby>

	<lang:jruby id="messengerByName"
			script-source="classpath:org/springframework/scripting/jruby/Messenger.rb"
			script-interfaces="org.springframework.scripting.TestBeanAwareMessenger" scope="prototype"
			autowire="byName">
	</lang:jruby>

	<bean id="testBean" class="org.springframework.beans.TestBean"/>

	<lang:jruby id="calculator"
			script-interfaces="org.springframework.scripting.Calculator">
		<lang:inline-script>
require 'java'

class RubyCalculator
	include org.springframework.scripting.Calculator

	def add(x, y)
		x + y
	end
end
		</lang:inline-script>
	</lang:jruby>

	<lang:jruby id="refreshableMessenger"
			script-source="classpath:org/springframework/scripting/jruby/Messenger.rb"
			script-interfaces="org.springframework.scripting.Messenger"
			refresh-check-delay="5000">
		<lang:property name="message" value="Hello World!"/>
	</lang:jruby>

	<!-- just checking that multiple script interfaces are supported -->
	<lang:jruby id="calculatingMessenger"
			script-interfaces="org.springframework.scripting.Calculator, org.springframework.scripting.Messenger">
		<lang:inline-script>
		<lang:property name="message" value="Hello World!"/>
	</lang:jruby>

</beans>

Other Spring Framework examples (source code examples)

Here is a short list of links related to this Spring Framework jruby-with-xsd.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.