org.apache.wicket.guice
Class InjectionFlagCachingGuiceComponentInjector

java.lang.Object
  extended by org.apache.wicket.injection.Injector
      extended by org.apache.wicket.injection.ConfigurableInjector
          extended by org.apache.wicket.guice.GuiceComponentInjector
              extended by org.apache.wicket.guice.InjectionFlagCachingGuiceComponentInjector
All Implemented Interfaces:
IComponentInstantiationListener

public class InjectionFlagCachingGuiceComponentInjector
extends GuiceComponentInjector

Finding the guice annotations via reflection for each Component instantiation is a rather heavyweight operation (@link GuiceComponentInjector. This causes considerable overhead with large lists that have complicated component structure per row, which is totally unnecessary for stock wicket components that do not contain any Guice annotations.

Author:
Teppo Kurki (Wicket-1763)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.guice.GuiceComponentInjector
GuiceComponentInjector.MoreThanOneBindingException
 
Constructor Summary
InjectionFlagCachingGuiceComponentInjector(Application app, com.google.inject.Injector injector)
          Construct.
 
Method Summary
 Object inject(Object object)
          Injects proxies using IFieldValueFactory obtained by calling getFieldValueFactory() method
 void onInstantiation(Component component)
          Called for every component that is instantiated.
 
Methods inherited from class org.apache.wicket.guice.GuiceComponentInjector
findBindingAnnotation, getFieldValueFactory
 
Methods inherited from class org.apache.wicket.injection.Injector
getInstance, inject, isBoundaryClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectionFlagCachingGuiceComponentInjector

public InjectionFlagCachingGuiceComponentInjector(Application app,
                                                  com.google.inject.Injector injector)
Construct.

Parameters:
app -
injector -
Method Detail

inject

public Object inject(Object object)
Description copied from class: ConfigurableInjector
Injects proxies using IFieldValueFactory obtained by calling getFieldValueFactory() method

Overrides:
inject in class GuiceComponentInjector
Parameters:
object - object to be injected
Returns:
Object that was injected - used for chaining
See Also:
GuiceComponentInjector.inject(java.lang.Object)

onInstantiation

public void onInstantiation(Component component)
Description copied from interface: IComponentInstantiationListener
Called for every component that is instantiated. This method is called during construction, so do not depend on the construction being completed yet. The id is guaranteed to be set before this call.

Specified by:
onInstantiation in interface IComponentInstantiationListener
Overrides:
onInstantiation in class GuiceComponentInjector
Parameters:
component - the component that is being instantiated.
See Also:
GuiceComponentInjector.onInstantiation(org.apache.wicket.Component)


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.