Skip to content

Instantly share code, notes, and snippets.

@namutaka
Created July 12, 2012 02:13
Show Gist options
  • Save namutaka/3095231 to your computer and use it in GitHub Desktop.
Save namutaka/3095231 to your computer and use it in GitHub Desktop.
S2Conteinerのコンポーネントをダンプする
class MyS2Utils {
protected Logger logger = LoggerFactory.getLogger("test");
public static void dumpComponent() {
S2Container s2Container = (S2Container) SingletonS2ContainerFactory
.getContainer().getRoot();
Object result =
Traversal.forEachComponent(
s2Container,
new Traversal.ComponentDefHandler() {
public Object processComponent(
ComponentDef componentDef) {
logger.debug(componentDef.toString() + " - "
+ componentDef.getComponentClass() + " - "
+ componentDef.getComponentName());
return null;
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment