本文整理汇总了Java中org.apache.tapestry5.ioc.RegistryBuilder类的典型用法代码示例。如果您正苦于以下问题:Java RegistryBuilder类的具体用法?Java RegistryBuilder怎么用?Java RegistryBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegistryBuilder类属于org.apache.tapestry5.ioc包,在下文中一共展示了RegistryBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setupRegistry
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
public final void setupRegistry()
{
RegistryBuilder builder = new RegistryBuilder();
builder.add(TapestryModule.class);
builder.add(JpaModule.class);
builder.add(TransactionalUnitsModule.class);
builder.add(JpaTestModule.class);
builder.add(concreteJpaProviderTestModuleClass);
registry = builder.build();
// set PageTesterContext, otherwise T5 tries to load classpath assets
ApplicationGlobals globals = registry.getObject(ApplicationGlobals.class, null);
globals.storeContext(new PageTesterContext(""));
registry.performRegistryStartup();
entityManagerManager = registry.getService(EntityManagerManager.class);
topLevelService = registry.getService(TopLevelService.class);
}
开发者ID:satago,项目名称:tapestry-jpa-transactions,代码行数:19,代码来源:JpaTest.java
示例2: contextInitialized
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
RegistryBuilder builder = new RegistryBuilder();
builder.add(TapestryModule.class);
Registry registry = builder.build();
registry.performRegistryStartup();
final Server server = registry.getService(Server.class);
HttpTransportServer httpTransportServer = new HttpTransportServer().ontransport(server);
WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().ontransport(server);
// Installs the server on Atmosphere platform
ServletContext context = event.getServletContext();
Servlet servlet = new AsityAtmosphereServlet().onhttp(httpTransportServer).onwebsocket
(wsTransportServer);
ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName(),
servlet);
reg.setAsyncSupported(true);
reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
reg.addMapping("/cettia");
}
开发者ID:cettia,项目名称:cettia-examples,代码行数:22,代码来源:Bootstrap.java
示例3: contextInitialized
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
RegistryBuilder builder = new RegistryBuilder();
builder.add(TapestryModule.class);
Registry registry = builder.build();
registry.performRegistryStartup();
final Server server = registry.getService(Server.class);
HttpTransportServer httpTransportServer = new HttpTransportServer().transportAction(server);
WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().transportAction(server);
// Installs the server on Atmosphere platform
ServletContext context = event.getServletContext();
Servlet servlet = new VibeAtmosphereServlet().httpAction(httpTransportServer).wsAction(wsTransportServer);
ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), servlet);
reg.setAsyncSupported(true);
reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
reg.addMapping("/vibe");
}
开发者ID:vibe-project,项目名称:vibe-examples,代码行数:20,代码来源:Bootstrap.java
示例4: setupOctaveEngine
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@BeforeClass
public static void setupOctaveEngine() {
RegistryBuilder builder = new RegistryBuilder();
IOCUtilities.addDefaultModules(builder);
builder.add(IterModule.class);
registry = builder.build();
registry.performRegistryStartup();
// Additional user provided informations
// How many states do we have
System.getProperties().put(IterSymbolsNames.PROBLEM_SIZE, "6");
System.getProperties().put(IterSymbolsNames.LB, "0.0, 0.0, 0.0");
System.getProperties().put(IterSymbolsNames.UB, "20.0,20.0,20.0");
System.getProperties().put("at.ac.tuwien.dsg.cloud.configuration",
"./conf/cloud.properties");
}
开发者ID:alessiogambi,项目名称:iter,代码行数:18,代码来源:InferMarkovModelTest.java
示例5: setupOctaveEngine
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@BeforeClass
public static void setupOctaveEngine() {
RegistryBuilder builder = new RegistryBuilder();
// IOCUtilities.addDefaultModules(builder);
builder.add(IterModule.class);
registry = builder.build();
registry.performRegistryStartup();
//
typeCoercer = registry.getService(TypeCoercer.class);
traceGeneratorWebService = registry.getService(SymbolSource.class)
.valueForSymbol(IterSymbolsNames.TRACEGENERATOR_URL);
loadGenerator = new SinusLoadGenerator(
LoggerFactory.getLogger(LoadGenerator.class),
"SinusLoadGenerator", typeCoercer, traceGeneratorWebService,
testFile, manifestFile, 0.0, 30.0, 0.0, 0.01, //
100, // nBins
registry.getService("RandomSinusLoadGenerator",
InputSampler.class), 300);
dataCollectionService = registry
.getService(DataCollectionService.class);
mathEngineDao = registry.getService("matlab", MathEngineDao.class);
}
开发者ID:alessiogambi,项目名称:iter,代码行数:26,代码来源:BasicRunnerTest.java
示例6: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Before
public void setup() {
// TODO Auto-generated constructor stub
RegistryBuilder builder = new RegistryBuilder();
// Load all the modules in the cp
IOCUtilities.addDefaultModules(builder);
// Load all the local modules
builder.add(CLIModule.class);
// Add the test module
// Add the Complex test modul e
builder.add(ComplexConstraintModule.class);
// builder.add(TestModule.class);
// Build the registry
registry = builder.build();
registry.performRegistryStartup();
}
开发者ID:alessiogambi,项目名称:tapestry5-cli,代码行数:18,代码来源:CLIParserTest.java
示例7: getApplications
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
protected SparkApplication[] getApplications(FilterConfig filterConfig) throws ServletException {
// We support 2 modes:
// - Applications configured in web.xml via init-param "applicationClass"
// - Auto-Discovery (with package restrictions via init-param autodiscoverSearchSpec)
List<Class<? extends SparkApplication>> applicationClasses = new ArrayList<>();
List<Class> tapestryModules = new ArrayList<>();
String servletInitParamApplications = filterConfig.getInitParameter(APPLICATION_CLASS_PARAM);
// If we don't find an init-param in the web.xml we try to autodiscover.
// We can restrict the packages searched by an init-param, too.
if (StringUtils.isBlank(servletInitParamApplications)) {
LOG.debug("Autodiscover SparkApplications");
String searchSpec = filterConfig.getInitParameter(AUTODISCOVER_SEARCH_SPEC_PARAM);
autodiscover(applicationClasses, tapestryModules, searchSpec);
}
else {
LOG.debug("Processing Servlet Init Param: {}", servletInitParamApplications);
processInitParam(servletInitParamApplications, applicationClasses, tapestryModules);
}
this.registry =
RegistryBuilder.buildAndStartupRegistry(tapestryModules.stream().toArray(size -> new Class[size]));
for (Class<? extends SparkApplication> application : applicationClasses) {
LOG.debug("Autobuilding: {}", application);
SparkApplication app = this.registry.autobuild(application);
this.applications.add(app);
}
return this.applications.stream().toArray(size -> new SparkApplication[size]);
}
开发者ID:netzgut,项目名称:integral-spark,代码行数:37,代码来源:SparkTapestryFilter.java
示例8: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
/**
* Create a basic registry that knows how to create the connection pools
* defined in the local src/main/resources/database.properties file.
*/
public static void setup() {
RegistryBuilder builder = new RegistryBuilder();
builder.add(DTOGenerationModule.class);
registry = builder.build();
registry.performRegistryStartup();
mainDB = registry.getService(DBConnectionPoolService.class, MainDB.class);
// For Walker, the secondary database is not needed, yet.
// secondaryDB = registry.getService(DBConnectionPoolService.class,
// SecondaryDB.class);
}
开发者ID:Sotera,项目名称:graphene-walker,代码行数:17,代码来源:DTOGeneration.java
示例9: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
public static void setup() {
RegistryBuilder builder = new RegistryBuilder();
builder.add(DTOGenerationModule.class);
registry = builder.build();
registry.performRegistryStartup();
mainDB = registry.getService(DBConnectionPoolService.class,
MainDB.class);
}
开发者ID:Sotera,项目名称:graphene-walker,代码行数:11,代码来源:WalkerIntrospector.java
示例10: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@BeforeClass
public static void setup() {
System.getProperties().put("at.ac.tuwien.dsg.cloud.configuration",
"./conf/cloud.properties");
RegistryBuilder builder = new RegistryBuilder();
IOCUtilities.addDefaultModules(builder);
builder.add(IterModule.class);
registry = builder.build();
registry.performRegistryStartup();
}
开发者ID:alessiogambi,项目名称:iter,代码行数:11,代码来源:TriangleLoadGeneratorTest.java
示例11: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Before
public void setup() {
RegistryBuilder builder = new RegistryBuilder();
// NO ! Load all the modules in the cp
// IOCUtilities.addDefaultModules(builder);
// Load all the local modules
builder.add(IterModule.class);
registry = builder.build();
registry.performRegistryStartup();
}
开发者ID:alessiogambi,项目名称:iter,代码行数:11,代码来源:CLITest.java
示例12: main
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
public static void main(String[] args) {
RegistryBuilder builder = new RegistryBuilder();
IOCUtilities.addDefaultModules(builder);
builder.add(IterModule.class);
Registry registry = builder.build();
TypeCoercer typeCoercer = registry.getService(TypeCoercer.class);
double[] convertToNumberArray = new double[] { 1.0, 2.0, 3.0 };
Number[] numbers = typeCoercer.coerce(convertToNumberArray,
Number[].class);
double[] doubles = typeCoercer.coerce(numbers, double[].class);
}
开发者ID:alessiogambi,项目名称:iter,代码行数:14,代码来源:CoercionTest.java
示例13: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Before
public void setup() {
// SETUP THE ENVIRONMENT: NOTE THAT THIS IS REALLY ANNOYNG !
// NOTE THAT THIS SHOULD BE PASSED VIA COMMAND LINE TOO
System.getProperties().put(
IterSymbolsNames.INPUT_FILE,
(new File("src/test/resources/bootstrap.xml"))
.getAbsolutePath());
// Options are specified via the cloud.properties file:
System.getProperties().put(
CloudSymbolConstants.CONFIGURATION_FILE,
(new File("src/test/resources/cloud.properties"))
.getAbsolutePath());
RegistryBuilder builder = new RegistryBuilder();
IOCUtilities.addDefaultModules(builder);
// Collection<Class> exclusionFilter = new ArrayList<Class>();
// exclusionFilter.add(BeanValidatorModule.class);
// ExtendedIOCUtilities.addDefaultModulesWithExclusion(builder,
// exclusionFilter);
builder.add(IterModule.class);
// Add the testAssertion contributions
builder.add(TestAssertions.class);
registry = builder.build();
registry.performRegistryStartup();
}
开发者ID:alessiogambi,项目名称:iter,代码行数:31,代码来源:BootstrapingTest.java
示例14: setupOctaveEngine
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@BeforeClass
public static void setupOctaveEngine() {
RegistryBuilder builder = new RegistryBuilder();
// IOCUtilities.addDefaultModules(builder);
builder.add(IterModule.class);
registry = builder.build();
}
开发者ID:alessiogambi,项目名称:iter,代码行数:8,代码来源:AddTestExecutionTest.java
示例15: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Before
public void setup() {
// TODO Auto-generated constructor stub
builder = new RegistryBuilder();
// Load all the modules in the cp
IOCUtilities.addDefaultModules(builder);
// Load all the local modules
builder.add(CLIModule.class);
// Add the test module
builder.add(TestModule.class);
}
开发者ID:alessiogambi,项目名称:tapestry5-cli,代码行数:12,代码来源:CLIOptionsTest.java
示例16: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Before
public void setup() {
// TODO Auto-generated constructor stub
builder = new RegistryBuilder();
// Load all the modules in the cp
IOCUtilities.addDefaultModules(builder);
// Load all the local modules
builder.add(CLIModule.class);
// Add the Complex test module
builder.add(ComplexConstraintModule.class);
registry = builder.build();
registry.performRegistryStartup();
}
开发者ID:alessiogambi,项目名称:tapestry5-cli,代码行数:16,代码来源:ComplexConstraintValidatorTest.java
示例17: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Before
public void setup() {
// TODO Auto-generated constructor stub
builder = new RegistryBuilder();
// Load all the modules in the cp
IOCUtilities.addDefaultModules(builder);
// Load all the local modules
builder.add(CLIModule.class);
// Add the test module
builder.add(TestModule.class);
registry = builder.build();
registry.performRegistryStartup();
}
开发者ID:alessiogambi,项目名称:tapestry5-cli,代码行数:16,代码来源:BasicJSR303ValidatorTest.java
示例18: setupValidation
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Before
public void setupValidation() {
// Overwrite default for files
System.getProperties().put(
IterSymbolsNames.TEST_RESULTS_FILE,
(new File("src/test/resources/test-results-test.xml"))
.getAbsolutePath());
System.getProperties().put(
IterSymbolsNames.INPUT_FILE,
(new File("src/test/resources/bootstrap.xml"))
.getAbsolutePath());
// Options are specified via the cloud.properties file:
System.getProperties().put(
CloudSymbolConstants.CONFIGURATION_FILE,
(new File("src/test/resources/cloud.properties"))
.getAbsolutePath());
// Use the development files for doing the test !!
System.getProperties().put(
IterSymbolsNames.ITER_DIR,
(new File("src/main/resources/at/ac/tuwien/iter/octave/"))
.getAbsolutePath());
// Remove the test-result file if any !
File testResultFile = new File(
"src/test/resources/test-results-test.xml");
if (testResultFile.exists()) {
testResultFile.renameTo(new File(String.format(
"src/test/resources/test-results-test.xml.bkp.%f",
Math.random())));
}
// Build the registry
RegistryBuilder builder = new RegistryBuilder();
// TODO Because of the beanvalidaion module we canno just add all the
// modules in the CP.
// If you need that, just download the code from git, create another
// "module" and remove the orginal tapestry-beanvalidator
builder.add(IterModule.class);
registry = builder.build();
registry.performRegistryStartup();
}
开发者ID:alessiogambi,项目名称:iter,代码行数:47,代码来源:JSR303Test.java
示例19: main
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
public static void main(String[] args) throws MalformedURLException {
System.getProperties().put(CloudSymbolConstants.CONFIGURATION_FILE,
"src/test/resources/cloud.properties");
// TODO Auto-generated constructor stub
RegistryBuilder builder = new RegistryBuilder();
// Load all the modules in the cp
IOCUtilities.addDefaultModules(builder);
// Load all the local modules
builder.add(IterModule.class);
Registry registry = builder.build();
registry.performRegistryStartup();
LoadGeneratorSource generatorSource = registry
.getService(LoadGeneratorSource.class);
// Setup
LoadGenerator loadGenerator = new SinusLoadGenerator(
LoggerFactory.getLogger(LoadGenerator.class),
"SinusLoadGenerator",
registry.getService(TypeCoercer.class),
registry.getService(SymbolSource.class).valueForSymbol(
IterSymbolsNames.TRACEGENERATOR_URL),
"http://www.inf.usi.ch/phd/gambi/attachments/autocles/doodle-clients.jmx",
"http://www.inf.usi.ch/phd/gambi/attachments/autocles/doodle-manifest.xml",
0.0, 30.0, 0.0, 0.01, //
100, // nBins
registry.getService("RandomSinusLoadGenerator",
InputSampler.class), 300);
File bootstrapFile = new File(registry.getService(SymbolSource.class)
.valueForSymbol(IterSymbolsNames.INPUT_FILE));
File testResultsFile = new File(registry.getService(SymbolSource.class)
.valueForSymbol(IterSymbolsNames.TEST_RESULTS_FILE));
IterImpl iter = new IterImpl(
// Resources
LoggerFactory.getLogger(IterTest.class),
// User inputs
"ale",
"bbv",
// Experiment setup
1,
1,
// Input-output
testResultsFile,
bootstrapFile,
// Experimental Environment
registry.getService(TypeCoercer.class).coerce(
registry.getService(SymbolSource.class).valueForSymbol(
IterSymbolsNames.JOPERA_URL), URL.class),
// Experiment setup
DEFAULT_TIMEOUT,
true, // Bootstrap
// Other services
loadGenerator, registry.getService(RegistryShutdownHub.class),
registry.getService(TypeCoercer.class),
registry.getService(AssertionService.class),
registry.getService(DataCollectionService.class),
new StopTestSuiteEvolution(), generatorSource);
try {
iter.bootstrap();
} catch (TestExecutionException e) {
e.printStackTrace();
}
;
}
开发者ID:alessiogambi,项目名称:iter,代码行数:70,代码来源:IterTest.java
示例20: setup
import org.apache.tapestry5.ioc.RegistryBuilder; //导入依赖的package包/类
@Before
public void setup() {
System.getProperties().put("log4j.configuration",
"file:/opt/iter/conf/log4j.properties");
RegistryBuilder builder = new RegistryBuilder();
IOCUtilities.addDefaultModules(builder);
builder.add(IterModule.class);
System.getProperties().put(CloudSymbolConstants.CONFIGURATION_FILE,
"src/test/resources/cloud.properties");
System.getProperties().put("arg:n-best-tests", "1");
System.getProperties().put("arg:n-parallel-tests", "1");
System.getProperties().put("arg:n-initial-random-tests", "50");
System.getProperties().put("arg:customer-name", "ale");
System.getProperties().put("arg:service-name", "ale");
System.getProperties()
.put("arg:service-manifest-url",
"http://www.inf.usi.ch/phd/gambi/attachments/autocles/doodle-manifest.xml");
System.getProperties()
.put("arg:jmeter-clients-url",
"http://www.inf.usi.ch/phd/gambi/attachments/autocles/doodle-clients.jmx");
registry = builder.build();
registry.performRegistryStartup();
assertionService = registry.getService(AssertionService.class);
LoadGenerator loadGenerator = registry.getService(
LoadGeneratorSource.class).getLoadGenerator("triangle-lhs");
System.getProperties().put(IterSymbolsNames.LB,
Arrays.toString(loadGenerator.getLowerBounds()));
System.getProperties().put(IterSymbolsNames.UB,
Arrays.toString(loadGenerator.getUpperBounds()));
singleTestResultFile = "src/test/resources/test-result.xml";
allTestResultFile = "src/test/resources/test-results.xml";
}
开发者ID:alessiogambi,项目名称:iter,代码行数:43,代码来源:AssertionServiceTest.java
注:本文中的org.apache.tapestry5.ioc.RegistryBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论