当前位置: 首页>>代码示例>>Java>>正文


Java Ioc类代码示例

本文整理汇总了Java中org.nutz.ioc.Ioc的典型用法代码示例。如果您正苦于以下问题:Java Ioc类的具体用法?Java Ioc怎么用?Java Ioc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Ioc类属于org.nutz.ioc包,在下文中一共展示了Ioc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: make

import org.nutz.ioc.Ioc; //导入依赖的package包/类
public View make(Ioc ioc, String type, String value) {
	if ("fm".equalsIgnoreCase(type) || "ftl".equalsIgnoreCase(type)) {
	    if (freeMarkerConfigurer == null) {
	        for (String name : ioc.getNames()) {
                   if (iocName.equals(name)) {
                       freeMarkerConfigurer = ioc.get(FreeMarkerConfigurer.class);
                       break;
                   }
               }
	        if (freeMarkerConfigurer == null) {
	        	Configuration configuration = new Configuration();
	            freeMarkerConfigurer = new FreeMarkerConfigurer(configuration, Mvcs.getServletContext(),"WEB-INF", ".html", null);
	            freeMarkerConfigurer.init();
	        }
	    }
		return new WindowsFreemarkerView(freeMarkerConfigurer, value);
	}
	return null;
}
 
开发者ID:strictnerd,项目名称:windows-file-change,代码行数:20,代码来源:WindowsFreemarkerViewMaker.java

示例2: getTemplateShareVars

import org.nutz.ioc.Ioc; //导入依赖的package包/类
/**
 * 模板引擎共用的变量
 */

public static NutMap getTemplateShareVars() {
	NutMap share = new NutMap();
	Ioc ioc = Mvcs.getIoc();
	share.put("ioc", ioc);
	PropertiesProxy conf = ioc.get(PropertiesProxy.class, "conf");
	share.put("conf", conf.toMap());

	if (!conf.getBoolean("cdn.enable", false) || Strings.isBlank(conf.get("cdn.urlbase"))) {
		share.put("cdnbase", "");
	} else {
		share.put("cdnbase", conf.get("cdn.urlbase"));
	}
	return share;
}
 
开发者ID:strictnerd,项目名称:windows-file-change,代码行数:19,代码来源:Toolkit.java

示例3: init

import org.nutz.ioc.Ioc; //导入依赖的package包/类
@Override
public void init(NutConfig nc) {
    Ioc ioc = nc.getIoc();
    ioc.get(NutQuartzCronJobFactory.class);
    Dao dao = ioc.get(Dao.class);
    Daos.createTablesInPackage(dao, "com.yjh", false);
}
 
开发者ID:yangjinhe,项目名称:maintain-robot,代码行数:8,代码来源:MainSetup.java

示例4: getIoc

import org.nutz.ioc.Ioc; //导入依赖的package包/类
public Ioc getIoc(){
    if(ioc == null){
        ioc = Mvcs.getIoc();
    }else if(ioc == null){
        ioc = Mvcs.ctx().getDefaultIoc();
    }
    return ioc;
}
 
开发者ID:TopCoderMyDream,项目名称:LuliChat,代码行数:9,代码来源:SocketServer.java

示例5: make

import org.nutz.ioc.Ioc; //导入依赖的package包/类
@Override
public View make(Ioc ioc, String type, String value) {
    if (VIEW_FREEMAKER.equals(type)) {
        return new FreeMakerView(value);
    }
    return super.make(ioc, type, value);
}
 
开发者ID:TopCoderMyDream,项目名称:LuliChat,代码行数:8,代码来源:DDView.java

示例6: dao

import org.nutz.ioc.Ioc; //导入依赖的package包/类
private Dao dao() {
    if (null == dao) {
        Ioc ioc = Mvcs.getIoc();
        if (null == ioc)
            ioc = Mvcs.ctx.getDefaultIoc();
        dao = ioc.get(Dao.class);
    }
    return dao;
}
 
开发者ID:TopCoderMyDream,项目名称:LuliChat,代码行数:10,代码来源:AuthenticationFilter.java

示例7: init

import org.nutz.ioc.Ioc; //导入依赖的package包/类
public void init(NutConfig conf) {
    Ioc ioc = conf.getIoc();
    Dao dao = ioc.get(Dao.class);
    Daos.createTablesInPackage(dao, "com.window", false);
    // 初始化默认根用户
    if (dao.count(User.class) == 0) {
        User user = new User();
        user.setName("admin");
        user.setPassword("123456");
        user.setCreateTime(new Date(System.currentTimeMillis()));
        user.setUpdateTime(new Date(System.currentTimeMillis()));
        dao.insert(user);
    }
}
 
