简体   繁体   English

Java EE容器-自我管理的线程?

[英]Java EE container - self managed threads?

Is it possible to start for example a OrientDB Server Instance inside a Java EE server? 是否可以在Java EE服务器中启动例如OrientDB服务器实例?

Is this possible or do i need to use only Servlets or EJB inside the containers? 这可能吗,或者我只需要在容器内使用Servlet或EJB?

Can you give me a quick example on how to do start an application that manages it's own threads please. 您能否给我一个简单的示例,说明如何启动一个管理自己线程的应用程序。

You can start OrientDB in the same JVM, even a Java EE container. 您可以在同一JVM(甚至是Java EE容器)中启动OrientDB。 Look at this guide: http://code.google.com/p/orient/wiki/EmbeddedServer . 查看此指南: http : //code.google.com/p/orient/wiki/EmbeddedServer

You could create a Servlet that simply follow the instructions to start the server. 您可以创建一个仅遵循说明启动服务器的Servlet。

It's possible to start an app in JavaEE. 可以在JavaEE中启动应用程序。 JavaEE server does not force you to not use your own threads. JavaEE服务器不会强迫您不要使用自己的线程。

Here's an exmaple of how to start a embedded (in process) HSQLDB: 这是如何启动嵌入式(正在处理的)HSQLDB的示例:

Connection c = DriverManager.getConnection("jdbc:hsqldb:file:testdb", "sa", "");

Of course you need to run the code the starts in process OrientDB, I don't think that OrientDB can be started this way (in process). 当然,您需要在OrientDB进程中启动代码,我认为OrientDB不能以这种方式(在进程中)启动。 It has to have it's own process. 它必须具有自己的过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM