Class DefaultComponent

java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
All Implemented Interfaces:
Adaptable, Component, Extensible, TimestampedService
Direct Known Subclasses:
AbstractLayoutManager, ActionService, AnnotationServiceImpl, AutomationComponent, AutomationScriptingComponent, AutomationServerComponent, AvroComponent, AWSConfigurationServiceImpl, BatchManagerComponent, BinaryMetadataComponent, BlobHolderAdapterComponent, BlobManagerComponent, BulkComponent, CacheServiceImpl, CapabilitiesServiceImpl, CertServiceImpl, CharacterFilteringServiceImpl, ClusterActionServiceImpl, ClusterServiceImpl, CodecServiceImpl, CollectionManagerImpl, CommandLineExecutorComponent, CommentService, ComputedGroupsServiceImpl, ConfigurationServiceImpl, ConnectClientComponent, ContentTemplateServiceImpl, ContributionPersistenceComponent, ConversionServiceImpl, CoreManagementComponent, CoreService, CoreSessionServiceImpl, CounterManagerImpl, CUserServiceImpl, DataSourceComponent, DBSRepositoryService, DefaultDirectoryFactory, DefaultImporterComponent, DefaultMonitorComponent, DeputyManagementService, DirectoryServiceImpl, DmkComponent, DocumentAdapterService, DocumentBlobManagerComponent, DocumentRoutingEngineServiceImpl, DocumentRoutingServiceImpl, DocumentValidationServiceImpl, DocumentViewCodecService, DownloadServiceImpl, DublinCoreStorageServiceImpl, ElasticSearchComponent, ELServiceComponent, EventService, EventServiceComponent, ExceptionHandlingComponent, FavoritesManagerImpl, FileEventTracker, FileManagerService, FileSystemItemAdapterServiceImpl, FreemarkerComponent, FSExporter, HtmlSanitizerServiceImpl, ImagingComponent, IOComponent, IOManagerComponent, JtaActivator, JWTServiceImpl, KafkaConfigServiceImpl, KeyManagerImpl, KeyValueServiceImpl, LayoutStoreImpl, LibrarySelectorService, LifeCycleServiceImpl, LocalConfigurationServiceImpl, LocaleComponent, LocationManagerService, LockManagerService, LoginAsComponent, LoginComponent, MailServiceImpl, MailServiceImpl, ManagedComponent, MarshallerRegistryImpl, MemRepositoryService, MetricComponent, MetricsServiceImpl, MigrationServiceImpl, MimetypeRegistryService, MongoDBComponent, MongoDBRepositoryService, MultiTenantServiceImpl, NotificationService, NuxeoAdobeConnectorServiceImpl, NuxeoCmisServiceFactoryManager, NuxeoDriveManagerImpl, NuxeoRepositories, NXAuditEventsService, OAuth2ClientServiceImpl, OAuth2ServiceProviderRegistryImpl, OAuth2TokenServiceImpl, OAuthConsumerRegistryImpl, OAuthServerKeyManagerImpl, OAuthServiceProviderRegistryImpl, OAuthTokenStoreImpl, ObjectResolverServiceImpl, OpenIDConnectProviderRegistryImpl, PackageUpdateComponent, PageProviderServiceImpl, PathSegmentComponent, PDFTransformationServiceImpl, PersistenceComponent, PlatformManagementComponent, PluggableAuthenticationService, PreviewAdapterManagerComponent, PropertiesMappingComponent, PublisherServiceImpl, PubSubServiceImpl, QueryMakerServiceImpl, QuotaSizeServiceImpl, QuotaStatsServiceImpl, RelationService, ReloadComponent, RenderingServiceImpl, RenditionServiceImpl, RepositoryManagerImpl, RepositoryService, RequestControllerService, RequestFilterService, ResourcePublisherService, ResourceService, RestAPIServiceImpl, RootServiceImpl, RuntimeComponent, ScannedFileMapperComponent, SchedulerServiceImpl, ScimV2MappingServiceImpl, ScrollComponent, SecurityService, ServerComponent, ServerLocatorService, ServletRegistryComponent, ShibbolethAuthenticationServiceImpl, SignatureServiceImpl, SQLRepositoryCompatService, SQLRepositoryService, StandbyComponent, StreamServiceImpl, SuggestionServiceImpl, TagServiceImpl, TargetPlatformServiceImpl, TaskServiceImpl, TemplateProcessorComponent, TemplateSerializerServiceImpl, ThemeStylingServiceImpl, ThreeDServiceImpl, ThumbnailServiceImpl, TransientStorageComponent, TrashServiceImpl, TypeService, TypeService, UIDGeneratorComponent, UserInvitationComponent, UserMapperComponent, UserPreferencesServiceImpl, UserProfileServiceImpl, UserService, UserWorkspaceServiceImplComponent, VersioningComponent, VersioningManagerImpl, VideoServiceImpl, VideoToolsServiceImpl, WebDavService, WebEngineComponent, WebResourceManagerImpl, WOPIServiceImpl, WorkManagerImpl, XMLImporterComponent

