예제 #1
0
  public static <T> T aspect(Class<? extends T> iClass) {
    String aspectName = Utility.getClassName(iClass);
    int pos = aspectName.indexOf("Aspect");
    if (pos == -1)
      throw new ConfigurationNotFoundException(
          "Cannot find aspect implementation for class: " + aspectName);

    aspectName = aspectName.substring(0, pos).toLowerCase();
    checkForAspectManager();
    return (T) aspectManager.getAspect(aspectName);
  }
예제 #2
0
 public static <T> T component(Class<T> iClass) {
   if (Utility.getClassName(iClass).endsWith("Aspect")) return aspect(iClass);
   return RomaApplicationContext.getInstance().getComponentAspect().getComponent(iClass);
 }