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 |
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 |
start(ComponentContext context)
Start the component.
|
void |
stop()
Stops the service.
|
void |
stop(ComponentContext context)
Stop the component.
|
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, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
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 start(ComponentContext context)
Component
start
in interface Component
start
in class DefaultComponent
public void stop(ComponentContext context)
Component
stop
in interface Component
stop
in class DefaultComponent
Copyright © 2018 Nuxeo. All rights reserved.