Using @Value with pu.properties file
Hi! I'm developing an application with XAP 11, and currently I'm trying to inject values into my processing unit, using the @Value("${my.property}") annotation. It works for injecting values into my pu.xml file, but it doesn't work for the processing unit. What am I doing wrong?
My pu.xml:
<?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: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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.openspaces.org/schema/core
http://www.openspaces.org/schema/9.7/core/openspaces-core.xsd
http://www.openspaces.org/schema/events
http://www.openspaces.org/schema/events/openspaces-events.xsd">
<bean id="propertiesConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<context:annotation-config/>
<context:component-scan base-package="com.project"/>
<os-core:giga-space-context/>
<os-core:annotation-support/>
<os-events:annotation-support/>
<os-core:space-proxy id="space" space-name="${my.space}"/>
<os-core:giga-space id="gigaSpace" space="space"/>
</beans>
Inside my class:
@Polling
@EventDriven
public class Unit {
@Value("${my.property}")
private String property;
My pu.properties:
my.space = some-space
my.property = something