public class ContributionPersistenceComponent extends DefaultComponent implements ContributionPersistenceManager
Modifier and Type | Field and Description |
---|---|
static String |
STORAGE_XP |
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, unregisterExtension
public static final String STORAGE_XP
public void activate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void deactivate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution
in class DefaultComponent
Exception
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
unregisterContribution
in class DefaultComponent
Exception
public List<Contribution> getContributions() throws Exception
ContributionPersistenceManager
getContributions
in interface ContributionPersistenceManager
Exception
public Contribution getContribution(String name) throws Exception
ContributionPersistenceManager
getContribution
in interface ContributionPersistenceManager
Exception
public Contribution addContribution(Contribution contrib) throws Exception
ContributionPersistenceManager
ContributionPersistenceManager.installContribution(Contribution)
to
install the contribution.addContribution
in interface ContributionPersistenceManager
Exception
public boolean removeContribution(Contribution contrib) throws Exception
ContributionPersistenceManager
ContributionPersistenceManager.uninstallContribution(Contribution)
to uninstall it.removeContribution
in interface ContributionPersistenceManager
Exception
public boolean isInstalled(Contribution contrib) throws Exception
ContributionPersistenceManager
isInstalled
in interface ContributionPersistenceManager
Exception
public boolean installContribution(Contribution contrib) throws Exception
ContributionPersistenceManager
To be able to install a contribution you need to persist it first.
installContribution
in interface ContributionPersistenceManager
Exception
public boolean uninstallContribution(Contribution contrib) throws Exception
ContributionPersistenceManager
uninstallContribution
in interface ContributionPersistenceManager
Exception
public Contribution updateContribution(Contribution contribution) throws Exception
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
Exception
public boolean isPersisted(Contribution contrib) throws Exception
ContributionPersistenceManager
isPersisted
in interface ContributionPersistenceManager
Exception
public void start() throws Exception
ContributionPersistenceManager
Contribution.isDisabled()
start
in interface ContributionPersistenceManager
Exception
public void stop() throws Exception
ContributionPersistenceManager
stop
in interface ContributionPersistenceManager
Exception
public void applicationStarted(ComponentContext context) throws Exception
Component
applicationStarted
in interface Component
applicationStarted
in class DefaultComponent
Exception
Copyright © 2013 Nuxeo SA. All Rights Reserved.