/** * Returns the ID of the given metadata's class. * * @param metadataId the metadata ID for which to return the class ID (can * be blank) * @return <code>null</code> if a blank ID is given, otherwise a valid * class-level ID * @since 1.2.0 */ public static String getMetadataClassId(final String metadataId) { return create(getMetadataClass(metadataId)); }
@SuppressWarnings("unchecked") public <T extends MetadataItem> T evictAndGet(final String metadataIdentificationString) { return (T) getInternal(metadataIdentificationString, true, false); }
@SuppressWarnings("unchecked") public <T extends MetadataItem> T get(final String metadataIdentificationString) { return (T) get(metadataIdentificationString, false); }
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 componentContext) { MetadataDependencyRegistry registry = this.registryTracker.getService(); registry.removeNotificationListener(this); this.registryTracker.close(); }
/** * Constructor * * @param declaredByMetadataId */ protected AbstractIdentifiableJavaStructureBuilder(final String declaredByMetadataId) { Validate.isTrue(MetadataIdentificationUtils.isIdentifyingInstance(declaredByMetadataId), "Declared by metadata ID must identify a specific instance (not '%s')", declaredByMetadataId); this.declaredByMetadataId = declaredByMetadataId; }
/** * Indicates whether the argument appears to represent a particular metadata * identification class. This method returns false if a particular instance * is identified. * * @param metadataIdentificationString to evaluate (can be null or empty) * @return true if the string is identifying a class of {@link MetadataItem} */ public static boolean isIdentifyingClass(final String metadataIdentificationString) { return isValid(metadataIdentificationString) && !metadataIdentificationString.contains(INSTANCE_DELIMITER); }
protected void activate(final ComponentContext cContext) { super.activate(cContext); }
/** * Create new ServiceTracker to obtain a MetadataDependencyRegistry and * register the given metadata dependency. * * @param bc Bundle execution context * @param notificationListener Registers an additional instance to receive * MetadataNotificationListener events. It could be null. * @param upstreamDependency the upstream dependency (required; eg metadata * representing a disk file) * @param downstreamDependency the downstream dependency (required; eg * metadata representing a Java type) */ public MetadataDependencyRegistryTracker(BundleContext bc, MetadataNotificationListener notificationListener, String upstreamDependency, String downstreamDependency) { this(bc, notificationListener, new MetadataDependency(upstreamDependency, downstreamDependency)); }
protected 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); this.registryTracker.close(); }
public MetadataItem get(final String metadataIdentificationString, final boolean evictCache) { return getInternal(metadataIdentificationString, evictCache, true); }
protected 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); this.registryTracker.close(); }
protected 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); } }
protected 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); } }
protected 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); } }
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); } }
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); } }
protected 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); } }