updating documentation (Spring related example was wrong)

This commit is contained in:
Sandor Vasi
2016-03-03 09:59:05 +01:00
parent 92d018bba1
commit 39c6acff2b

View File

@@ -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 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.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
@Configuration @Configuration
public class SoXConfiguration { public class SoxConfiguration {
@Bean(id="sox" scope="prototype") @Bean(name = "sox")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public Sox sox() { public Sox sox() {
Sox sox = new Sox("/usr/bin/sox"); return new Sox("<sox-binary-full-path>");
return sox;
} }
}
``` ```
With the above described Spring configuration class you can inject the sox wrapper anywhere in you Spring project like this: With the above described Spring configuration class you can inject the sox wrapper anywhere in you Spring project like this: