use of com.enonic.xp.script.impl.service.ServiceRegistryImpl in project xp by enonic.
the class ScriptExecutorFactory method create.
public ScriptExecutor create(final ApplicationKey applicationKey) {
LOG.debug("Create Script Executor for {}", applicationKey);
final Application application = applicationService.getInstalledApplication(applicationKey);
if (application == null || !application.isStarted() || application.getConfig() == null) {
throw new ApplicationNotFoundException(applicationKey);
}
final ClassLoader classLoader = application.getClassLoader();
final Bundle bundle = application.getBundle();
final BundleContext bundleContext = Objects.requireNonNull(bundle.getBundleContext(), String.format("application bundle %s context must not be null", bundle.getBundleId()));
return new ScriptExecutorImpl(scriptAsyncService.getAsyncExecutor(application.getKey()), scriptSettings, classLoader, new ServiceRegistryImpl(bundleContext), resourceService, application, RunMode.get());
}
Aggregations