Search in sources :

Example 21 with MetadataDependencyRegistryTracker

use of org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker in project spring-roo by spring-projects.

the class WebMvcConfigurationMetadataProviderImpl method activate.

/**
 * This service is being activated so setup it:
 * <ul>
 * <li>Create and open the {@link MetadataDependencyRegistryTracker}.</li>
 * <li>Create and open the {@link CustomDataKeyDecoratorTracker}.</li>
 * <li>Registers {@link RooJavaType#ROO_WEB_MVC_CONFIGURATION} as additional
 * JavaType that will trigger metadata registration.</li>
 * <li>Set ensure the governor type details represent a class.</li>
 * </ul>
 */
@Override
protected void activate(final ComponentContext cContext) {
    context = cContext.getBundleContext();
    this.registryTracker = new MetadataDependencyRegistryTracker(context, this, PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType());
    this.registryTracker.open();
    addMetadataTrigger(RooJavaType.ROO_WEB_MVC_CONFIGURATION);
}
Also used : MetadataDependencyRegistryTracker(org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker)

Example 22 with MetadataDependencyRegistryTracker

use of org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker in project spring-roo by spring-projects.

the class RepositoryJpaCustomImplMetadataProviderImpl method activate.

/**
 * This service is being activated so setup it:
 * <ul>
 * <li>Create and open the {@link MetadataDependencyRegistryTracker}.</li>
 * <li>Create and open the {@link CustomDataKeyDecoratorTracker}.</li>
 * <li>Registers {@link RooJavaType#ROO_REPOSITORY_JPA_CUSTOM_IMPL} as additional
 * JavaType that will trigger metadata registration.</li>
 * <li>Set ensure the governor type details represent a class.</li>
 * </ul>
 */
@Override
@SuppressWarnings("unchecked")
protected void activate(final ComponentContext cContext) {
    super.activate(cContext);
    BundleContext localContext = cContext.getBundleContext();
    this.registryTracker = new MetadataDependencyRegistryTracker(localContext, this, PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType());
    this.registryTracker.open();
    addMetadataTrigger(ROO_REPOSITORY_JPA_CUSTOM_IMPL);
    this.keyDecoratorTracker = new CustomDataKeyDecoratorTracker(localContext, getClass(), new LayerTypeMatcher(ROO_REPOSITORY_JPA_CUSTOM_IMPL, new JavaSymbolName(RooJpaRepositoryCustomImpl.REPOSITORY_ATTRIBUTE)));
    this.keyDecoratorTracker.open();
}
Also used : JavaSymbolName(org.springframework.roo.model.JavaSymbolName) LayerTypeMatcher(org.springframework.roo.classpath.layers.LayerTypeMatcher) MetadataDependencyRegistryTracker(org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker) CustomDataKeyDecoratorTracker(org.springframework.roo.classpath.customdata.taggers.CustomDataKeyDecoratorTracker) BundleContext(org.osgi.framework.BundleContext)

Example 23 with MetadataDependencyRegistryTracker

use of org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker in project spring-roo by spring-projects.

the class RepositoryJpaMetadataProviderImpl method activate.

/**
 * This service is being activated so setup it:
 * <ul>
 * <li>Create and open the {@link MetadataDependencyRegistryTracker}.</li>
 * <li>Create and open the {@link CustomDataKeyDecoratorTracker}.</li>
 * <li>Registers {@link RooJavaType#ROO_REPOSITORY_JPA} as additional
 * JavaType that will trigger metadata registration.</li>
 * <li>Set ensure the governor type details represent a class.</li>
 * </ul>
 */
@Override
@SuppressWarnings("unchecked")
protected void activate(final ComponentContext cContext) {
    super.activate(cContext);
    super.setDependsOnGovernorBeingAClass(false);
    this.registryTracker = new MetadataDependencyRegistryTracker(cContext.getBundleContext(), this, PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType());
    this.registryTracker.open();
    addMetadataTrigger(ROO_REPOSITORY_JPA);
    this.keyDecoratorTracker = new CustomDataKeyDecoratorTracker(cContext.getBundleContext(), getClass(), new LayerTypeMatcher(ROO_REPOSITORY_JPA, new JavaSymbolName(RooJpaRepository.ENTITY_ATTRIBUTE)));
    this.keyDecoratorTracker.open();
}
Also used : JavaSymbolName(org.springframework.roo.model.JavaSymbolName) LayerTypeMatcher(org.springframework.roo.classpath.layers.LayerTypeMatcher) MetadataDependencyRegistryTracker(org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker) CustomDataKeyDecoratorTracker(org.springframework.roo.classpath.customdata.taggers.CustomDataKeyDecoratorTracker)

Example 24 with MetadataDependencyRegistryTracker

use of org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker in project spring-roo by spring-projects.

the class PluralMetadataProviderImpl method activate.

/**
 * This service is being activated so setup it:
 * <ul>
 * <li>Create and open the {@link MetadataDependencyRegistryTracker}.</li>
 * <li>Set ensure the governor type details represent a class.</li>
 * <li>Set ignore trigger annotations. It means that other MD providers
 * that want to discover whether a type has finders can do so.</li>
 * </ul>
 */
@Override
protected void activate(final ComponentContext cContext) {
    context = cContext.getBundleContext();
    this.registryTracker = new MetadataDependencyRegistryTracker(context, null, PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType());
    this.registryTracker.open();
    setIgnoreTriggerAnnotations(true);
}
Also used : MetadataDependencyRegistryTracker(org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker)

Example 25 with MetadataDependencyRegistryTracker

use of org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker in project spring-roo by spring-projects.

the class ConfigurableMetadataProviderImpl method activate.

/**
 * This service is being activated so setup it:
 * <ul>
 * <li>Create and open the {@link MetadataDependencyRegistryTracker}</li>
 * <li>Registers {@link RooJavaType#ROO_CONFIGURABLE} as additional
 * JavaType that will trigger metadata registration.</li>
 * </ul>
 */
@Override
protected void activate(final ComponentContext cContext) {
    context = cContext.getBundleContext();
    this.registryTracker = new MetadataDependencyRegistryTracker(context, null, PhysicalTypeIdentifier.getMetadataIdentiferType(), getProvidesType());
    this.registryTracker.open();
    addMetadataTrigger(ROO_CONFIGURABLE);
}
Also used : MetadataDependencyRegistryTracker(org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker)

Aggregations

MetadataDependencyRegistryTracker (org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker)47 BundleContext (org.osgi.framework.BundleContext)6 CustomDataKeyDecoratorTracker (org.springframework.roo.classpath.customdata.taggers.CustomDataKeyDecoratorTracker)6 LayerTypeMatcher (org.springframework.roo.classpath.layers.LayerTypeMatcher)5 JavaSymbolName (org.springframework.roo.model.JavaSymbolName)5 ConfigurableMetadataProvider (org.springframework.roo.addon.configurable.addon.ConfigurableMetadataProvider)2 ItdTriggerBasedMetadataProviderTracker (org.springframework.roo.classpath.itd.ItdTriggerBasedMetadataProviderTracker)2 Bundle (org.osgi.framework.Bundle)1 SerializableMetadataProvider (org.springframework.roo.addon.javabean.addon.SerializableMetadataProvider)1 MetadataDependency (org.springframework.roo.metadata.MetadataDependency)1