use of org.opendaylight.yangtools.yang.model.repo.spi.SchemaListenerRegistration in project yangtools by opendaylight.
the class SimpleModuleTest method init.
@Before
public void init() {
schemaRegistry = new SharedSchemaRepository("test");
final TextToIRTransformer astTransformer = TextToIRTransformer.create(schemaRegistry, schemaRegistry);
schemaRegistry.registerSchemaSourceListener(astTransformer);
schemaContextFactory = schemaRegistry.createEffectiveModelContextFactory();
allTestSources = new HashSet<>();
final SchemaListenerRegistration reg = schemaRegistry.registerSchemaSourceListener(new SchemaSourceListener() {
@Override
public void schemaSourceUnregistered(final PotentialSchemaSource<?> source) {
// NOOP
}
@Override
public void schemaSourceRegistered(final Iterable<PotentialSchemaSource<?>> sources) {
for (final PotentialSchemaSource<?> source : sources) {
allTestSources.add(source.getSourceIdentifier());
}
}
@Override
public void schemaSourceEncountered(final SchemaSourceRepresentation source) {
// NOOP
}
});
reg.close();
}
Aggregations