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


Java OrderedConfiguration.add方法代码示例

本文整理汇总了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);
      }
    }
  });
}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:22,代码来源:ReactModule.java

示例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));
}
 
开发者ID:alessiogambi,项目名称:iter,代码行数:22,代码来源:DataCollectionModule.java

示例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);
}
 
开发者ID:beargiles,项目名称:project-student,代码行数:18,代码来源:AppModule.java

示例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));
	}
 
开发者ID:onyxbits,项目名称:TradeTrax,代码行数:16,代码来源:AppModule.java

示例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");
}
 
开发者ID:dlwhitehurst,项目名称:musicrecital,代码行数:21,代码来源:AppTestModule.java

示例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");
}
 
开发者ID:Sotera,项目名称:graphene-walker,代码行数:8,代码来源:DTOGenerationModule.java

示例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);
}
 
开发者ID:wso2as-developer,项目名称:tapestry-samples,代码行数:18,代码来源:AppModule.java

示例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);
}
 
开发者ID:wso2as-developer,项目名称:tapestry-samples,代码行数:18,代码来源:AppModule.java

示例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));

}
 
开发者ID:alessiogambi,项目名称:iter,代码行数:28,代码来源:TestAssertions.java

示例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");
	}

   }
 
开发者ID:joostschouten,项目名称:newrelic4tapestry5,代码行数:14,代码来源:NewRelic4Tapestry5AppModule.java

示例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");
}
 
开发者ID:bootique,项目名称:bootique-tapestry,代码行数:7,代码来源:GuiceTapestryModule.java

示例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);
}
 
开发者ID:Zabrimus,项目名称:vdr-jonglisto,代码行数:7,代码来源:AppModule.java

示例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");
}
 
开发者ID:Sotera,项目名称:graphene-walker,代码行数:7,代码来源:AppModule.java

示例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));

}
 
开发者ID:alessiogambi,项目名称:iter,代码行数:52,代码来源:Assertions.java


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