org.jclouds.logging.config
Class BindLoggersAnnotatedWithResource

java.lang.Object
  extended by org.jclouds.logging.config.BindLoggersAnnotatedWithResource
All Implemented Interfaces:
com.google.inject.spi.TypeListener

public class BindLoggersAnnotatedWithResource
extends Object
implements com.google.inject.spi.TypeListener

TypeListener that will bind Logger to members annotated with Resource

This class is a TypeListener so that it can create a logger whose category is the same as the name of the injected instance's class.

Note that this occurs post-object construction through Binder.bindListener(com.google.inject.matcher.Matcher>, com.google.inject.spi.TypeListener).

Here's an example usage:

     class A {

Author:
Adrian Cole

Constructor Summary
BindLoggersAnnotatedWithResource(Logger.LoggerFactory loggerFactory)
           
 
Method Summary
<I> void
hear(com.google.inject.TypeLiteral<I> injectableType, com.google.inject.spi.TypeEncounter<I> encounter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindLoggersAnnotatedWithResource

@Inject
public BindLoggersAnnotatedWithResource(Logger.LoggerFactory loggerFactory)
Method Detail

hear

public <I> void hear(com.google.inject.TypeLiteral<I> injectableType,
                     com.google.inject.spi.TypeEncounter<I> encounter)
Specified by:
hear in interface com.google.inject.spi.TypeListener


Copyright © 2009-2012 jclouds. All Rights Reserved.