hierynomus / smbj

Server Message Block (SMB2, SMB3) implementation in Java
Other
720 stars 179 forks source link

EE7 Environment #158

Closed gidravlic closed 7 years ago

gidravlic commented 7 years ago

Hello! Any body use smbj in subject? I found in sources that smbj use AsynchronousChannelGroup, ExecutorService, Thread.

By EJB specification:

The enterprise bean must not attempt to manage threads. The enterprise bean must not attempt to >start, stop, suspend, or resume a thread, or to change a thread’s priority or name. The enterprise bean >must not attempt to manage thread groups.

hierynomus commented 7 years ago

@gidravlic Where it says "must not" you should read "should not". The whole point is is that you yourself do not start doing async things, the EJB is already doing that. However depending on connectivity libraries is not forbidden, and mostly all of those will spawn one or more threads for doing their I/O. So yes, it is perfectly legal to use SMBJ in a JEE7 application.

(Also note that this requirement in the spec, has been present since EJB1.0 as far as I remember)

gidravlic commented 7 years ago

Hi @hierynomus ! No, it's spec for EJB 3.2 page 423. At all i'm currently monitor smbj work good in EE7 environment (Payara server 4.2) My research, why it is not recommended - in EE environment we must use ManagedExecutorService for execute new thread. And it's related, as far as I understood, with cluster work. In my test environment i can't check smbj work right now.(I don't have cluster :) ) Generally, if nobody interested this issue, it can be closed.

hierynomus commented 7 years ago

In a cluster I don't think you should have a thread on a differnet machine handle your IO ;) I'm closing this as I really think we're doing nothing that prevents SMBJ from being used in a JEE container.