io.nuun.kernel.api
Interface Plugin


public interface Plugin

Author:
Epo Jemba

Method Summary
 Collection<BindingRequest> bindingRequests()
          List of bind request.
 Collection<ClasspathScanRequest> classpathScanRequests()
          List of classpath request needed by this plugin.
 Set<URL> computeAdditionalClasspathScan()
          The kernel allows the plugin to compute additional classpath to scan.
 DependencyInjectionProvider dependencyInjectionProvider()
          return a dependency injection provider to the kernel.
 Collection<Class<? extends Plugin>> dependentPlugins()
          list of plugins that become dependent on "this" plugin.
 String description()
          The description of the plugin.
 void destroy()
          Lifecycle method: destroy()
 InitState init(InitContext initContext)
          Lifecycle method: init()
 Map<String,String> kernelParametersAliases()
          Re return a Map which contains - key :the alias to create
 Collection<KernelParamsRequest> kernelParamsRequests()
          list of kernel params needed by this plugins, required by this plugin.
 String name()
          The name of the plugin.
 UnitModule overridingUnitModule()
          This object will contains bindings definition that will override the main dependency ones.
 String pluginPackageRoot()
          The package root(s) from where the nuun core will scan for annotation.
 String pluginPropertiesPrefix()
          The prefix for all the properties for this plugin.
 void provideContainerContext(Object containerContext)
          Practical method to retrieve the container context as it is passed as argument.
 void provideRoundEnvironment(RoundEnvironment roundEnvironment)
          Round Environment provides information regarding the current round to the plugin.
 Collection<Class<? extends Plugin>> requiredPlugins()
          list of plugins dependencies required by this plugin.
 void start(Context context)
          Lifecycle method: start()
 void stop()
          Lifecycle method: stop()
 UnitModule unitModule()
          Return an object that will contains the dependency injection definitions.
 

Method Detail

init

InitState init(InitContext initContext)
Lifecycle method: init()


start

void start(Context context)
Lifecycle method: start()


stop

void stop()
Lifecycle method: stop()


destroy

void destroy()
Lifecycle method: destroy()


name

String name()
The name of the plugin. Plugin won't be installed, if there is no a name. And if this name is not unique. Mandatory.

Returns:
the plugin name.

description

String description()
The description of the plugin.

Returns:
the description

kernelParamsRequests

Collection<KernelParamsRequest> kernelParamsRequests()
list of kernel params needed by this plugins, required by this plugin.

Returns:
the kernel params requests

classpathScanRequests

Collection<ClasspathScanRequest> classpathScanRequests()
List of classpath request needed by this plugin.

Returns:
the classpath scan requests

bindingRequests

Collection<BindingRequest> bindingRequests()
List of bind request.

Returns:
the binding requests

requiredPlugins

Collection<Class<? extends Plugin>> requiredPlugins()
list of plugins dependencies required by this plugin.

Returns:
the required plugin classes

dependentPlugins

Collection<Class<? extends Plugin>> dependentPlugins()
list of plugins that become dependent on "this" plugin. Returns If Z. return {A.class} A.will become dependent on Z. Z will virtually need A. Even if Z did not ask for it. this allow pre init between plugin. InitContext?

Returns:
the dependent plugin classes

pluginPropertiesPrefix

String pluginPropertiesPrefix()
The prefix for all the properties for this plugin.

Returns:
the properties prefix

pluginPackageRoot

String pluginPackageRoot()
The package root(s) from where the nuun core will scan for annotation. It is possible to specify multiple package roots by separating them by a comma.

Returns:
the package roots

unitModule

UnitModule unitModule()
Return an object that will contains the dependency injection definitions. Mostly a Guice module but it can be other dependency injection object from other DI frameworks : Spring, Tapestry, Jodd, etc. The kernel must have a DependencyInjectionProvider that handle it.

Returns:
the unit module

overridingUnitModule

UnitModule overridingUnitModule()
This object will contains bindings definition that will override the main dependency ones. It can serve as test bindings replacement, environment definition. Those can be also handled by a DependencyInjectionProvider if keys match.

Returns:
the unit module

provideContainerContext

void provideContainerContext(Object containerContext)
Practical method to retrieve the container context as it is passed as argument.

Parameters:
containerContext - the context of the container

computeAdditionalClasspathScan

Set<URL> computeAdditionalClasspathScan()
The kernel allows the plugin to compute additional classpath to scan. Method can use the containerContext - that may be a ServletContext for servlet environment, BundleContext for OSGI environment or something else - given to the plugin via method provideContainerContext.

Returns:
urls to scan

dependencyInjectionProvider

DependencyInjectionProvider dependencyInjectionProvider()
return a dependency injection provider to the kernel.

Returns:
a DependencyInjectionProvider

kernelParametersAliases

Map<String,String> kernelParametersAliases()
Re return a Map which contains
 - key :the alias to create.
 - value :  kernel parameter to alias.
 


provideRoundEnvironment

void provideRoundEnvironment(RoundEnvironment roundEnvironment)
Round Environment provides information regarding the current round to the plugin. The kernel pass this object to the plugin before all

Parameters:
roundEnvironment - the round


Copyright © 2012-2015. All Rights Reserved.