Spring Configuration Files

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: A sample application context file; attributes of the POJO's DAO definition; transaction configuration; supported operations and code sample for POJO primary key setting.

Application Context XML

Includes the GigaSpacesFactoryBean:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
	<!-- Declaration of GigaSpace factory bean -->
	<bean id="gigaspace"
		class=" org.springmodules.javaspaces.gigaspaces.GigaSpacesFactoryBean">
		<property name="urls">
			<list>
				<value>jini://*/*/myCache</value>
			</list>
		</property>
	</bean>
</beans>
You can define space class meta data using class and field level decorations. These can be defined via Annotations and XML space class mapping configuration files. For more details, refer to the POJO Class and Field Level Annotations section.

transaction.xml

This XML file includes the gigaspacesTransactionAttributeSource and the TransactionInterceptor settings:

<?xml version="1.0" encoding="UTF-8" ?> 
  <!DOCTYPE beans (View Source for full doctype...)> 
  <beans default-lazy-init="false" default-dependency-check="none" default-autowire="no">
  <!--  Declaration of GigaSpaces factory bean 
  --> 
  <bean id="gigaspaces" class="org.springmodules.javaspaces.gigaspaces.GigaSpacesFactoryBean"
 abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
  <property name="urls">
  <list>
  <value>rmi://localhost:10098/./transactionSpace</value> 
  </list>
  </property>
  </bean>
  <!--  Declaration of GigaSpaces template
  --> 
  <bean id="gigaspacesTemplate" class="org.springmodules.javaspaces.gigaspaces.GigaSpacesTemplate"
   abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
  <property name="space" ref="gigaspaces" /> 
  </bean>
  <!--  declaration of GigaSpaces local transaction manager 
  --> 
  <bean id="gigaspacesTransactionManager" class=
  "org.springmodules.javaspaces.gigaspaces.transaction.GigaSpacesLocalTransactionManagerFactoryBean" 
  abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
  <property name="javaSpace" ref="gigaspaces" /> 
  </bean>
  <!--  declaration of Jini transaction manager 
  --> 
  <bean id="transactionManager" class="org.springmodules.transaction.jini.JiniTransactionManager" 
  abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
  <property name="transactionManager" ref="gigaspacesTransactionManager" /> 
  <property name="transactionalContext" ref="gigaspaces" /> 
  </bean>
  <!--  declaration of DAO implementation  
  --> 
  <bean id="txDaoTarget" class="com.gigaspaces.spring.examples.transaction.TransactedDao" 
  abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
  <property name="space" ref="gigaspaces" /> 
  </bean>
  <!--  declaration of transaction wrapper for the DAO target  
  --> 
  <bean id="txDao" class=
  "org.springframework.transaction.interceptor.TransactionProxyFactoryBean" 
  abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
  <property name="transactionManager" ref="transactionManager" /> 
  <property name="target" ref="txDaoTarget" /> 
  <property name="transactionAttributes">
  <props>
  <prop key="writeMandatory*">PROPAGATION_MANDATORY</prop> 
  <prop key="writeNever*">PROPAGATION_NEVER</prop> 
  <prop key="writeRequired*">PROPAGATION_REQUIRED</prop> 
  <prop key="writeRequiredNew*">PROPAGATION_REQUIRES_NEW</prop> 
  <prop key="writeSupports*">PROPAGATION_SUPPORTS</prop> 
  <prop key="writeNotSupported*">PROPAGATION_NOT_SUPPORTED, +java.
  lang.RuntimeException</prop> 
  <prop key="writeRequiredNotSupportedWithPartialRollback">PROPAGATION_REQUIRES_NEW, 
  +java.lang.RuntimeException</prop> 
  <prop key="writeRequiredNotSupportedWithPartialCommit">PROPAGATION_REQUIRES_NEW, 
  +java.lang.RuntimeException</prop> 
  </props>
  </property>
  </bean>
  </beans>

Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels

 
  1. Aug 04, 2006

    Anonymous says:

    It is not clear where the DAO XML file is to be placed and whether its naming ma...

    It is not clear where the DAO XML file is to be placed and whether its naming matter beyon ending .gs.xml

Add Comment