本文整理汇总了Java中org.apache.tapestry5.ioc.OrderedConfiguration.add方法的典型用法代码示例。如果您正苦于以下问题:Java OrderedConfiguration.add方法的具体用法?Java OrderedConfiguration.add怎么用?Java OrderedConfiguration.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tapestry5.ioc.OrderedConfiguration
的用法示例。
在下文中一共展示了OrderedConfiguration.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: warmMinifiedJavascriptCache
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
@Contribute(Runnable.class)
public static void warmMinifiedJavascriptCache(
final MinificationCacheWarming minificationCacheWarming,
@Symbol(MinificationCacheWarmingSymbols.ENABLE_MINIFICATION_CACHE_WARMING) final boolean minificationCacheWarmingEnabled,
final OrderedConfiguration<Runnable> configuration) {
if (minificationCacheWarmingEnabled) {
configuration.add("MinificationCacheWarming", new Runnable() {
@Override
public void run() {
try {
minificationCacheWarming.warmMinificationCache();
} catch (Exception e) {
throw new RuntimeException("Error warming minification cache", e);
}
startupComplete = true;
}
});
}
}
开发者ID:eddyson-de,项目名称:tapestry-minification-cache-warming,代码行数:22,代码来源:MinificationCacheWarmingModule.java
示例2: prepareHTMLPageOnRender
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
@Contribute(MarkupRenderer.class)
public static void prepareHTMLPageOnRender(final OrderedConfiguration<MarkupRendererFilter> configuration,
final RequestGlobals requestGlobals, final PageRenderLinkSource pageRenderLinkSource) {
configuration.add("AddPageName", new MarkupRendererFilter() {
@Override
public void renderMarkup(final MarkupWriter writer, final MarkupRenderer renderer) {
renderer.renderMarkup(writer);
Element html = writer.getDocument().find("html");
if (html != null) {
Link link = pageRenderLinkSource.createPageRenderLinkWithContext(requestGlobals.getActivePageName());
for (String parameterName : link.getParameterNames()) {
link = link.removeParameter(parameterName);
}
String url = link.toURI();
html.attributes("data-page-base-url", url);
}
}
});
}
示例3: addDataCollectors
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
@Contribute(DataCollectionService.class)
public static void addDataCollectors(
OrderedConfiguration<DataCollectionService> configuration,
Logger logger, DatabaseManagerService databaseManagerService) {
// We do not care about order constraints for the moment
// USE AUTOBUILD - Note that Now the collector with all its' own logger
// and not the DataCollectionService one
configuration.addInstance("state-transitions",
TransitionSequenceCollector.class);
configuration.add("controller-results", new ControllerResultsCollector(
logger, databaseManagerService));
configuration.add("service-results", new ServiceResultsCollector(
logger, databaseManagerService));
configuration.add("clients-results", new ClientsResultsCollector(
logger, databaseManagerService));
}
示例4: contributeRequestHandler
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
/**
* This is a contribution to the RequestHandler service configuration. This
* is how we extend Tapestry using the timing filter. A common use for this
* kind of filter is transaction management or security. The @Local
* annotation selects the desired service by type, but only from the same
* module. Without @Local, there would be an error due to the other
* service(s) that implement RequestFilter (defined in other modules).
*/
public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration, @Local RequestFilter filter) {
// Each contribution to an ordered configuration has a name, When
// necessary, you may
// set constraints to precisely control the invocation order of the
// contributed filter
// within the pipeline.
configuration.add("Timing", filter);
}
示例5: contributeHibernateSessionSource
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
public void contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer> configurer) {
String path = globals.getServletContext().getInitParameter(AppConstants.IPNLEDGERPATH);
// WARNING: This is here for the benefit of developers so they can switch
// ledgers without having to use the StandaloneServer. WAR deployments
// should be configured through the web.xml file and not a system property.
// System properties apply to the whole servlet container, making it
// impossible to serve multiple ledgers at once.
path = System.getProperty("app.ledger", path);
File dbdir = new File(System.getProperty("user.dir"));
if (path != null) {
dbdir = new File(path);
}
configurer.add("hibernate-session-source", new LedgerConfigurer(dbdir));
}
示例6: contributeRequestHandler
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
/**
* Use to allow PageTester to run with spring and spring-security.
*
* @param config
* @param requestGlobals
*/
public static void contributeRequestHandler(OrderedConfiguration<RequestFilter> config,
final RequestGlobals requestGlobals) {
RequestFilter filter = new RequestFilter() {
public boolean service(Request request, Response response, RequestHandler handler)
throws IOException {
requestGlobals.storeServletRequestResponse(
new MockHttpServletRequest(),
new MockHttpServletResponse());
return handler.service(request, response);
}
};
config.add("SpringMockHttpRequestAndResponse", filter, "after:CheckForUpdates","before:URLRewriter");
}
示例7: contributePropertiesFileAsSymbols
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
@Contribute(SymbolSource.class)
public void contributePropertiesFileAsSymbols(
OrderedConfiguration<SymbolProvider> configuration) {
configuration.add("DatabaseConfiguration",
new ClasspathResourceSymbolProvider("database.properties"),
"after:SystemProperties", "before:ApplicationDefaults");
}
示例8: contributeRequestHandler
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
/**
* This is a contribution to the RequestHandler service configuration. This is how we extend
* Tapestry using the timing filter. A common use for this kind of filter is transaction
* management or security. The @Local annotation selects the desired service by type, but only
* from the same module. Without @Local, there would be an error due to the other service(s)
* that implement RequestFilter (defined in other modules).
*/
public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration,
@Local
RequestFilter filter)
{
// Each contribution to an ordered configuration has a name, When necessary, you may
// set constraints to precisely control the invocation order of the contributed filter
// within the pipeline.
configuration.add("Timing", filter);
}
示例9: contributeRequestHandler
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
/**
* This is a contribution to the RequestHandler service configuration. This is how we extend
* Tapestry using the timing filter. A common use for this kind of filter is transaction
* management or security. The @Local annotation selects the desired service by type, but only
* from the same module. Without @Local, there would be an error due to the other service(s)
* that implement RequestFilter (defined in other modules).
*/
public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration,
@Local
RequestFilter filter)
{
// Each contribution to an ordered configuration has a name, When necessary, you may
// set constraints to precisely control the invocation order of the contributed filter
// within the pipeline.
configuration.add("Timing", filter);
}
示例10: addAssertions
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
@Contribute(AssertionService.class)
public static void addAssertions(
OrderedConfiguration<AssertionService> configuration,
Logger logger, MathEngineDao dao, DatabaseManagerService dbService) {
// Assertions over the Clients Requests ! Note that those require the
// output being a valid JMeter XML !
configuration.add("NoFailedRequests", new FailedRequestAssertion(
logger, dbService));
// QoS Related - thresholds can be read as well by file. TODO
// NOTE THAT THIS IS SPECIFIC OF THE APPLICATION, SO WE MUST DEAL WITH
// THIS IN A DIFFERENT WAY IN THE FUTURE
double avgCreatePollMillis = 2000.0;
double avgDeletePollMillis = 1500.0;
double avgGetAllPollsMillis = 2000.0;
double avgGetPollMillis = 500.0;
double avgVotePollMillis = 1000.0;
// THE ORDER HERE IS IMPORTATN !!!
double[] thresholds = new double[] { avgCreatePollMillis,
avgDeletePollMillis, avgGetAllPollsMillis, avgGetPollMillis,
avgVotePollMillis };
configuration.add("AvgRT",
new DoodleWebServiceAvgResponseTimeAssertion(logger, dbService,
thresholds));
}
示例11: contributeMarkupRenderer
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
@Contribute(MarkupRenderer.class)
public void contributeMarkupRenderer(OrderedConfiguration<MarkupRendererFilter> configuration,
@Symbol(value = NEW_RELIC_DISABLED) boolean disabled) {
if(!disabled ) {
MarkupRendererFilter realUserMonitorMarkupHeaderRenderFilter = new RealUserMonitorMarkupRenderFilter(true);
configuration.add("realUserMonitorMarkupHeaderRenderFilter", realUserMonitorMarkupHeaderRenderFilter, "after:*");
MarkupRendererFilter realUserMonitorMarkupFooterRenderFilter = new RealUserMonitorMarkupRenderFilter(false);
configuration.add("realUserMonitorMarkupFooterRenderFilter", realUserMonitorMarkupFooterRenderFilter, "after:realUserMonitorMarkupHeaderRenderFilter");
}
}
示例12: contributeMasterObjectProvider
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
public void contributeMasterObjectProvider(
@InjectService(InjectorModuleDef.INJECTOR_SERVICE_ID) Injector injector,
OrderedConfiguration configuration) {
configuration.add("guiceProvider", new GuiceObjectProvider(injector), "after:Service,Alias,Autobuild");
}
示例13: contributeRequestHandler
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration,
@InjectService("TimingFilter") final RequestFilter timingFilter,
@InjectService("Utf8Filter") final RequestFilter utf8Filter) {
configuration.add("Timing", timingFilter);
configuration.add("Utf8Filter", utf8Filter);
}
示例14: contributeSymbolSource
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
public static void contributeSymbolSource(
OrderedConfiguration<SymbolProvider> configuration,
@InjectService("ColorsSymbolProvider") SymbolProvider c) {
configuration.add("ColorsPropertiesFile", c, "after:SystemProperties",
"before:ApplicationDefaults");
}
示例15: addAssertions
import org.apache.tapestry5.ioc.OrderedConfiguration; //导入方法依赖的package包/类
@Contribute(AssertionService.class)
public static void addAssertions(
OrderedConfiguration<AssertionService> configuration,
Logger logger, MathEngineDao dao, DatabaseManagerService dbService) {
// We do not care about order constraints for the moment
configuration.add("Plasticity", new PlasticityAssertion(logger, dao));
configuration.add("Inelasticity",
new InelasticityAssertion(logger, dao));
// Assertions over the Clients Requests ! Note that those require the
// output being a valid JMeter XML !
configuration.add("NoFailedRequests", new FailedRequestAssertion(
logger, dbService));
// Absolute Values
configuration.add("Max10RequestsFailed",
new AbsoluteFailedRequestAssertion(logger, dbService, 10));
configuration.add("Max100RequestsFailed",
new AbsoluteFailedRequestAssertion(logger, dbService, 10));
// Relative Values
configuration
.add("Max1PercRequestsFailed",
new RelativeFailedRequestAssertion(logger, dbService,
1 / 100.0));
configuration
.add("Max5PercRequestsFailed",
new RelativeFailedRequestAssertion(logger, dbService,
5 / 100.0));
configuration.add("Max10PercRequestsFailed",
new RelativeFailedRequestAssertion(logger, dbService,
10 / 100.0));
// QoS Related - thresholds can be read as well by file. TODO
// NOTE THAT THIS IS SPECIFIC OF THE APPLICATION, SO WE MUST DEAL WITH
// THIS IN A DIFFERENT WAY IN THE FUTURE
double avgCreatePollMillis = 2000.0;
double avgDeletePollMillis = 1500.0;
double avgGetAllPollsMillis = 2000.0;
double avgGetPollMillis = 500.0;
double avgVotePollMillis = 1000.0;
// THE ORDER HERE IS IMPORTATN !!!
double[] thresholds = new double[] { avgCreatePollMillis,
avgDeletePollMillis, avgGetAllPollsMillis, avgGetPollMillis,
avgVotePollMillis };
configuration.add("AvgRT",
new DoodleWebServiceAvgResponseTimeAssertion(logger, dbService,
thresholds));
}