net.walend.director
Interface FancyDirector

All Known Implementing Classes:
GenericDirector

public interface FancyDirector

This optional interface lets you create a custom map between roles and classes that fill those rolls. The default implementation, GenericDirector, uses {lyophil.home}/lyophil.properties to define the map.

Since:
20001125
Author:
David Walend

Field Summary
static java.lang.String DIRECTOR
           
 
Method Summary
 java.lang.Class getClassForRole(java.lang.String role)
          Return the concrete class to use for this particular interface.
 java.lang.Object getObjectForRole(java.lang.String role)
          Return an instance of an Object that can fulfil the role.
 PropertySource getPropertySource()
          Return the PropertySource.
 java.lang.Object getSingletonForRole(java.lang.String role)
          Return an instance of an Object that can fulfil the role.
 

Field Detail

DIRECTOR

public static final java.lang.String DIRECTOR
Method Detail

getClassForRole

public java.lang.Class getClassForRole(java.lang.String role)
Return the concrete class to use for this particular interface.

Parameters:
role - The name of a defined role. It should normally match a director. property from the PropertiesSource.
Throws:
ClassForRoleNotFoundException - if the FancyDirector can not map the class to a role.

getObjectForRole

public java.lang.Object getObjectForRole(java.lang.String role)
Return an instance of an Object that can fulfil the role.

Parameters:
role - The name of a defined role. It should normally match a director. property from the PropertiesSource.
Throws:
ClassForRoleNotFoundException - if the FancyDirector can not map the class to a role.
CannotCreateException - if the FancyDirector can not construct the object.

getSingletonForRole

public java.lang.Object getSingletonForRole(java.lang.String role)
Return an instance of an Object that can fulfil the role.

Parameters:
role - The name of a defined role. It should normally match a director. property from the PropertiesSource.
Throws:
ClassForRoleNotFoundException - if the FancyDirector can not map the class to a role.
CannotCreateException - if the FancyDirector can not construct the object.

getPropertySource

public PropertySource getPropertySource()
Return the PropertySource.

Throws:
ClassForRoleNotFoundException - if the FancyDirector can not map the class to a role.
CannotConstructObjectException - if the FancyDirector can not construct the object.


Copyright (c) 2000, 2001, David Walend