public class ContributionPersistenceComponent extends DefaultComponent implements ContributionPersistenceManager
Modifier and Type | Field and Description |
---|---|
protected RuntimeContext |
ctx |
protected ContributionStorage |
storage |
static String |
STORAGE_XP |
lastModified
Constructor and Description |
---|
ContributionPersistenceComponent() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
Contribution |
addContribution(Contribution contrib)
Persists a new contribution.
|
void |
applicationStarted(ComponentContext context)
Notify the component that Nuxeo Framework finished starting all Nuxeo bundles.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
static String |
getComponentName(String contribName) |
Contribution |
getContribution(String name)
Gets a contribution given its name.
|
List<Contribution> |
getContributions()
Gets a list with all persisted contributions.
|
boolean |
installContribution(Contribution contrib)
Installs the contribution given its name.
|
boolean |
isInstalled(Contribution contrib)
Checks whether a contribution is currently installed.
|
boolean |
isPersisted(Contribution contrib)
Checks whether a contribution is currently persisted.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
boolean |
removeContribution(Contribution contrib)
Removes a persisted contribution given its name.
|
void |
start()
Starts the service.
|
void |
stop()
Stops the service.
|
boolean |
uninstallContribution(Contribution contrib)
Uninstalls a contribution given is name.
|
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
Contribution |
updateContribution(Contribution contribution)
Updates in the storage the given contribution modifications.
|
getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtension
public static final String STORAGE_XP
protected ContributionStorage storage
protected RuntimeContext ctx
public ContributionPersistenceComponent()
public static String getComponentName(String contribName)
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public List<Contribution> getContributions()
ContributionPersistenceManager
getContributions
in interface ContributionPersistenceManager
public Contribution getContribution(String name)
ContributionPersistenceManager
getContribution
in interface ContributionPersistenceManager
public Contribution addContribution(Contribution contrib)
ContributionPersistenceManager
ContributionPersistenceManager.installContribution(Contribution)
to install the contribution.addContribution
in interface ContributionPersistenceManager
public boolean removeContribution(Contribution contrib)
ContributionPersistenceManager
ContributionPersistenceManager.uninstallContribution(Contribution)
to uninstall it.removeContribution
in interface ContributionPersistenceManager
public boolean isInstalled(Contribution contrib)
ContributionPersistenceManager
isInstalled
in interface ContributionPersistenceManager
public boolean installContribution(Contribution contrib)
ContributionPersistenceManager
To be able to install a contribution you need to persist it first.
installContribution
in interface ContributionPersistenceManager
public boolean uninstallContribution(Contribution contrib)
ContributionPersistenceManager
uninstallContribution
in interface ContributionPersistenceManager
public Contribution updateContribution(Contribution contribution)
ContributionPersistenceManager
A contribution cannot be renamed. The only permitted modifications are changing the description and the auto start status.
Return back the contribution object.
updateContribution
in interface ContributionPersistenceManager
public boolean isPersisted(Contribution contrib)
ContributionPersistenceManager
isPersisted
in interface ContributionPersistenceManager
public void start()
ContributionPersistenceManager
Contribution.isDisabled()
start
in interface ContributionPersistenceManager
public void stop()
ContributionPersistenceManager
stop
in interface ContributionPersistenceManager
public void applicationStarted(ComponentContext context)
Component
applicationStarted
in interface Component
applicationStarted
in class DefaultComponent
Copyright © 2015 Nuxeo SA. All rights reserved.