本文整理汇总了Java中org.apache.tapestry5.ioc.RegistryBuilder类的典型用法代码示例。如果您正苦于以下问题:Java RegistryBuilder类的具体用法?Java RegistryBuilder怎么用?Java RegistryBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegistryBuilder类属于org.apache.tapestry5.ioc包,在下文中一共展示了RegistryBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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");
}
示例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");
}
示例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");
}
示例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);
}
示例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();
}
示例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]);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}