use of act.app.App in project actframework by actframework.
the class ControllerClassMetaInfo method getAllWithList.
private void getAllWithList(final Set<String> withList, final ControllerClassMetaInfoManager infoBase) {
withList.addAll(this.withList);
if (null != superType) {
final String superClass = superType.getClassName();
App app = App.instance();
ClassInfoRepository repo = app.classLoader().classInfoRepository();
ControllerClassMetaInfo info = infoBase.controllerMetaInfo(superClass);
String curSuperClass = superClass;
while (null == info && !"java.lang.Object".equals(curSuperClass)) {
ClassNode node = repo.node(curSuperClass);
if (null != node) {
node = node.parent();
}
if (null == node) {
break;
}
curSuperClass = node.name();
info = infoBase.controllerMetaInfo(curSuperClass);
}
if (null != info) {
withList.add(superClass);
}
}
}
use of act.app.App in project actframework by actframework.
the class ClassFinderData method scheduleFind.
public void scheduleFind() {
if (logger.isTraceEnabled()) {
logger.trace("schedule class finding for %s", this);
}
final App app = App.instance();
app.jobManager().on(when, jobId(), new Runnable() {
@Override
public void run() {
how.find(app, ClassFinderData.this);
}
});
}
use of act.app.App in project actframework by actframework.
the class AppConfigPlugin method foundConfigurator.
@SubClassFinder(callOn = SysEventId.CLASS_LOADED)
public static void foundConfigurator(final Class<? extends AppConfigurator> configuratorClass) {
final App app = App.instance();
AppConfigurator configurator = app.getInstance(configuratorClass);
configurator.app(app);
configurator.configure();
app.config()._merge(configurator);
}
use of act.app.App in project actframework by actframework.
the class RequestHandlerProxy method registerGlobalInterceptors.
@AnnotatedClassFinder(value = Global.class, callOn = SysEventId.PRE_START)
@SuppressWarnings("unused")
public static void registerGlobalInterceptors(Class<?> interceptorClass) {
App app = Act.app();
if (BeforeInterceptor.class.isAssignableFrom(interceptorClass)) {
BeforeInterceptor interceptor = (BeforeInterceptor) app.getInstance(interceptorClass);
registerGlobalInterceptor(interceptor);
} else if (AfterInterceptor.class.isAssignableFrom(interceptorClass)) {
AfterInterceptor interceptor = (AfterInterceptor) app.getInstance(interceptorClass);
registerGlobalInterceptor(interceptor);
} else if (ExceptionInterceptor.class.isAssignableFrom(interceptorClass)) {
ExceptionInterceptor interceptor = (ExceptionInterceptor) app.getInstance(interceptorClass);
registerGlobalInterceptor(interceptor);
} else if (FinallyInterceptor.class.isAssignableFrom(interceptorClass)) {
FinallyInterceptor interceptor = (FinallyInterceptor) app.getInstance(interceptorClass);
registerGlobalInterceptor(interceptor);
} else {
// check if this is a free style interceptor
ControllerClassMetaInfo metaInfo = app.classLoader().controllerClassMetaInfo(interceptorClass.getName());
if (null != metaInfo) {
registerGlobalInterceptor(metaInfo.interceptors());
}
}
}
use of act.app.App in project actframework by actframework.
the class DependencyInjectorBase method discoverDiListener.
@SubClassFinder(value = DependencyInjectionListener.class, callOn = SysEventId.DEPENDENCY_INJECTOR_PROVISIONED)
public static void discoverDiListener(final Class<? extends DependencyInjectionListener> target) {
App app = App.instance();
DependencyInjector di = app.injector();
di.registerDiListener(app.getInstance(target));
}
Aggregations