public final class ECPRepositoryManagerImpl extends PropertiesStore<InternalRepository,ECPObserver> implements ECPRepositoryManager, ECPProvidersChangedObserver
PropertiesStore.StorableElement
Constructor and Description |
---|
ECPRepositoryManagerImpl()
Should not be called directly, use service instead.
|
Modifier and Type | Method and Description |
---|---|
ECPRepository |
addRepository(ECPProvider provider,
String name,
String label,
String description,
ECPProperties properties)
This method allows the user to create a repository.
|
protected void |
doActivate() |
protected void |
doDeactivate() |
protected File |
getFile(InternalRepository element) |
Collection<ECPRepository> |
getRepositories()
Returns all known repositories.
|
InternalRepository |
getRepository(Object adaptable)
This method returns a
ECPRepository from an adaptable. |
InternalRepository |
getRepository(String name)
This method returns a repository by its name.
|
boolean |
hasRepositories()
Checks whether any repositories are available.
|
protected boolean |
isLoadableElement(File file) |
protected InternalRepository |
loadElement(ObjectInput in)
Loads an element.
|
void |
notifyObjectsChanged(ECPRepository repository,
Collection<Object> objects)
This is called by the
ECPRepository to notificate observers about chnages it its objects. |
protected void |
notifyObservers(Collection<InternalRepository> oldRepositories,
Collection<InternalRepository> newRepositories)
Notifies observers that the elements in the registry have changed.
|
void |
providersChanged(Collection<ECPProvider> oldProviders,
Collection<ECPProvider> newProviders)
This is called to indicate, that providers changed.
|
elementsChanged, getFolder, load, setFolder, storeElement
addResolveListener, descriptorChanged, getElementName, removeResolveListener
addObserver, changeElements, disposed, doChangeElements, getElement, getElementCount, getElementNames, getElements, hasElement, hasElements, isDisposingElement, isRemoveDisposedElements, removeObserver
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
public ECPRepositoryManagerImpl()
public InternalRepository getRepository(Object adaptable)
ECPRepository
from an adaptable.getRepository
in interface ECPRepositoryManager
adaptable
- the adaptable to adaptECPRepository
or null if the adaptable could not be adaptedpublic InternalRepository getRepository(String name)
getRepository
in interface ECPRepositoryManager
name
- the name of the repositoryECPRepository
or null if no repository with such name exists.public Collection<ECPRepository> getRepositories()
getRepositories
in interface ECPRepositoryManager
ECPRepositories
public boolean hasRepositories()
public ECPRepository addRepository(ECPProvider provider, String name, String label, String description, ECPProperties properties)
ECPProvider.hasCreateRepositorySupport()
returns
false an UnsupportedOperationException is thrown.addRepository
in interface ECPRepositoryManager
provider
- the ECPProvider
of this repositoryname
- the name of the new repositorylabel
- the label of the new repositorydescription
- the description of the new repositoryproperties
- the ECPProperties
of this repositoryECPRepository
public void notifyObjectsChanged(ECPRepository repository, Collection<Object> objects)
ECPRepository
to notificate observers about chnages it its objects.repository
- the repository where the changes occuredobjects
- the changed objectspublic void providersChanged(Collection<ECPProvider> oldProviders, Collection<ECPProvider> newProviders)
providersChanged
in interface ECPProvidersChangedObserver
oldProviders
- provider before changenewProviders
- providers after changeprotected File getFile(InternalRepository element)
getFile
in class PropertiesStore<InternalRepository,ECPObserver>
protected boolean isLoadableElement(File file)
isLoadableElement
in class PropertiesStore<InternalRepository,ECPObserver>
protected InternalRepository loadElement(ObjectInput in) throws IOException
PropertiesStore
loadElement
in class PropertiesStore<InternalRepository,ECPObserver>
in
- an ObjectInput
to load the element fromIOException
- if the element cannot be loaded correctlyprotected void notifyObservers(Collection<InternalRepository> oldRepositories, Collection<InternalRepository> newRepositories) throws Exception
Registry
notifyObservers
in class Registry<InternalRepository,ECPObserver>
oldRepositories
- The old collection of elementsnewRepositories
- The new collection of elementsException
protected void doActivate() throws Exception
doActivate
in class PropertiesStore<InternalRepository,ECPObserver>
Exception
Copyright © 2019. All rights reserved.