}
log.info("No application scope found for {} on host {}. Misspelled or missing application folder?", path, host);
disconnectOnReturn = true;
} else {
final IContext context = global.getContext();
IScope scope = null;
try {
scope = context.resolveScope(global, path);
} catch (ScopeNotFoundException err) {
call.setStatus(Call.STATUS_SERVICE_NOT_FOUND);
if (call instanceof IPendingServiceCall) {
StatusObject status = getStatus(NC_CONNECT_REJECTED);
status.setDescription("No scope \"" + path
+ "\" on this server.");
((IPendingServiceCall) call)
.setResult(status);
}
log.info("Scope {} not found on {}", path, host);
disconnectOnReturn = true;
} catch (ScopeShuttingDownException err) {
call.setStatus(Call.STATUS_APP_SHUTTING_DOWN);
if (call instanceof IPendingServiceCall) {
StatusObject status = getStatus(NC_CONNECT_APPSHUTDOWN);
status.setDescription("Application at \""
+ path
+ "\" is currently shutting down.");
((IPendingServiceCall) call)
.setResult(status);
}
log.info("Application at {} currently shutting down on {}", path, host);
disconnectOnReturn = true;
}
if (scope != null) {
log.info("Connecting to: {}", scope);
// Setup application's classloader to be used for deserializing
ClassLoader loader = scope.getClassLoader();
if (loader == null) {
// Fallback, should never happen
loader = getClass().getClassLoader();
}
Thread.currentThread().setContextClassLoader(loader);