Instantiate Bean/Service with Spring IoC
With Java-APNS, they create a service like this:
ApnsService service = APNS.newService() .withCert("C:/temp/myCertificate.p12", "p@ssw0rd") .withSandboxDestination() .build();
ApnsS开发者_运维百科ervice is a Java Interface.
I'd like to instantiate this service with Spring and inject it in another service, any idea?
Best thanks to you!
You may be able to do it in Spring by designating a factory method in the application context for that bean, but it could be tricky. The Bloch builder idiom is not what Spring had in mind.
精彩评论