/** * This service is being deactivated so unregister upstream-downstream * dependencies, triggers, matchers and listeners. * * @param context */ protected void deactivate(final ComponentContext context) { MetadataDependencyRegistry registry = this.registryTracker.getService(); registry.deregisterDependency(PhysicalTypeIdentifier.getMetadataIdentiferType(), PROVIDES_TYPE); this.registryTracker.close(); removeMetadataTriggers(TRIGGER_ANNOTATIONS); CustomDataKeyDecorator keyDecorator = this.keyDecoratorTracker.getService(); keyDecorator.unregisterMatchers(getClass()); this.keyDecoratorTracker.close(); }
private void registerDependency(final String upstreamDependency, final String downStreamDependency) { if (getMetadataDependencyRegistry() != null && StringUtils.isNotBlank(upstreamDependency) && StringUtils.isNotBlank(downStreamDependency) && !upstreamDependency.equals(downStreamDependency) && !MetadataIdentificationUtils.getMetadataClass(downStreamDependency).equals( MetadataIdentificationUtils.getMetadataClass(upstreamDependency))) { getMetadataDependencyRegistry().registerDependency(upstreamDependency, downStreamDependency); } }
/** * This service is being deactivated so unregister upstream-downstream * dependencies, triggers, matchers and listeners. * * @param context */ protected void deactivate(final ComponentContext context) { MetadataDependencyRegistry registry = this.registryTracker.getService(); registry.removeNotificationListener(this); registry.deregisterDependency(PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType()); this.registryTracker.close(); removeMetadataTrigger(ROO_ENTITY_PROJECTION); }
sb.append("Identifier : ").append(metadataId).append(IOUtils.LINE_SEPARATOR); for (final String upstreamId : metadataDependencyRegistry.getUpstream(metadataId)) { sb.append("Upstream : ").append(upstreamId).append(LINE_SEPARATOR); if (!MetadataIdentificationUtils.isIdentifyingClass(metadataId)) { final String mdClassId = MetadataIdentificationUtils.getMetadataClassId(metadataId); for (final String upstreamId : metadataDependencyRegistry.getUpstream(mdClassId)) { sb.append("Upstream : ").append(upstreamId).append(" (via MD class)") .append(LINE_SEPARATOR); for (final String downstreamId : metadataDependencyRegistry.getDownstream(metadataId)) { sb.append("Downstream : ").append(downstreamId).append(LINE_SEPARATOR); if (!MetadataIdentificationUtils.isIdentifyingClass(metadataId)) { final String mdClassId = MetadataIdentificationUtils.getMetadataClassId(metadataId); for (final String downstreamId : metadataDependencyRegistry.getDownstream(mdClassId)) { sb.append("Downstream : ").append(downstreamId).append(" (via MD class)") .append(LINE_SEPARATOR);
/** * Register the metadata {@link #dependencies} in the given * {@link MetadataDependencyRegistry} service. * <p/> * Moreover if {@link #listener} is not null registers an additional * instance to send {@link MetadataNotificationListener} events to that * {@link #listener}. * * @param ref MetadataDependencyRegistry service reference */ @Override public MetadataDependencyRegistry addingService(ServiceReference<MetadataDependencyRegistry> ref) { MetadataDependencyRegistry registry = super.addingService(ref); if (this.listener != null) { registry.addNotificationListener(this.listener); } if (this.dependencies != null) { for (MetadataDependency dependency : this.dependencies) { registry.registerDependency(dependency.getUpstreamDependency(), dependency.getDownstreamDependency()); } } return registry; }
/** * This service is being deactivated so unregister upstream-downstream * dependencies, triggers, matchers and listeners. * * @param context */ protected void deactivate(final ComponentContext componentContext) { MetadataDependencyRegistry registry = this.registryTracker.getService(); registry.removeNotificationListener(this); this.registryTracker.close(); }
public final void notify(String upstreamDependency, String downstreamDependency) { if (MetadataIdentificationUtils .isIdentifyingClass(downstreamDependency)) { Validate.isTrue( MetadataIdentificationUtils.getMetadataClass( upstreamDependency).equals( MetadataIdentificationUtils .getMetadataClass(PhysicalTypeIdentifier .getMetadataIdentiferType())), "Expected class-level notifications only for physical Java types (not '" + upstreamDependency + "')"); .getJavaType(upstreamDependency); LogicalPath path = PhysicalTypeIdentifier .getPath(upstreamDependency); downstreamDependency = createLocalIdentifier(javaType, path); if (getMetadataDependencyRegistry().getDownstream( upstreamDependency).contains(downstreamDependency)) { return; getMetadataDependencyRegistry().notifyDownstream( downstreamDependency);
Validate.isTrue(PhysicalTypeIdentifier.isValid(metadataIdentificationString), "Metadata id '%s' is not valid for this metadata provider", metadataIdentificationString); final String canonicalPath = return null; metadataDependencyRegistry.deregisterDependencies(metadataIdentificationString); if (!fileManager.exists(canonicalPath)) { final JavaType javaType = PhysicalTypeIdentifier.getJavaType(metadataIdentificationString); final ClassOrInterfaceTypeDetails typeDetails = typeParsingService.getTypeAtLocation(canonicalPath, metadataIdentificationString, javaType); metadataDependencyRegistry.registerDependency(superclassId, result.getId()); } else { PhysicalTypeIdentifier.createIdentifier(details.getExtendsTypes().get(0), sourcePath); metadataDependencyRegistry.registerDependency(possibleSuperclass, result.getId());
protected void registerDependency(final String upstreamDependency, final String downStreamDependency) { if (getMetadataDependencyRegistry() != null && StringUtils.isNotBlank(upstreamDependency) && StringUtils.isNotBlank(downStreamDependency) && !upstreamDependency.equals(downStreamDependency)) { getMetadataDependencyRegistry().registerDependency(upstreamDependency, downStreamDependency); } }
protected void activate(final ComponentContext cContext) { context = cContext.getBundleContext(); getMetadataDependencyRegistry().addNotificationListener(this); getMetadataDependencyRegistry().registerDependency( PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType()); addMetadataTrigger(ROO_TO_STRING); }
protected void activate(ComponentContext cContext) { context = cContext.getBundleContext(); // Ensure we're notified of all metadata related to physical Java types, // in particular their initial creation getMetadataDependencyRegistry().registerDependency( PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType()); addMetadataTrigger(new JavaType(GvNIXEntityOCCChecksum.class.getName())); }
protected void activate(final ComponentContext cContext) { util = new MetadataLocatorUtils<JavaType>(new Evaluator(typeLocationService)); dependencyRegistry.addNotificationListener(util); }
final LogicalPath path = PhysicalTypeIdentifier.getPath(field.getDeclaredByMetadataId()); final String moduleNme = path.getModule(); if (projectOperations.isProjectAvailable(moduleNme) getPersistenceMemberLocator().getIdentifierAccessor(fieldType); if (identifierAccessor != null) { getMetadataDependencyRegistry().registerDependency( identifierAccessor.getDeclaredByMetadataId(), metadataIdentificationString); return identifierAccessor.getMethodName();
public void notify(final String upstreamDependency, final String downstreamDependency) { Validate.isTrue(MetadataIdentificationUtils.isValid(upstreamDependency), "Upstream dependency is an invalid metadata identification string ('%s')", upstreamDependency); Validate.isTrue(MetadataIdentificationUtils.isValid(downstreamDependency), "Downstream dependency is an invalid metadata identification string ('%s')", downstreamDependency); MetadataDependencyRegistry registry = this.registryTracker.getService(); final String mdClassId = MetadataIdentificationUtils.getMetadataClassId(downstreamDependency); final MetadataProvider p = providerMap.get(mdClassId); registry.notifyDownstream(downstreamDependency);
if (MetadataIdentificationUtils.isIdentifyingClass(downstreamDependency)) { Validate.isTrue(MetadataIdentificationUtils.isIdentifyingInstance(downstreamDependency), "An instance-specific downstream MID was required by '%s' (not '%s')", getClass() .getName(), downstreamDependency); if (getMetadataDependencyRegistry().getDownstream(upstreamDependency).contains( downstreamDependency)) { return; MetadataIdentificationUtils.getMetadataClass(downstreamDependency).equals( MetadataIdentificationUtils.getMetadataClass(getProvidesType())), "Unexpected downstream notification for '%s' to this provider (which uses '%s')",
@Override public void evict(final String metadataIdentificationString) { synchronized (lock) { // Clear my own cache (which also verifies the argument is valid at // the same time) super.evict(metadataIdentificationString); // Finally, evict downstream dependencies (ie metadata that // previously depended on this now-evicted metadata) MetadataDependencyRegistry registry = this.registryTracker.getService(); for (final String downstream : registry.getDownstream(metadataIdentificationString)) { // We only need to evict if it is an instance, as only an // instance will ever go into the cache if (MetadataIdentificationUtils.isIdentifyingInstance(downstream)) { evict(downstream); } } } }
getMetadataDependencyRegistry().registerDependency(jpaMetadataId, metadataIdentificationString); .getDownstream( getGovernorPhysicalTypeIdentifier(metadataIdentificationString)); for (String downstreamId : dependentsOfJpa) { if (!metadataIdentificationString.equals(downstreamId) && !jpaMetadataId.equals(downstreamId)) { getMetadataDependencyRegistry().registerDependency( metadataIdentificationString, downstreamId); getMetadataDependencyRegistry().registerDependency(userServiceId, metadataIdentificationString);
public void notify(String upstreamDependency, String downstreamDependency) { if (MetadataIdentificationUtils .isIdentifyingClass(downstreamDependency)) { Validate.isTrue( MetadataIdentificationUtils.getMetadataClass( upstreamDependency).equals( MetadataIdentificationUtils .getMetadataClass(ReportMetadata .getMetadataIdentiferType())), "Expected class-level notifications only for gvNIX Report metadata (not '" if (getMetadataDependencyRegistry().getDownstream( upstreamDependency).contains(downstreamDependency)) { return; getMetadataDependencyRegistry().notifyDownstream( downstreamDependency);
public void notify(final String upstreamDependency, String downstreamDependency) { if (MetadataIdentificationUtils .isIdentifyingClass(downstreamDependency)) { if (metadataDependencyRegistry.getDownstream(upstreamDependency) .contains(downstreamDependency)) { return; .isIdentifyingInstance(upstreamDependency)) { .isIdentifyingInstance(downstreamDependency)) { metadataService.evictAndGet(downstreamDependency);
.isIdentifyingClass(downstreamDependency)) { if (getMetadataDependencyRegistry().getDownstream( upstreamDependency).contains(downstreamDependency)) { return;