in src/main/java/org/apache/sling/installer/factory/packages/impl/PackageTransformer.java [255:283]
public void execute(final InstallationContext ctx) {
final TaskResource resource = this.getResource();
// now check the dependencies
Session session = null;
JcrPackage pkg = null;
try {
// create a service session (needs to have appropriate access rights)
session = repository.loginService(/* subservice name */null, null);
if (!configuration.observationManagerUserData().isEmpty()) {
session.getWorkspace().getObservationManager().setUserData(configuration.observationManagerUserData());
}
final JcrPackageManager pkgMgr = pkgSvc.getPackageManager(session);
doExecute(ctx, pkgMgr, resource);
} catch (final Exception e) {
String message = MessageFormat.format("Error while processing {0} content package task of {1} due to {2}, no retry.", name, resource,
e.getLocalizedMessage());
logger.error(message, e);
this.setFinishedState(ResourceState.IGNORED, null, message);
} finally {
if (pkg != null) {
pkg.close();
}
if (session != null) {
session.logout();
}
}
}