org.codehaus.waffle.registrar
Class AbstractRegistrar

java.lang.Object
  extended by org.codehaus.waffle.registrar.AbstractRegistrar
All Implemented Interfaces:
Registrar
Direct Known Subclasses:
AbstractRubyAwareRegistrar

public abstract class AbstractRegistrar
extends java.lang.Object
implements Registrar

Waffle requires that web apps extend this class for registrating actions, services and components for use in their applications.

Author:
Michael Ward

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.codehaus.waffle.registrar.Registrar
Registrar.Injection
 
Constructor Summary
AbstractRegistrar(Registrar delegate)
           
 
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)
           
 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 request()
           
 void session()
           
 Registrar useInjection(Registrar.Injection injectionType)
          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

AbstractRegistrar

public AbstractRegistrar(Registrar delegate)
Method Detail

useInjection

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

Specified by:
useInjection in interface Registrar
Parameters:
injectionType - 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

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.