本文整理汇总了Java中org.jboss.msc.service.StopContext.asynchronous方法的典型用法代码示例。如果您正苦于以下问题:Java StopContext.asynchronous方法的具体用法?Java StopContext.asynchronous怎么用?Java StopContext.asynchronous使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.msc.service.StopContext
的用法示例。
在下文中一共展示了StopContext.asynchronous方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
@Override
public synchronized void stop(final StopContext context) {
if (executorService != null) {
context.asynchronous();
Thread executorShutdown = new Thread(new Runnable() {
@Override
public void run() {
try {
executorService.shutdown();
} finally {
executorService = null;
context.complete();
}
}
}, "ServerExecutorService Shutdown Thread");
executorShutdown.start();
}
}
示例2: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
@Override
public void stop(final StopContext context) {
try {
context.execute(new Runnable() {
@Override
public void run() {
try {
cacheImplementation.clearAll();
cacheImplementation = null;
if (executorService != null) {
// FIXME context.execute() should not be used for blocking tasks. Inject a scheduled executor
// and get rid of this
executorService.shutdown();
executorService = null;
}
} finally {
context.complete();
}
}
});
} finally {
context.asynchronous();
}
}
示例3: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
@Override
public synchronized void stop(final StopContext context) {
Thread executorShutdown = new Thread(new Runnable() {
@Override
public void run() {
try {
executorService.shutdown();
} finally {
executorService = null;
context.complete();
}
}
}, "HostController ExecutorService Shutdown Thread");
executorShutdown.start();
context.asynchronous();
}
示例4: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public synchronized void stop(final StopContext context) {
Runnable r = new Runnable() {
@Override
public void run() {
try {
StreamUtils.safeClose(connection);
responseAttachmentSupport.shutdown();
} finally {
context.complete();
}
}
};
try {
executor.execute(r);
} catch (RejectedExecutionException e) {
r.run();
} finally {
context.asynchronous();
}
}
示例5: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public synchronized void stop(final StopContext context) {
final Runnable task = new Runnable() {
@Override
public void run() {
try {
if (isMasterDomainController && (discoveryOptions != null)) {
for (DiscoveryOption discoveryOption : discoveryOptions) {
discoveryOption.cleanUp();
}
}
} finally {
context.complete();
}
}
};
try {
executorService.getValue().execute(task);
} catch (RejectedExecutionException e) {
task.run();
} finally {
context.asynchronous();
}
}
示例6: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public synchronized void stop(final StopContext stopContext) {
final ExecutorService executorService = executor.getValue();
final Runnable task = new Runnable() {
@Override
public void run() {
try {
responseAttachmentSupport.shutdown();
// Shut down new requests to the client request executor,
// but don't mess with currently running tasks
clientRequestExecutor.shutdown();
} finally {
stopContext.complete();
}
}
};
try {
executorService.execute(task);
} catch (RejectedExecutionException e) {
task.run();
} finally {
stopContext.asynchronous();
}
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:AbstractModelControllerOperationHandlerFactoryService.java
示例7: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
@Override
public synchronized void stop(final StopContext stopContext) {
final ExecutorService executorService = executorInjector.getValue();
final Runnable task = new Runnable() {
@Override
public void run() {
try {
responseAttachmentSupport.shutdown();
} finally {
StreamUtils.safeClose(client);
client = null;
stopContext.complete();
}
}
};
try {
executorService.execute(task);
} catch (RejectedExecutionException e) {
task.run();
} finally {
stopContext.asynchronous();
}
}
示例8: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
public synchronized void stop(final StopContext context) {
try {
context.execute(new Runnable() {
@Override
public void run() {
connectionManagerRegistry.removeLdapConnectionManagerService(name);
context.complete();
}
});
} finally {
context.asynchronous();
}
}
示例9: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
/**
* Stops all servers.
*
* {@inheritDoc}
*/
@Override
public synchronized void stop(final StopContext context) {
final boolean shutdownServers = runningModeControl.getRestartMode() == RestartMode.SERVERS;
if (shutdownServers) {
Runnable task = new Runnable() {
@Override
public void run() {
try {
serverInventory.shutdown(true, -1, true); // TODO graceful shutdown
serverInventory = null;
// client.getValue().setServerInventory(null);
} finally {
serverCallback.getValue().setCallbackHandler(null);
context.complete();
}
}
};
try {
executorService.getValue().execute(task);
} catch (RejectedExecutionException e) {
task.run();
} finally {
context.asynchronous();
}
} else {
// We have to set the shutdown flag in any case
serverInventory.shutdown(false, -1, true);
serverInventory = null;
}
}
示例10: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
@Override
public void stop(StopContext context) {
this.stopContext = context;
context.asynchronous();
worker.shutdown();
worker = null;
}
示例11: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
public void stop(final StopContext context) {
capabilityRegistry.clear();
capabilityRegistry.publish();
ServiceNameFactory.clearCache();
controller = null;
processState.setStopping();
Runnable r = new Runnable() {
@Override
public void run() {
try {
stopAsynchronous(context);
} finally {
try {
authorizer.shutdown();
} finally {
context.complete();
}
}
}
};
final ExecutorService executorService = injectedExecutorService.getOptionalValue();
try {
if (executorService != null) {
try {
executorService.execute(r);
} catch (RejectedExecutionException e) {
r.run();
}
} else {
Thread executorShutdown = new Thread(r, getClass().getSimpleName() + " Shutdown Thread");
executorShutdown.start();
}
} finally {
processState.setStopped();
context.asynchronous();
}
}
示例12: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
@Override
public void stop(final StopContext context) {
Runnable r = new Runnable() {
@Override
public void run() {
try {
VFSUtils.safeClose(tempFileProvider);
} finally {
try {
ScheduledExecutorService ses = scheduledExecutorService;
scheduledExecutorService = null;
if (ses != null) {
ses.shutdown();
}
ServerLogger.ROOT_LOGGER.debugf("%s stopped", DeploymentMountProvider.class.getSimpleName());
} finally {
context.complete();
}
}
}
};
final ExecutorService executorService = injectedExecutorService.getValue();
try {
try {
executorService.execute(r);
} catch (RejectedExecutionException e) {
r.run();
}
} finally {
context.asynchronous();
}
}
示例13: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
public void stop(final StopContext context) {
final ManagedScheduledExecutorService executor;
synchronized (this) {
executor = this.executor;
this.context = context;
this.executor = null;
}
context.asynchronous();
executor.internalShutdown();
}
示例14: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
public void stop(final StopContext context) {
final ManagedQueueExecutorService executor;
synchronized (this) {
executor = this.executor;
this.executor = null;
}
context.asynchronous();
executor.internalShutdown();
executor.addShutdownListener(StopContextEventListener.getInstance(), context);
}
示例15: stop
import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
public void stop(final StopContext context) {
final ManagedJBossThreadPoolExecutorService executor;
synchronized (this) {
executor = this.executor;
this.executor = null;
}
context.asynchronous();
executor.internalShutdown();
executor.addShutdownListener(StopContextEventListener.getInstance(), context);
}