Search in sources :

Example 1 with ConfigurableMetadataProvider

use of org.springframework.roo.addon.configurable.addon.ConfigurableMetadataProvider in project spring-roo by spring-projects.

the class IdentifierMetadataProviderImpl method activate.

/**
 * This service is being activated so setup it:
 * <ul>
 * <li>Create and open the {@link MetadataDependencyRegistryTracker}.</li>
 * <li>Create and open one {@link ItdTriggerBasedMetadataProviderTracker}
 * for each {@link ConfigurableMetadataProvider} and {@link SerializableMetadataProvider}.</li>
 * <li>Registers {@link RooJavaType#ROO_IDENTIFIER} 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_IDENTIFIER);
    this.configurableMetadataProviderTracker = new ItdTriggerBasedMetadataProviderTracker(context, ConfigurableMetadataProvider.class, ROO_IDENTIFIER);
    this.configurableMetadataProviderTracker.open();
    this.serializableMetadataProviderTracker = new ItdTriggerBasedMetadataProviderTracker(context, SerializableMetadataProvider.class, ROO_IDENTIFIER);
    this.serializableMetadataProviderTracker.open();
}
Also used : SerializableMetadataProvider(org.springframework.roo.addon.javabean.addon.SerializableMetadataProvider) MetadataDependencyRegistryTracker(org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker) ItdTriggerBasedMetadataProviderTracker(org.springframework.roo.classpath.itd.ItdTriggerBasedMetadataProviderTracker) ConfigurableMetadataProvider(org.springframework.roo.addon.configurable.addon.ConfigurableMetadataProvider)

Example 2 with ConfigurableMetadataProvider

use of org.springframework.roo.addon.configurable.addon.ConfigurableMetadataProvider in project spring-roo by spring-projects.

the class JpaDataOnDemandMetadataProviderImpl 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 ItdTriggerBasedMetadataProviderTracker}
 * to track for {@link ConfigurableMetadataProvider} service.</li>
 * <li>Registers {@link RooJavaType#ROO_JPA_DATA_ON_DEMAND} as additional
 * JavaType that will trigger metadata registration.</li>
 * </ul>
 */
@Override
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();
    // DOD classes are @Configurable because they may need DI of other DOD
    // classes that provide M:1 relationships
    this.configurableMetadataProviderTracker = new ItdTriggerBasedMetadataProviderTracker(localContext, ConfigurableMetadataProvider.class, ROO_JPA_DATA_ON_DEMAND);
    this.configurableMetadataProviderTracker.open();
    addMetadataTrigger(ROO_JPA_DATA_ON_DEMAND);
    serviceInstaceManager.activate(cContext.getBundleContext());
}
Also used : MetadataDependencyRegistryTracker(org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker) ItdTriggerBasedMetadataProviderTracker(org.springframework.roo.classpath.itd.ItdTriggerBasedMetadataProviderTracker) ConfigurableMetadataProvider(org.springframework.roo.addon.configurable.addon.ConfigurableMetadataProvider) BundleContext(org.osgi.framework.BundleContext)

Aggregations

ConfigurableMetadataProvider (org.springframework.roo.addon.configurable.addon.ConfigurableMetadataProvider)2 ItdTriggerBasedMetadataProviderTracker (org.springframework.roo.classpath.itd.ItdTriggerBasedMetadataProviderTracker)2 MetadataDependencyRegistryTracker (org.springframework.roo.metadata.internal.MetadataDependencyRegistryTracker)2 BundleContext (org.osgi.framework.BundleContext)1 SerializableMetadataProvider (org.springframework.roo.addon.javabean.addon.SerializableMetadataProvider)1