Summary: This page describes the processing unit deployment configuration file (
pu.config)
OverviewThe processing unit's configuration is expressed using a number of configuration files, namely pu.config, sla.xml and pu.properties, which are typically located under the META-INF/spring directory within the processing unit jar file. Each file is used to configure separate aspects of the processing unit. The pu.xml file is used to configure the actual elements that the processing unit contains, e.g. space and space proxies, event handles and remote service. Generally speaking, it contains of the application specific components of the processing unit. The pu.xml fileThis file is a Spring framework XML configuration file. It leverages the Spring framework IoC container and extends it by using the Spring custom namespace mechanism.
pu.xml ContentsThe definitions in the pu.xml file are divided into 2 major categories:
This section focuses on the overall structure of the pu.xml file. The various GigaSpaces components that can be included in the pu.xml (such as event containers, remote services and others) are covered in detail in their respective sections in the programmer's guide. Multiple Configuration OptionsIn recent versions (2.0 and 2.5), the Spring framework has introduced two additional ways to configure your Spring application.
Throughout this guide, every configuration example will be provided in all of the supported forms (plain Spring, custom namespace element and annotations). See below for an example pu.xml configuration file. Sample pu.xml ConfigurationHere's a sample pu.xml configuration file. Note the comments in the file which describe the various elements that appear in it.
Sample pu.xml file
<?xml version="1.0" encoding="UTF-8"?> <!-- top level element of the Spring configuration. Note the multiple namespace definition for both GigaSpaces and Spring. You can simply copy and paste this portion of the pu.xml file --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:os-core="http://www.openspaces.org/schema/core" xmlns:os-events="http://www.openspaces.org/schema/events" xmlns:os-remoting="http://www.openspaces.org/schema/remoting" xmlns:os-sla="http://www.openspaces.org/schema/sla" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.openspaces.org/schema/core http://www.openspaces.org/schema/8.0/core/openspaces-core.xsd http://www.openspaces.org/schema/events http://www.openspaces.org/schema/8.0/events/openspaces-events.xsd http://www.openspaces.org/schema/remoting http://www.openspaces.org/schema/8.0/remoting/openspaces-remoting.xsd http://www.openspaces.org/schema/sla http://www.openspaces.org/schema/8.0/sla/openspaces-sla.xsd"> <!-- Enables to configure Spring beans through annotations --> <context:annotation-config /> <!-- Enable @PostPrimary and others annotation support. --> <os-core:annotation-support /> <!-- Enables using @Polling and @Notify annotations to creating polling and notify containers --> <os-events:annotation-support /> <!-- Enables using @RemotingService and other remoting related annotations --> <os-remoting:annotation-support /> <!-- A bean representing a space. Here we configure an embedded space (note the url element which does not contain any remote protocol prefix. Also note that we do not specify here the cluster topology of the space. It is declared by the os-sla:sla element of this pu.xml file. --> <os-core:space id="space" url="/./space" /> <!-- Defines a distributed transaction manager.--> <os-core:distributed-tx-manager id="transactionManager" /> <!-- Define the GigaSpace instance that the application will use to access the space --> <os-core:giga-space id="gigaSpace" space="space" tx-manager="transactionManager"/> </beans> Importing xml files into the pu.xmlTo import one more more xml files into your pu.xml you can use the following: <import resource="classpath*:/applicationContext-component.xml" /> <import resource="classpath*:/applicationContext-matching.xml"/> <import resource="classpath*:/applicationContext-services.xml"/> <import resource="classpath*:/applicationContext-jmx.xml" /> <import resource="classpath*:/applicationContext-containers.xml"/> |
![]() |
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence |