Class ContributionPersistenceComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.runtime.model.persistence.ContributionPersistenceComponent
- All Implemented Interfaces:
Adaptable,Component,Extensible,ContributionPersistenceManager,TimestampedService
public class ContributionPersistenceComponent
extends DefaultComponent
implements ContributionPersistenceManager
- Author:
- Bogdan Stefanescu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RuntimeContextprotected ContributionStoragestatic final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(ComponentContext context) Activates the component.addContribution(Contribution contrib) Persists a new contribution.voiddeactivate(ComponentContext context) Deactivates the component.static StringgetComponentName(String contribName) getContribution(String name) Gets a contribution given its name.Gets a list with all persisted contributions.booleaninstallContribution(Contribution contrib) Installs the contribution given its name.booleanisInstalled(Contribution contrib) Checks whether a contribution is currently installed.booleanisPersisted(Contribution contrib) Checks whether a contribution is currently persisted.voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) booleanremoveContribution(Contribution contrib) Removes a persisted contribution given its name.voidstart()Starts the service.voidstart(ComponentContext context) Start the component.voidstop()Stops the service.voidstop(ComponentContext context) Stop the component.booleanuninstallContribution(Contribution contrib) Uninstalls a contribution given is name.voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) updateContribution(Contribution contribution) Updates in the storage the given contribution modifications.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
STORAGE_XP
- See Also:
-
storage
-
ctx
-
-
Constructor Details
-
ContributionPersistenceComponent
public ContributionPersistenceComponent()
-
-
Method Details
-
getComponentName
-
activate
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
deactivate
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
unregisterContributionin classDefaultComponent
-
getContributions
Description copied from interface:ContributionPersistenceManagerGets a list with all persisted contributions.- Specified by:
getContributionsin interfaceContributionPersistenceManager
-
getContribution
Description copied from interface:ContributionPersistenceManagerGets a contribution given its name.- Specified by:
getContributionin interfaceContributionPersistenceManager
-
addContribution
Description copied from interface:ContributionPersistenceManagerPersists a new contribution. The contribution will not be installed. You need to explicitly callContributionPersistenceManager.installContribution(Contribution)to install the contribution.- Specified by:
addContributionin interfaceContributionPersistenceManager
-
removeContribution
Description copied from interface:ContributionPersistenceManagerRemoves a persisted contribution given its name. The contribution will not be uninstalled before being removed. You need to explicitly callContributionPersistenceManager.uninstallContribution(Contribution)to uninstall it.- Specified by:
removeContributionin interfaceContributionPersistenceManager- Returns:
- true if the contribution was removed, false if the contribution was not found in persistence.
-
isInstalled
Description copied from interface:ContributionPersistenceManagerChecks whether a contribution is currently installed.- Specified by:
isInstalledin interfaceContributionPersistenceManager
-
installContribution
Description copied from interface:ContributionPersistenceManagerInstalls the contribution given its name. Return true if contribution install succeeds, false if the contribution is already installed.To be able to install a contribution you need to persist it first.
- Specified by:
installContributionin interfaceContributionPersistenceManager
-
uninstallContribution
Description copied from interface:ContributionPersistenceManagerUninstalls a contribution given is name. If not already installed return false otherwise return true. The contribution persisted state is not modified by this operation.- Specified by:
uninstallContributionin interfaceContributionPersistenceManager
-
updateContribution
Description copied from interface:ContributionPersistenceManagerUpdates in the storage the given contribution modifications.A contribution cannot be renamed. The only permitted modifications are changing the description and the auto start status.
Return back the contribution object.
- Specified by:
updateContributionin interfaceContributionPersistenceManager
-
isPersisted
Description copied from interface:ContributionPersistenceManagerChecks whether a contribution is currently persisted.- Specified by:
isPersistedin interfaceContributionPersistenceManager
-
start
public void start()Description copied from interface:ContributionPersistenceManagerStarts the service. This will install all persisted contributions that are marked as auto-install. SeeContribution.isDisabled()- Specified by:
startin interfaceContributionPersistenceManager
-
stop
public void stop()Description copied from interface:ContributionPersistenceManagerStops the service. This will uninstall all installed contributions.- Specified by:
stopin interfaceContributionPersistenceManager
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent
-