org.nutz.ioc.Ioc Java Examples

The following examples show how to use org.nutz.ioc.Ioc. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainLauncher.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 初始化 定时任务
 * @param ioc
 */
private void initSysTask(Ioc ioc) {
    QuartzManager quartzManager = ioc.get(QuartzManager.class);
    quartzManager.clear();
    List<Task> taskList = taskService.query( Cnd.where("status", "=", true));
    for (Task sysTask : taskList) {
        try {
            QuartzJob qj = new QuartzJob();
            qj.setJobName(sysTask.getId());
            qj.setJobGroup(sysTask.getId());
            qj.setClassName(sysTask.getJobClass());
            qj.setCron(sysTask.getCron());
            qj.setComment(sysTask.getNote());
            qj.setDataMap(sysTask.getData());
            quartzManager.add(qj);
        } catch (Exception e) {
            log.error(e.getMessage());
        }
    }
}
 
Example #2
Source File: NutzTest.java    From hasor with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Throwable {
    Ioc ioc = new NutIoc(new ComboIocLoader("*js", "ioc/", "*hasor"));
    //
    // .启动 Hasor
    ioc.get(AppContext.class);
    System.out.println("start.");
    //
    //Client -> Server
    HasorBean hasorBean = ioc.get(AppContext.class).getInstance(HasorBean.class);
    System.out.println(hasorBean);
    //
    ioc.depose();
}
 
Example #3
Source File: JetTemplateViewMaker.java    From jetbrick-template-1x with Apache License 2.0 5 votes vote down vote up
@Override
public View make(Ioc ioc, String type, final String value) {
    if (JetWebEngineLoader.getTemplateSuffix().equals(type)) {
        return new JetTemplateView(value);
    }
    return null;
}
 
Example #4
Source File: AbstractLoader.java    From web-flash with MIT License 4 votes vote down vote up
public abstract Map<String, TableDescriptor> loadTables(Ioc ioc,
String basePackageName, String baseUri,
         String servPackageName,
         String repositoryPackageName,
         String modPackageName) throws Exception;
 
Example #5
Source File: AccessTokenAopInterceptor.java    From NutzSite with Apache License 2.0 4 votes vote down vote up
public AccessTokenAopInterceptor(Ioc ioc, AccessToken token, Method method) {
    this.ioc = ioc;
}
 
Example #6
Source File: AccessTokenAopConfigration.java    From NutzSite with Apache License 2.0 4 votes vote down vote up
@Override
public List<? extends MethodInterceptor> makeIt(AccessToken accessToken, Method method, Ioc ioc) {
    return Arrays.asList(new AccessTokenAopInterceptor(ioc, accessToken, method));
}
 
Example #7
Source File: AbstractLoader.java    From flash-waimai with MIT License 4 votes vote down vote up
public abstract Map<String, TableDescriptor> loadTables(Ioc ioc,
String basePackageName, String baseUri,
         String servPackageName,
         String repositoryPackageName,
         String modPackageName) throws Exception;
 
Example #8
Source File: AbstractRpcRefProxy.java    From nutzcloud with Apache License 2.0 4 votes vote down vote up
public void setIoc(Ioc ioc) {
    this.ioc = ioc;
}
 
Example #9
Source File: WxViewMaker.java    From nutzwx with Apache License 2.0 4 votes vote down vote up
public View make(Ioc ioc, String type, String value) {
	if (!"wx".equals(type))
		return null;
	return WxView.me;
}
 
Example #10
Source File: BeetlViewMaker.java    From beetl2.0 with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public View make(Ioc ioc, String type, String value) {
    if ("beetl".equals(type))
        return new BeetlView(render, value);
    return null;
}