@Override public void activate(ComponentContext context) { log.debug("Activate"); this.context = context.getRuntimeContext(); }
protected void registerVersioningService(VersioningServiceDescriptor contrib) { String klass = contrib.className; try { VersioningService vs = (VersioningService) context.getRuntimeContext().loadClass(klass).newInstance(); versioningServices.put(contrib, vs); } catch (ReflectiveOperationException e) { throw new RuntimeException("Failed to instantiate: " + klass, e); } log.info("Registered versioning service: " + klass); recompute(); }
protected void registerOrphanVersionRemovalFilter(CoreServiceOrphanVersionRemovalFilterDescriptor contrib) { String klass = contrib.getKlass(); try { OrphanVersionRemovalFilter filter = (OrphanVersionRemovalFilter) context.getRuntimeContext().loadClass( klass).newInstance(); orphanVersionRemovalFilters.put(contrib, filter); } catch (ReflectiveOperationException e) { throw new RuntimeException("Failed to instantiate " + ORPHAN_VERSION_REMOVAL_FILTER_XP + ": " + klass, e); } }
protected void registerVersionRemovalPolicy(CoreServicePolicyDescriptor contrib) { String klass = contrib.getKlass(); try { VersionRemovalPolicy policy = (VersionRemovalPolicy) context.getRuntimeContext().loadClass(klass).newInstance(); versionRemovalPolicies.put(contrib, policy); } catch (ReflectiveOperationException e) { throw new RuntimeException("Failed to instantiate " + VERSION_REMOVAL_POLICY_XP + ": " + klass, e); } }
@Override public void activate(ComponentContext context) { super.activate(context); bundle = context.getRuntimeContext().getBundle(); }
URL url = context.getRuntimeContext().getResource(descriptor.file); try (InputStream stream = url == null ? null : url.openStream()) { if (stream == null) {