service-factory

how to override a service provider in java

半世苍凉 提交于 2019-12-18 05:50:35
问题 This is more a general question by example: I'm using xstream and woodstox, woodstox comes with a service provider for javax.xml.stream.XMLOutputFactory in woodstox jar registering com.ctc.wstx.stax.WstxOutputFactory. I want to provide my own javax.xml.stream.XMLOutputFactory and still have woodstox jar in the classpath. I know I can provide my own with the system property javax.xml.stream.XMLOutputFactory , but I'm trying to take off the hassle from our dev ops team and do it with a service

how to override a service provider in java

白昼怎懂夜的黑 提交于 2019-11-29 09:44:08
This is more a general question by example: I'm using xstream and woodstox, woodstox comes with a service provider for javax.xml.stream.XMLOutputFactory in woodstox jar registering com.ctc.wstx.stax.WstxOutputFactory. I want to provide my own javax.xml.stream.XMLOutputFactory and still have woodstox jar in the classpath. I know I can provide my own with the system property javax.xml.stream.XMLOutputFactory , but I'm trying to take off the hassle from our dev ops team and do it with a service file in my jar or maybe in my war's META-INF/services folder. looking the code of javax.xml.stream

osgi: Using ServiceFactories?

烈酒焚心 提交于 2019-11-28 09:24:23
I'm currently trying to get a simple bundle containing a Service Factory running. This is my factory class: public class SvcFactory implements ServiceFactory<ServiceB> { @Override public ServiceB getService(Bundle bundle, ServiceRegistration<ServiceB> registration) { return new ServiceBImpl(); } @Override public void ungetService(Bundle bundle, ServiceRegistration<ServiceB> registration, ServiceB service) { } } This is my service that should be created by the factory: public class ServiceBImpl implements ServiceB { private ServiceA svcA; public void setA(ServiceA a) { svcA = a; } } And finally

osgi: Using ServiceFactories?

一曲冷凌霜 提交于 2019-11-27 02:53:11
问题 I'm currently trying to get a simple bundle containing a Service Factory running. This is my factory class: public class SvcFactory implements ServiceFactory<ServiceB> { @Override public ServiceB getService(Bundle bundle, ServiceRegistration<ServiceB> registration) { return new ServiceBImpl(); } @Override public void ungetService(Bundle bundle, ServiceRegistration<ServiceB> registration, ServiceB service) { } } This is my service that should be created by the factory: public class