The contents of this document are a work in progress

The 'Plexus' Personality

Overview

The Plexus personality revolves around two segments. The 'begin' and the 'end' segments. The 'begin' segment is run when your component is being started up and the 'end' segment when it is being shut down.

Begin Phase

PhaseInterfaceDescription
LogEnableLogEnablePasses a logger to your component. You will most likely want to inherit AbstractLogEnabled instead
Composition(no interface)Injects your dependencies (see below)
ContextContextualizablePasses the Plexus context. From here you can access the home directory, Plexus Container, and more.
ConfigurationPlexusConfigurableGives you access to the PlexusConfiguration to configure your application
IntializationInitializableInitializes your component.
StartStartableStarts your component

End Phase

PhaseInterfaceDescription
StopStartableStops your component
DisposeDisposableAllows you to dispose of the components you depend on and other resources.
LogDisableLogEnabledDisables component logging

Dependency Injection

Plexus has the ability to do automatic dependency injection. When your component is being composed it will automatically fill in the fields or setters with your components dependencies.

Configuration

The Plexus personality can configure your component two ways. In the auto configuration mode, it matches the xml to fields and classes on your components using XStream. For example, if you have a String field named "cheese" on your component, then this would automatically set that field to "swiss".

<configuration>
  <cheese>swiss</cheese>
</configuration>

If this doesn't provide the needed flexibility you can implement the interface PlexusConfigurable and the PlexusConfiguration object for your component will be passed on to you.