From 39c6acff2bd71fd52f661654b4cb8cc8e39dbd85 Mon Sep 17 00:00:00 2001 From: Sandor Vasi Date: Thu, 3 Mar 2016 09:59:05 +0100 Subject: [PATCH] updating documentation (Spring related example was wrong) --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 66ab08a..32b4ba5 100644 --- a/README.md +++ b/README.md @@ -60,17 +60,23 @@ Sox sox = new Sox("/usr/bin/sox"); This is a recommendation, how to integrate the sox java wrapper with the Spring Framework ``` +import ie.corballis.sox.Sox; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; @Configuration -public class SoXConfiguration { +public class SoxConfiguration { - @Bean(id="sox" scope="prototype") + @Bean(name = "sox") + @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) public Sox sox() { - Sox sox = new Sox("/usr/bin/sox"); - return sox; + return new Sox(""); } +} + ``` With the above described Spring configuration class you can inject the sox wrapper anywhere in you Spring project like this: