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


Java Inject类代码示例

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


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

示例1: scheduleJobs

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
@Startup
public static void scheduleJobs(ParallelExecutor executor,
		final IMemoryDB memoryDb,
		@Inject @Symbol(USE_MEMDB_PARAMETER) final String useMemoryDB,
		@Inject @Symbol(MAX_MEMDB_ROWS_PARAMETER) final String maxRecords) {

	System.out.println(USE_MEMDB_PARAMETER + "=" + useMemoryDB);
	System.out.println(MAX_MEMDB_ROWS_PARAMETER + "=" + maxRecords);
	if ("true".equalsIgnoreCase(useMemoryDB)) {
		System.out
				.println("Scheduling parallel job to load in-memory database.");
		executor.invoke(IMemoryDB.class, new Invokable<IMemoryDB>() {
			@Override
			public IMemoryDB invoke() {
				memoryDb.initialize(FastNumberUtils
						.parseIntWithCheck(maxRecords));
				return memoryDb;
			}
		});
	}
}
 
开发者ID:Sotera,项目名称:graphene-walker,代码行数:22,代码来源:WalkerDAOModule.java

示例2: SubdomainPageLinkTransformer

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
/**
 * Single constructor of this class.
 * 
 * @param tagController a {@link TagController}.
 * @param hostname the hostname used by the server running Eloquentia.
 */
public SubdomainPageLinkTransformer(
		final Request request,
		final TagController tagController,
		final PageActivationContextService pageActivationContextService,
		@Inject @Symbol(SymbolConstants.HOSTNAME) final String hostname) {
	
	assert request != null;
	assert tagController != null;
	assert hostname != null;
	
	this.request = request;
	this.tagController = tagController;
	this.pageActivationContextService = pageActivationContextService;
	this.hostname = hostname.trim();
	this.enabled = this.hostname.length() > 0;
	
}
 
开发者ID:thiagohp,项目名称:eloquentia,代码行数:24,代码来源:SubdomainPageLinkTransformer.java

示例3: SubdomainTagLinkTransformer

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
/**
 * Single constructor of this class.
 * 
 * @param tagController a {@link TagController}.
 * @param hostname the hostname used by the server running Eloquentia.
 */
public SubdomainTagLinkTransformer(
		final Request request,
		final TagController tagController, 
		@Inject @Symbol(SymbolConstants.HOSTNAME) final String hostname) {
	
	assert request != null;
	assert tagController != null;
	assert hostname != null;
	
	this.request = request;
	this.tagController = tagController;
	this.hostname = hostname.trim();
	this.enabled = this.hostname.length() > 0;
	
}
 
开发者ID:thiagohp,项目名称:eloquentia,代码行数:22,代码来源:SubdomainTagLinkTransformer.java

示例4: buildMainDBConnectionPool

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
/**
 * Note that when injecting a String symbol you must also add the @Inject
 * annotation in addition to the @Symbol annotation.
 * 
 * 
 * @param serverUrl
 * @param userName
 * @param userPassword
 * @param logger
 * @param util
 * @return
 */
@Marker(MainDB.class)
public static DBConnectionPoolService buildMainDBConnectionPool(
		@Inject @Symbol(G_SymbolConstants.MIDTIER_SERVER_URL) String serverUrl,
		@Inject @Symbol(G_SymbolConstants.MIDTIER_SERVER_USERNAME) String userName,
		@Inject @Symbol(G_SymbolConstants.MIDTIER_SERVER_PASSWORD) String userPassword,
		final Logger logger, JDBCUtil util) {
	try {
		return new DBConnectionPoolService(logger, util, serverUrl,
				userName, userPassword, true);
	} catch (Exception e) {
		logger.error(e.getMessage());
		return null;
	}
}
 
开发者ID:Sotera,项目名称:graphene-walker,代码行数:27,代码来源:DTOGenerationModule.java

示例5: buildSecondaryConnectionPool

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
/**
 * Builder for a second database, if needed. Note that when injecting a
 * String symbol you must also add the @Inject annotation in addition to the @Symbol
 * annotation.
 * 
 * 
 * @param serverUrl
 * @param userName
 * @param userPassword
 * @param logger
 * @param util
 * @return
 */
@Marker(SecondaryDB.class)
public static DBConnectionPoolService buildSecondaryConnectionPool(
		@Inject @Symbol(G_SymbolConstants.MIDTIER_SERVER_URL) String serverUrl,
		@Inject @Symbol(G_SymbolConstants.MIDTIER_SERVER_USERNAME) String userName,
		@Inject @Symbol(G_SymbolConstants.MIDTIER_SERVER_PASSWORD) String userPassword,
		final Logger logger, JDBCUtil util) {
	try {
		return new DBConnectionPoolService(logger, util, serverUrl,
				userName, userPassword, true);
	} catch (Exception e) {
		logger.error(e.getMessage());
		return null;
	}
}
 
开发者ID:Sotera,项目名称:graphene-walker,代码行数:28,代码来源:DTOGenerationModule.java

示例6: PropertyGraphBuilderWalkerImpl

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
@Inject
public PropertyGraphBuilderWalkerImpl(IdTypeDAO idTypeDAO, EntityRefDAO propertyDAO) {
	super();
	this.idTypeDAO = idTypeDAO;
	this.dao = propertyDAO;
	this.supportedDatasets.add("Walker");
}
 
开发者ID:Sotera,项目名称:graphene-walker,代码行数:8,代码来源:PropertyGraphBuilderWalkerImpl.java

示例7: EventGraphBuilderWalkerImpl

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
@Inject
public EventGraphBuilderWalkerImpl(IdTypeDAO idTypeDAO, TransactionDAO dao,
		EntityRefDAO propertyDAO) {
	super();
	this.idTypeDAO = idTypeDAO;
	this.dao = dao;
	this.propertyDAO = propertyDAO;
	this.supportedDatasets.add("Walker");
	this.supportedDatasets.add("events");
}
 
开发者ID:Sotera,项目名称:graphene-walker,代码行数:11,代码来源:EventGraphBuilderWalkerImpl.java

示例8: SubdomainURLRewriterRule

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
/**
 * Single constructor of this class.
 * @param tagController a {@link TagController}.
 * @param hostname the hostname used by the server running Eloquentia.
 */
public SubdomainURLRewriterRule(
		final TagController tagController, 
		@Inject @Symbol(SymbolConstants.HOSTNAME) final String hostname) {
	assert tagController != null;
	assert hostname != null;
	this.tagController = tagController;
	this.hostname = "." + hostname;
}
 
开发者ID:thiagohp,项目名称:eloquentia,代码行数:14,代码来源:SubdomainURLRewriterRule.java

示例9: NodeBabelCompiler

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
@Inject
public NodeBabelCompiler() throws IOException {
  this(new ClasspathResource(NodeBabelCompiler.class.getClassLoader(),
      "de/eddyson/tapestry/react/services/babel.min.js"));
}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:6,代码来源:NodeBabelCompiler.java

示例10: RhinoBabelCompiler

import org.apache.tapestry5.ioc.annotations.Inject; //导入依赖的package包/类
@Inject
public RhinoBabelCompiler(final OperationTracker tracker) {
  this(tracker, new ClasspathResource(RhinoBabelCompiler.class.getClassLoader(),
      "de/eddyson/tapestry/react/services/babel.min.js"));
}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:6,代码来源:RhinoBabelCompiler.java


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