- final SchemaContextFactory schemaContextFactory
- = schemaRepository.createSchemaContextFactory(SchemaSourceFilter.ALWAYS_ACCEPT);
+ return schemaRepository.createSchemaContextFactory(SchemaSourceFilter.ALWAYS_ACCEPT);
+ }
+
+ private void resolveSchemaContext(final SchemaContextFactory schemaContextFactory,
+ final SlaveSalFacade localSlaveSalManager, final ActorRef masterReference, final int tries) {
+ final ListenableFuture<SchemaContext> schemaContextFuture =
+ schemaContextFactory.createSchemaContext(sourceIdentifiers);
+ Futures.addCallback(schemaContextFuture, new FutureCallback<SchemaContext>() {
+ @Override
+ public void onSuccess(@Nonnull final SchemaContext result) {
+ executeInSelf(() -> {
+ // Make sure the slaveSalManager instance hasn't changed since we initiated the schema context
+ // resolution.
+ if (slaveSalManager == localSlaveSalManager) {
+ LOG.info("{}: Schema context resolved: {} - registering slave mount point",
+ id, result.getModules());
+ slaveSalManager.registerSlaveMountPoint(result, getDOMRpcService(masterReference),
+ masterReference);
+ }
+ });
+ }