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
,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
,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
,RestAPIServiceImpl
,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 Long
lastModified
protected String
name
-
Constructor Summary
Constructors Constructor Description DefaultComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(ComponentContext context)
Activates the component.protected void
addRuntimeMessage(RuntimeMessage.Level level, String message)
protected void
addRuntimeMessage(RuntimeMessage.Level level, String message, RuntimeMessage.Source source, String sourceComponent)
void
deactivate(ComponentContext context)
Deactivates the component.<T> T
getAdapter(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)
Long
getLastModified()
Returns the last modification timestamp or null if unknown.protected DescriptorRegistry
getRegistry()
protected boolean
register(String xp, Descriptor descriptor)
void
registerContribution(Object contribution, String xp, ComponentInstance component)
void
registerExtension(Extension extension)
Registers the given extension.void
setLastModified(Long lastModified)
Sets the last modified date.protected void
setModifiedNow()
Sets the last modified date to current date timestampvoid
setName(String name)
Sets the name for this component, as it was defined in its XML.void
start(ComponentContext context)
Start the component.void
stop(ComponentContext context)
Stop the component.protected boolean
unregister(String xp, Descriptor descriptor)
void
unregisterContribution(Object contribution, String xp, ComponentInstance component)
void
unregisterExtension(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
-
-
-
-
Method Detail
-
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.
-
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.
-
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 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:Extensible
Registers the given extension.- Specified by:
registerExtension
in interfaceExtensible
- 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 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:Adaptable
Returns an object which is an instance of the given class associated with this object. Returnsnull
if no such object can be found.- Specified by:
getAdapter
in interfaceAdaptable
- 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
-
stop
public void stop(ComponentContext context) throws InterruptedException
Description copied from interface:Component
Stop the component.- Specified by:
stop
in 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: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 interfaceTimestampedService
- See Also:
TimestampedService.setLastModified(Long)
-
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 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
-
-