本文整理汇总了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;
}
});
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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");
}
示例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");
}
示例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;
}
示例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"));
}
示例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"));
}