不支持关闭 Eecutor 服务
Eecutor service shutdown is not supported
我正在使用 IBM Websphere 8.5.5 提供的执行器服务
ExecutorService es = (ExecutorService ) new InitialContext().lookup("wm/default")
当我调用 es.shutdown()
方法时,出现错误:
java.lang.IllegalStateException: ASYN0093E: The operation shutdown is not supported.
为什么Websphere不支持关机方式?我不应该调用那个方法吗?
WebSphere Application Server 拒绝 shutdown
方法以符合 Concurrency Utilities for Java EE 规范的以下要求,第 3.1.6 节:生命周期 ,其中指出:
The lifecycle of ManagedExecutorService instances are centrally managed by the application server and cannot be changed by an application.
更明确地说,第 3.1.6.1 节 Java EE 产品供应商要求,其中明确指出:
The lifecycle of a ManagedExecutorService is managed by an application server. All lifecycle operations on the ManagedExecutorService interface will throw a java.lang.IllegalStateException exception. This includes the following methods that are defined in the java.util.concurrent.ExecutorService interface: awaitTermination(), isShutdown(), isTerminated(), shutdown(), and shutdownNow().
似乎存在此要求是为了防止应用程序在使用同一执行程序时相互干扰。
我正在使用 IBM Websphere 8.5.5 提供的执行器服务
ExecutorService es = (ExecutorService ) new InitialContext().lookup("wm/default")
当我调用 es.shutdown()
方法时,出现错误:
java.lang.IllegalStateException: ASYN0093E: The operation shutdown is not supported.
为什么Websphere不支持关机方式?我不应该调用那个方法吗?
WebSphere Application Server 拒绝 shutdown
方法以符合 Concurrency Utilities for Java EE 规范的以下要求,第 3.1.6 节:生命周期 ,其中指出:
The lifecycle of ManagedExecutorService instances are centrally managed by the application server and cannot be changed by an application.
更明确地说,第 3.1.6.1 节 Java EE 产品供应商要求,其中明确指出:
The lifecycle of a ManagedExecutorService is managed by an application server. All lifecycle operations on the ManagedExecutorService interface will throw a java.lang.IllegalStateException exception. This includes the following methods that are defined in the java.util.concurrent.ExecutorService interface: awaitTermination(), isShutdown(), isTerminated(), shutdown(), and shutdownNow().
似乎存在此要求是为了防止应用程序在使用同一执行程序时相互干扰。