org.codehaus.waffle.registrar.pico
Class PicoRegistrar

java.lang.Object
  extended by org.codehaus.waffle.registrar.pico.PicoRegistrar
All Implemented Interfaces:
Registrar, RubyAwareRegistrar

public class PicoRegistrar
extends java.lang.Object
implements Registrar, RubyAwareRegistrar

This Registrar is backed by PicoContainer for managing Dependency Injection. This registrar is passed to the custom registrar defined in the web.xml as a delegate.

Author:
Michael Ward, Mauro Talevi

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.codehaus.waffle.registrar.Registrar
Registrar.Injection
 
Constructor Summary
PicoRegistrar(org.picocontainer.MutablePicoContainer picoContainer, ParameterResolver parameterResolver, org.picocontainer.defaults.LifecycleStrategy lifecycleStrategy, RegistrarMonitor registrarMonitor)
           
 
Method Summary
 void application()
           
 boolean isRegistered(java.lang.Object typeOrInstance)
          Determines if a component is already registered
 Registrar register(java.lang.Class<?> type, java.lang.Object... parameters)
           
 Registrar register(java.lang.Object key, java.lang.Class<?> type, java.lang.Object... parameters)
           
 void registerComponentAdapter(org.picocontainer.ComponentAdapter componentAdapter)
           
 Registrar registerInstance(java.lang.Object instance)
           
 Registrar registerInstance(java.lang.Object key, java.lang.Object instance)
           
 Registrar registerNonCaching(java.lang.Class<?> type, java.lang.Object... parameters)
           
 Registrar registerNonCaching(java.lang.Object key, java.lang.Class<?> type, java.lang.Object... parameters)
           
 void registerRubyScript(java.lang.String key, java.lang.String className)
           
 void request()
           
 void session()
           
 Registrar useInjection(Registrar.Injection injection)
          Use the given injection type for component instantiation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PicoRegistrar

public PicoRegistrar(org.picocontainer.MutablePicoContainer picoContainer,
                     ParameterResolver parameterResolver,
                     org.picocontainer.defaults.LifecycleStrategy lifecycleStrategy,
                     RegistrarMonitor registrarMonitor)
Method Detail

useInjection

public Registrar useInjection(Registrar.Injection injection)
Description copied from interface: Registrar
Use the given injection type for component instantiation

Specified by:
useInjection in interface Registrar
Parameters:
injection - the Injection to use
Returns:
The Registrar

isRegistered

public boolean isRegistered(java.lang.Object typeOrInstance)
Description copied from interface: Registrar
Determines if a component is already registered

Specified by:
isRegistered in interface Registrar
Parameters:
typeOrInstance - the component Class type or Object instance/key
Returns:
A boolean flag, true if component is registered

register

public Registrar register(java.lang.Class<?> type,
                          java.lang.Object... parameters)
Specified by:
register in interface Registrar
Parameters:
type - represent both the key and type the object will be registered under
parameters - any parameters needed to satisfy the component being registered

register

public Registrar register(java.lang.Object key,
                          java.lang.Class<?> type,
                          java.lang.Object... parameters)
Specified by:
register in interface Registrar
Parameters:
key - represent the key the object will be registered under
type - represent the component type
parameters - any parameters needed to satisfy the component being registered

registerInstance

public Registrar registerInstance(java.lang.Object instance)
Specified by:
registerInstance in interface Registrar

registerInstance

public Registrar registerInstance(java.lang.Object key,
                                  java.lang.Object instance)
Specified by:
registerInstance in interface Registrar

registerNonCaching

public Registrar registerNonCaching(java.lang.Class<?> type,
                                    java.lang.Object... parameters)
Specified by:
registerNonCaching in interface Registrar

registerNonCaching

public Registrar registerNonCaching(java.lang.Object key,
                                    java.lang.Class<?> type,
                                    java.lang.Object... parameters)
Specified by:
registerNonCaching in interface Registrar

registerRubyScript

public void registerRubyScript(java.lang.String key,
                               java.lang.String className)
Specified by:
registerRubyScript in interface RubyAwareRegistrar

registerComponentAdapter

public void registerComponentAdapter(org.picocontainer.ComponentAdapter componentAdapter)

application

public void application()
Specified by:
application in interface Registrar

session

public void session()
Specified by:
session in interface Registrar

request

public void request()
Specified by:
request in interface Registrar


Copyright © 2008. All Rights Reserved.