开发者ID:strictnerd,项目名称:windows-file-change,代码行数:15,代码来源:MainSetup.java

示例8: create

import org.nutz.ioc.Ioc; //导入依赖的package包/类
public Ioc create(NutConfig nc, String[] paths) {
	if (nc == null || Lang.length(paths) > 0)
		return new SpringIoc(paths);
	else {
		return new SpringIoc(nc);
	}
}
 
开发者ID:lusparioTT,项目名称:MSN,代码行数:8,代码来源:SpringIocIocProvider.java

示例9: init

import org.nutz.ioc.Ioc; //导入依赖的package包/类
@Override
	public void init(NutConfig nc) {
		Ioc ioc = nc.getIoc();
		Dao dao = ioc.get(Dao.class);
		Daos.createTablesInPackage(dao, WxUser.class.getPackage().toString(), false);
//		PropertiesProxy pp = ioc.get(PropertiesProxy.class, "config");
		
		// 按需选择
		ResourceService resourceService = null;
//		try {
//			SSDB ssdb = SSDBs.pool("127.0.0.1", 8888, 5000, null);
//			resourceService = new SsdbResourceService(ssdb);
//			((Ioc2)ioc).getIocContext().save("app", "resourceService", new ObjectProxy(resourceService));
//		} catch (Exception e) {
//			log.info("fail to connect ssdb? using DaoResourceService now", e);
			resourceService = new DaoResourceService(dao);
			((Ioc2)ioc).getIocContext().save("app", "resourceService", new ObjectProxy(resourceService));
//		}
		
//		try {
//			scheduler = StdSchedulerFactory.getDefaultScheduler();
//			scheduler.startDelayed(5000);;
//		} catch (SchedulerException e) {
//			log.warn("Scheduler start fail", e);
//		}


	}
 
开发者ID:amdiaosi,项目名称:nutzWx,代码行数:29,代码来源:WxSetup.java

示例10: make

import org.nutz.ioc.Ioc; //导入依赖的package包/类
/**
 * @param ioc ioc容器
 * @param type 类型
 * @param value 值
 * @return 视图
 */
public View make(Ioc ioc, String type, String value) {
    if ("fm".equalsIgnoreCase(type)) {
        return new FreemarkerView(value);
    }
    return null;
}
 
开发者ID:sunsetyan,项目名称:nutz_frame,代码行数:13,代码来源:FreemarkerViewMaker.java

示例11: make

import org.nutz.ioc.Ioc; //导入依赖的package包/类
@Override
public View make(Ioc ioc, String type, final String value) {
    if (JetWebEngineLoader.getTemplateSuffix().equals(type)) {
        return new JetTemplateView(value);
    }
    return null;
}
 
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:8,代码来源:JetTemplateViewMaker.java

示例12: getIoc

import org.nutz.ioc.Ioc; //导入依赖的package包/类
private Ioc getIoc() {
    if(this.ioc == null) {
        this.ioc=Mvcs.getIoc();
    }
    return this.ioc;
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache-nutz,代码行数:7,代码来源:NutzCacheManagerConfig.java

示例13: makeIt

import org.nutz.ioc.Ioc; //导入依赖的package包/类
public List<? extends MethodInterceptor> makeIt(CacheDelete cache, Method method, Ioc ioc) {
    return Arrays.asList(new DelCacheAopInterceptor(ioc.get(AbstractCacheManager.class, "cachePointCut"), cache, method));
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache-nutz,代码行数:4,代码来源:DelCacheAopConfigration.java

示例14: makeIt

import org.nutz.ioc.Ioc; //导入依赖的package包/类
public List<? extends MethodInterceptor> makeIt(Cache cache, Method method, Ioc ioc) {
    return Arrays.asList(new AutoLoadCacheAopInterceptor(ioc.get(AbstractCacheManager.class, "cachePointCut"), cache, method));
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache-nutz,代码行数:4,代码来源:AutoLoadCacheAopConfigration.java

示例15: make

import org.nutz.ioc.Ioc; //导入依赖的package包/类
public View make(Ioc ioc, String type, String value) {
	if (!"wx".equals(type))
		return null;
	return WxView.me;
}
 
开发者ID:amdiaosi,项目名称:nutzWx,代码行数:6,代码来源:WxViewMaker.java


注:本文中的org.nutz.ioc.Ioc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。