private final ClassLoadingStrategy classLoadingStrategy;
- // FIXME: will become final
- private ClassPool pool;
- private AbstractTransformerGenerator binding;
- private LazyGeneratedCodecRegistry registry;
+ private final AbstractTransformerGenerator binding;
+ private final LazyGeneratedCodecRegistry registry;
+ private final ClassPool pool;
/*
* FIXME: updated here, access from AbstractTransformer
private final ConcurrentMap<Type, Type> typeDefinitions = new ConcurrentHashMap<>();
private SchemaContext schemaContext;
- @Deprecated
- public RuntimeGeneratedMappingServiceImpl() {
- this(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy());
- }
-
- @Deprecated
- public RuntimeGeneratedMappingServiceImpl(final ClassLoadingStrategy strat) {
- classLoadingStrategy = strat;
- }
-
public RuntimeGeneratedMappingServiceImpl(final ClassPool pool) {
this(pool, GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy());
}
this.pool = Preconditions.checkNotNull(pool);
this.classLoadingStrategy = Preconditions.checkNotNull(strat);
- // FIXME: merge into constructor once legacy init() is removed
- doInit();
- }
-
- private void doInit() {
binding = new TransformerGenerator(this, pool);
registry = new LazyGeneratedCodecRegistry(this, binding, classLoadingStrategy);
binding.setListener(registry);
// }
}
- @Deprecated
- public void setPool(final ClassPool pool) {
- this.pool = pool;
- }
-
@Override
public synchronized SchemaContext getSchemaContext() {
return schemaContext;
}
}
- @Deprecated
- public void init() {
- doInit();
- }
@Override
public Set<QName> getRpcQNamesFor(final Class<? extends RpcService> service) {
@Before
public void setupRestconfClientContext() throws MalformedURLException, UnsupportedProtocolException {
- mappingService = new RuntimeGeneratedMappingServiceImpl();
- mappingService.setPool(new ClassPool());
- mappingService.init();
+ mappingService = new RuntimeGeneratedMappingServiceImpl(new ClassPool());
final ModuleInfoBackedContext moduleInfo = ModuleInfoBackedContext.create();
moduleInfo.addModuleInfos(BindingReflections.loadModuleInfos());
@Before
public void setup() {
- this.mappingService = new RuntimeGeneratedMappingServiceImpl();
- this.mappingService.setPool(new ClassPool());
- this.mappingService.init();
+ this.mappingService = new RuntimeGeneratedMappingServiceImpl(new ClassPool());
final ModuleInfoBackedContext moduleInfo = ModuleInfoBackedContext.create();
moduleInfo.addModuleInfos(BindingReflections.loadModuleInfos());