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

Spring Framework example source code file (jeeNamespaceHandlerTests.xml)

This example Spring Framework source code file (jeeNamespaceHandlerTests.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

ejb, ejb, jndi, jndi, local, lookup, lookup, remote, tests, tests, utf-8

The Spring Framework jeeNamespaceHandlerTests.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:util="http://www.springframework.org/schema/util"
		xmlns:jee="http://www.springframework.org/schema/jee"
		xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
				http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
				http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd"
		default-lazy-init="true">

	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="properties">
			<props>
				<prop key="myDs">jdbc/MyDataSource
			</props>
		</property>
	</bean>

	<!-- JNDI Lookup Tests -->
	<jee:jndi-lookup id="simple" jndi-name="jdbc/MyDataSource"/>

	<jee:jndi-lookup id="complex"
			jndi-name="${myDs}"
			cache="true"
			resource-ref="true"
			lookup-on-startup="true"
			expected-type="com.myapp.DefaultFoo"
			proxy-interface="com.myapp.Foo"
			default-value="myValue"/>

	<jee:jndi-lookup id="withEnvironment" jndi-name="jdbc/MyDataSource" default-ref="myBean">
		<jee:environment>foo=bar
	</jee:jndi-lookup>

	<jee:jndi-lookup id="withReferencedEnvironment" jndi-name="jdbc/MyDataSource" environment-ref="myEnvironment"/>

	<util:properties id="myEnvironment">
		<prop key="foo">bar
	</util:properties>

	<!-- Local EJB Tests -->
	<jee:local-slsb id="simpleLocalEjb" jndi-name="ejb/MyLocalBean"
			business-interface="org.springframework.beans.ITestBean"/>

	<jee:local-slsb id="complexLocalEjb"
			jndi-name="ejb/MyLocalBean"
			business-interface="org.springframework.beans.ITestBean"
			cache-home="true"
			lookup-home-on-startup="true"
			resource-ref="true">
		<jee:environment>foo=bar
	</jee:local-slsb>

	<!-- Remote EJB Tests -->
	<jee:remote-slsb id="simpleRemoteEjb" jndi-name="ejb/MyRemoteBean"
			business-interface="org.springframework.beans.ITestBean"/>

	<jee:remote-slsb id="complexRemoteEjb"
			jndi-name="ejb/MyRemoteBean"
			business-interface="org.springframework.beans.ITestBean"
			cache-home="true"
			lookup-home-on-startup="true"
			resource-ref="true"
			home-interface="org.springframework.beans.ITestBean"
			refresh-home-on-connect-failure="true"
      cache-session-bean="true">
		<jee:environment>foo=bar
	</jee:remote-slsb>

</beans>

Other Spring Framework examples (source code examples)

Here is a short list of links related to this Spring Framework jeeNamespaceHandlerTests.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.