public class DefaultComponent extends Object implements Component, Adaptable
Empty implementation for a component.
Author:
Bogdan Stefanescu
  • Field Details

    • name

      protected String name
      Since:
      10.3
    • lastModified

      protected Long lastModified
      Since:
      5.6
  • Constructor Details

    • DefaultComponent

      public DefaultComponent()
  • Method Details

    • setName

      public void setName(String name)
      Description copied from interface: Component
      Sets the name for this component, as it was defined in its XML.

      This is called once after construction by the runtime framework.

      Specified by:
      setName in interface Component
      Parameters:
      name - the name
    • activate

      public void activate(ComponentContext context)
      Description copied from interface: Component
      Activates the component.

      This method is called by the runtime when a component is activated.

      Specified by:
      activate in interface Component
      Parameters:
      context - the runtime context
    • deactivate

      public void deactivate(ComponentContext context)
      Description copied from interface: Component
      Deactivates the component.

      This method is called by the runtime when a component is deactivated.

      Specified by:
      deactivate in interface Component
      Parameters:
      context - the runtime context
    • addRuntimeMessage

      protected void addRuntimeMessage(RuntimeMessage.Level level, String message)
    • addRuntimeMessage

      protected void addRuntimeMessage(RuntimeMessage.Level level, String message, RuntimeMessage.Source source, String sourceComponent)
    • registerExtension

      public void registerExtension(Extension extension)
      Description copied from interface: Extensible
      Registers the given extension.
      Specified by:
      registerExtension in interface Extensible
      Parameters:
      extension - the extension to register
    • unregisterExtension

      public void unregisterExtension(Extension extension)
      Description copied from interface: Extensible
      Unregisters the given extension.
      Specified by:
      unregisterExtension in interface Extensible
      Parameters:
      extension - the extension to unregister
    • registerContribution

      public void registerContribution(Object contribution, String xp, ComponentInstance component)
    • unregisterContribution

      public void unregisterContribution(Object contribution, String xp, ComponentInstance component)
    • getAdapter

      public <T> T getAdapter(Class<T> adapter)
      Description copied from interface: Adaptable
      Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.
      Specified by:
      getAdapter in interface Adaptable
      Parameters:
      adapter - the adapter class to look up
      Returns:
      a object castable to the given class, or null if this object does not have an adapter for the given class
    • start

      public void start(ComponentContext context)
      Description copied from interface: Component
      Start the component. This method is called after all the components were resolved and activated
      Specified by:
      start in interface Component
    • stop

      public void stop(ComponentContext context) throws InterruptedException
      Description copied from interface: Component
      Stop the component.
      Specified by:
      stop in interface Component
      Throws:
      InterruptedException
    • setModifiedNow

      protected void setModifiedNow()
      Sets the last modified date to current date timestamp
      Since:
      5.6
    • getLastModified

      public Long getLastModified()
      Description copied from interface: TimestampedService
      Returns the last modification timestamp or null if unknown.

      This method is useful for third-party code implementing caching on resources held by the component/service.

      Specified by:
      getLastModified in interface TimestampedService
      See Also:
    • setLastModified

      public void setLastModified(Long lastModified)
      Description copied from interface: TimestampedService
      Sets the last modified date.

      This method is supposed to be called whenever the component/service resources or state changes.

      Specified by:
      setLastModified in interface TimestampedService
      See Also:
    • getRegistry

      protected DescriptorRegistry getRegistry()
      Since:
      10.3
    • register

      protected boolean register(String xp, Descriptor descriptor)
      Since:
      10.3
    • unregister

      protected boolean unregister(String xp, Descriptor descriptor)
      Since:
      10.3
    • getDescriptor

      protected <T extends Descriptor> T getDescriptor(String xp, String id)
      Since:
      10.3
    • getDescriptors

      protected <T extends Descriptor> List<T> getDescriptors(String xp)
      Since:
      10.3