link
Avalon
Avalon Repository - SPI
Home PlanetProductsCentral
Avalon Repository SPI
Service Provider Interface (SPI)

The Avalon Repository SPI extends the API to provide a set of services that define the contact for plugin facilities. The Avalon Repository main bootstrapping system provides out-of-the-box support for concurrent deployment of multiple repository implementations enabling complete customization and future-proof evolution of artifact access and deployment needs. It achives this functionality by applying the same plugin process to its own implementation.

Plugin Facilities
Factory Pattern

A plugin facility is requred to impliment one of the following ranked constructor patterns.

ConstructorDescription
Context and ClassLoader Creation of a new factory using a supplied initial repository context and a classloader established by the bootstrap facility. The classloader will be fully populated in accordance with the metadata published by the factory.
public MyFactory( 
    InitialContext context, 
    ClassLoader classloader )
{
}
Context Creation of a new factory using a supplied initial repository context.
public MyFactory( 
    InitialContext context )
{
}
ClassLoader Creation of a new factory using a supplied classloader established by the bootstrap facility. The classloader will be fully populated in accordance with the metadata published by the factory.
public MyFactory( 
    ClassLoader classloader )
{
}
Null Constructor Creation of a new factory.
public MyFactory()
{
}
Criteria Management

The object established by the factory constructor must implement the Factory interface.

public interface Factory
{
   /**
    * Return a new instance of default criteria for the factory.
    * @return a new criteria instance
    */
    Map createDefaultCriteria();

   /**
    * Create a new instance of an application.
    * @return the application instance
    */
    Object create() throws Exception;

   /**
    * Create a new instance of an application.
    * @param criteria the creation criteria
    * @return the application instance
    */
    Object create( Map criteria ) throws Exception;

}

A client on aquiring the factory will get the default criteria value and use this to parameterize the factory. On completion of parameterization (by setting application specific named values), the create operation is invoked and returns a new instance of the facility.