org.xwiki.extension.internal
Class DefaultExtensionManager

java.lang.Object
  extended by org.xwiki.extension.internal.DefaultExtensionManager
All Implemented Interfaces:
Initializable, ExtensionManager

@Component
@Singleton
public class DefaultExtensionManager
extends Object
implements ExtensionManager, Initializable

Default implementation of ExtensionManager.

Since:
4.0M1

Constructor Summary
DefaultExtensionManager()
           
 
Method Summary
 ExtensionRepository getRepository(String repositoryId)
          Return a repository based on its id.
 void initialize()
          Method called by the Component Manager when the component is created for the first time (i.e.
 Extension resolveExtension(ExtensionDependency extensionDependency)
          Search the provided extension as a dependency of another extension among all repositories including core and local repositories.
 Extension resolveExtension(ExtensionId extensionId)
          Search the provided extension among all repositories including core and local repositories.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExtensionManager

public DefaultExtensionManager()
Method Detail

initialize

public void initialize()
                throws InitializationException
Description copied from interface: Initializable
Method called by the Component Manager when the component is created for the first time (i.e. when it's looked up for the first time or if the component is specified as being loaded on startup). If the component instantiation strategy is singleton then this method is called only once during the lifecycle of the Component Manager. Otherwise the component is created at each lookup and thus this method is called at each lookup too.

Specified by:
initialize in interface Initializable
Throws:
InitializationException - if an error happens during a component's initialization

resolveExtension

public Extension resolveExtension(ExtensionId extensionId)
                           throws ResolveException
Description copied from interface: ExtensionManager
Search the provided extension among all repositories including core and local repositories.

The search is done in the following order:

The first one found is returned.

Specified by:
resolveExtension in interface ExtensionManager
Parameters:
extensionId - the extension identifier
Returns:
the resolved extension
Throws:
ResolveException - error when trying to resolve extension

resolveExtension

public Extension resolveExtension(ExtensionDependency extensionDependency)
                           throws ResolveException
Description copied from interface: ExtensionManager
Search the provided extension as a dependency of another extension among all repositories including core and local repositories.

The search is done in the following order:

The first one found is returned.

Specified by:
resolveExtension in interface ExtensionManager
Parameters:
extensionDependency - the extension as dependency
Returns:
the resolved extension
Throws:
ResolveException - error when trying to resolve extension

getRepository

public ExtensionRepository getRepository(String repositoryId)
Description copied from interface: ExtensionManager
Return a repository based on its id.

This method also return local, installed and core repositories.

Specified by:
getRepository in interface ExtensionManager
Parameters:
repositoryId - the id of the repository
Returns:
the repository