Package org.nuxeo.runtime.model
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,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,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,RedisComponent,RelationService,ReloadComponent,RenderingServiceImpl,RenditionServiceImpl,RepositoryManagerImpl,RepositoryService,RequestControllerService,RequestFilterService,ResourcePublisherService,ResourceService,RootServiceImpl,RoutingTaskServiceImpl,RuntimeComponent,ScannedFileMapperComponent,SchedulerServiceImpl,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 Summary
Fields Modifier and Type Field Description protected LonglastModifiedprotected Stringname
-
Constructor Summary
Constructors Constructor Description DefaultComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(ComponentContext context)Activates the component.protected voidaddRuntimeMessage(RuntimeMessage.Level level, String message)protected voidaddRuntimeMessage(RuntimeMessage.Level level, String message, RuntimeMessage.Source source, String sourceComponent)voiddeactivate(ComponentContext context)Deactivates the component.<T> TgetAdapter(Class<T> adapter)Returns an object which is an instance of the given class associated with this object.protected <T extends Descriptor>
TgetDescriptor(String xp, String id)protected <T extends Descriptor>
List<T>getDescriptors(String xp)LonggetLastModified()Returns the last modification timestamp or null if unknown.protected DescriptorRegistrygetRegistry()protected booleanregister(String xp, Descriptor descriptor)voidregisterContribution(Object contribution, String xp, ComponentInstance component)voidregisterExtension(Extension extension)Registers the given extension.voidsetLastModified(Long lastModified)Sets the last modified date.protected voidsetModifiedNow()Sets the last modified date to current date timestampvoidsetName(String name)Sets the name for this component, as it was defined in its XML.voidstart(ComponentContext context)Start the component.voidstop(ComponentContext context)Stop the component.protected booleanunregister(String xp, Descriptor descriptor)voidunregisterContribution(Object contribution, String xp, ComponentInstance component)voidunregisterExtension(Extension extension)Unregisters the given extension.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
lastModified
protected Long lastModified
- Since:
- 5.6
-
-
Constructor Detail
-
DefaultComponent
public DefaultComponent()
-
-
Method Detail
-
setName
public void setName(String name)
Description copied from interface:ComponentSets the name for this component, as it was defined in its XML.This is called once after construction by the runtime framework.
-
activate
public void activate(ComponentContext context)
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- 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:ExtensibleRegisters the given extension.- Specified by:
registerExtensionin interfaceExtensible- Parameters:
extension- the extension to register
-
unregisterExtension
public void unregisterExtension(Extension extension)
Description copied from interface:ExtensibleUnregisters the given extension.- Specified by:
unregisterExtensionin interfaceExtensible- 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:AdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.- Specified by:
getAdapterin interfaceAdaptable- Parameters:
adapter- the adapter class to look up- Returns:
- a object castable to the given class, or
nullif this object does not have an adapter for the given class
-
start
public void start(ComponentContext context)
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated
-
stop
public void stop(ComponentContext context) throws InterruptedException
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- 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:TimestampedServiceReturns 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:
getLastModifiedin interfaceTimestampedService- See Also:
TimestampedService.setLastModified(Long)
-
setLastModified
public void setLastModified(Long lastModified)
Description copied from interface:TimestampedServiceSets the last modified date.This method is supposed to be called whenever the component/service resources or state changes.
- Specified by:
setLastModifiedin interfaceTimestampedService- See Also:
TimestampedService.getLastModified()
-
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
-
-