当前位置: 首页>>代码示例>>Java>>正文


Java StopContext.complete方法代码示例

本文整理汇总了Java中org.jboss.msc.service.StopContext.complete方法的典型用法代码示例。如果您正苦于以下问题:Java StopContext.complete方法的具体用法?Java StopContext.complete怎么用?Java StopContext.complete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.msc.service.StopContext的用法示例。


在下文中一共展示了StopContext.complete方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
    }
}
 
开发者ID:jbosschina,项目名称:wildfly-dev-cookbook,代码行数:20,代码来源:ServerExecutorService.java

示例2: stop

import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
@Override
public void stop(final StopContext context) {
    if (!blockStart) {
        try {
            synchronized (waitObject) {
                log.info("BlockService blocking in stop");
                waitObject.wait(blockTime);
            }
            context.complete();
        } catch (InterruptedException e) {
            log.info("BlockService interrupted");
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
    } else {
        synchronized (waitObject) {
            log.info("BlockService Stopping");
            waitObject.notifyAll();
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:BlockerExtension.java

示例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();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:HostControllerService.java

示例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();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:RemoteDomainConnectionService.java

示例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();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:DiscoveryService.java

示例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();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:HostControllerConnectionService.java

示例8: 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;
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:36,代码来源:ServerInventoryService.java

示例9: 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();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:38,代码来源:AbstractControllerService.java

示例10: 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();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:33,代码来源:DeploymentMountProvider.java

示例11: terminated

import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
protected void terminated() {
    super.terminated();
    StopContext context;
    synchronized (ScheduledThreadPoolService.this) {
        context = ScheduledThreadPoolService.this.context;
        ScheduledThreadPoolService.this.context = null;
    }
    context.complete();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:10,代码来源:ScheduledThreadPoolService.java

示例12: stop

import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
/**
 * The stop is asynchronous and will wait until the current transition / suspendTransition ends before effectively stopping.
 * This will force the executorService to be Value
 * @param context the stop context.
 */
@Override
public void stop(StopContext context) {
    Runnable asyncStop = () -> {
        synchronized (stopLock) {
            controlledProcessStateService.getValue().removePropertyChangeListener(propertyChangeListener);
            SuspendController controller = suspendControllerInjectedValue.getOptionalValue();
            if (controller != null) {
                controller.removeListener(operationListener);
            }
            runningState = null;
            try {
                listener.cleanup();
            } catch (RuntimeException t) {
                CoreManagementLogger.ROOT_LOGGER.processStateCleanupError(t, name);
            } finally {
                context.complete();
            }
        }
    };
    final ExecutorService executorService = executorServiceValue.getValue();
    try {
        try {
            executorService.execute(asyncStop);
        } catch (RejectedExecutionException e) {
            asyncStop.run();
        }
    } finally {
        context.asynchronous();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:36,代码来源:ProcessStateListenerService.java

示例13: handleEvent

import org.jboss.msc.service.StopContext; //导入方法依赖的package包/类
public void handleEvent(final StopContext stopContext) {
    stopContext.complete();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:4,代码来源:StopContextEventListener.java


注:本文中的org.jboss.msc.service.StopContext.complete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。