本文整理汇总了Java中org.jboss.msc.service.StopContext类的典型用法代码示例。如果您正苦于以下问题:Java StopContext类的具体用法?Java StopContext怎么用?Java StopContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StopContext类属于org.jboss.msc.service包,在下文中一共展示了StopContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public void stop(StopContext context) {
// Stop socket transport(s)
if (this.socketListener != null) {
this.socketListener.stop();
this.socketListener = null;
}
this.sessionService.stop();
if (this.socketConfig != null) {
if (socketConfig.getProtocol() == WireProtocol.teiid) {
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50039, this.transportName, this.address.getHostName(), String.valueOf(this.address.getPort())));
}
else if (socketConfig.getProtocol() == WireProtocol.pg) {
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50040, this.address.getHostName(), String.valueOf(this.address.getPort())));
}
}
else {
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50041, LocalServerConnection.jndiNameForRuntime(transportName)));
}
}
示例2: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public void stop(StopContext context) {
ServiceController<?> switchSvc = context.getController().getServiceContainer().getService(TeiidServiceNames.vdbSwitchServiceName(vdb.getName(), vdb.getVersion()));
if (switchSvc != null) {
switchSvc.setMode(ServiceController.Mode.REMOVE);
}
// stop object replication
if (this.objectReplicatorInjector.getValue() != null) {
GlobalTableStore gts = vdb.getAttachment(GlobalTableStore.class);
this.objectReplicatorInjector.getValue().stop(gts);
}
getVDBRepository().removeVDB(this.vdb.getName(), this.vdb.getVersion());
getVDBRepository().removeListener(this.vdbListener);
getVDBRepository().removeListener(this.restEasyListener);
final ServiceController<?> controller = context.getController().getServiceContainer().getService(TeiidServiceNames.vdbFinishedServiceName(vdb.getName(), vdb.getVersion()));
if (controller != null) {
controller.setMode(ServiceController.Mode.REMOVE);
}
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50026, this.vdb));
}
示例3: 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();
}
}
示例4: 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();
}
}
示例5: 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();
}
}
}
示例6: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public synchronized void stop(final StopContext context) {
Runnable r = new Runnable() {
@Override
public void run() {
try {
scheduledExecutorService.shutdown();
} finally {
scheduledExecutorService = null;
context.complete();
}
}
};
try {
executorInjector.getValue().execute(r);
} catch (RejectedExecutionException e) {
r.run();
} finally {
context.asynchronous();
}
}
示例7: 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();
}
}
示例8: 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();
}
}
示例9: 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
示例10: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public synchronized void stop(final StopContext context) {
final String deploymentName = context.getController().getName().getSimpleName();
final String managementName = deploymentUnit.getAttachment(Attachments.MANAGEMENT_NAME);
if (deploymentUnit.getParent()==null) {
ServerLogger.DEPLOYMENT_LOGGER.stoppedDeployment(managementName, deploymentName, (int) (context.getElapsedTime() / 1000000L));
} else {
ServerLogger.DEPLOYMENT_LOGGER.stoppedSubDeployment(deploymentName, (int) (context.getElapsedTime() / 1000000L));
}
// Retain any attached builder across restarts
this.phaseBuilder = this.deploymentUnit.getAttachment(Attachments.DEPLOYMENT_UNIT_PHASE_BUILDER);
//clear up all attachments
for (AttachmentKey<?> key : this.getDeploymentUnitAttachmentKeys()) {
deploymentUnit.removeAttachment(key);
}
deploymentUnit = null;
monitor.removeController(context.getController());
monitor = null;
DeploymentResourceSupport.cleanup(resource);
}
示例11: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public void stop(StopContext stopContext) {
try {
neo4jSubsystemServiceInjectedValue.getValue().removeModuleNameFromJndi(configurationBuilder.getJNDIName());
neo4jSubsystemServiceInjectedValue.getValue().removeModuleNameFromProfile(configurationBuilder.getDescription());
neo4jInteraction.driverClose(driver);
driver = null;
} catch (Throwable throwable) {
ROOT_LOGGER.driverFailedToStop(throwable);
}
}
示例12: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public void stop(StopContext stopContext) {
orientSubsystemServiceInjectedValue.getValue().removeModuleNameFromJndi(configuration.getJndiName());
orientSubsystemServiceInjectedValue.getValue().removeModuleNameFromProfile(configuration.getProfileName());
try {
orientInteraction.close(databasePool);
} catch (Throwable throwable) {
ROOT_LOGGER.driverFailedToStop(throwable);
} finally {
databasePool = null;
}
}
示例13: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public void stop(StopContext stopContext) {
try {
cassandraSubsystemServiceInjectedValue.getValue().removeModuleNameFromJndi(configurationBuilder.getJNDIName());
cassandraSubsystemServiceInjectedValue.getValue().removeModuleNameFromProfile(configurationBuilder.getDescription());
if (session != null) {
cassandraInteraction.sessionClose(session);
session = null;
}
cassandraInteraction.clusterClose(cluster);
cluster = null;
} catch (Throwable throwable) {
ROOT_LOGGER.driverFailedToStop(throwable);
}
}
示例14: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public void stop(StopContext stopContext) {
try {
mongoSubsystemServiceInjectedValue.getValue().removeModuleNameFromJndi(configurationBuilder.getJNDIName());
mongoSubsystemServiceInjectedValue.getValue().removeModuleNameFromProfile(configurationBuilder.getDescription());
mongoInteraction.close();
} catch (Throwable throwable) {
ROOT_LOGGER.driverFailedToStop(throwable);
}
client = null;
}
示例15: stop
import org.jboss.msc.service.StopContext; //导入依赖的package包/类
@Override
public void stop(StopContext stopContext) {
this.thread.interrupt();
this.watchers.values().forEach(e -> {
try {
e.stop();
} catch (Exception e1) {
e1.printStackTrace();
}
});
}