本文整理汇总了Java中org.jboss.msc.service.ServiceContainer.getRequiredService方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceContainer.getRequiredService方法的具体用法?Java ServiceContainer.getRequiredService怎么用?Java ServiceContainer.getRequiredService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.msc.service.ServiceContainer
的用法示例。
在下文中一共展示了ServiceContainer.getRequiredService方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lookupSecurityRealm
import org.jboss.msc.service.ServiceContainer; //导入方法依赖的package包/类
@Before
public void lookupSecurityRealm() {
ServiceContainer container = getContainer();
ServiceController<?> service = container.getRequiredService(SecurityRealm.ServiceUtil.createServiceName(TEST_REALM));
securityRealm = (SecurityRealm) service.getValue();
}
示例2: getAuthorizingCallbackHandler
import org.jboss.msc.service.ServiceContainer; //导入方法依赖的package包/类
private AuthorizingCallbackHandler getAuthorizingCallbackHandler(final String realmName) {
SecurityRealm realm;
if (TEST_REALM.equals(realmName)) {
realm = securityRealm;
} else {
ServiceContainer container = getContainer();
ServiceController<?> service = container.getRequiredService(SecurityRealm.ServiceUtil.createServiceName(realmName));
realm = (SecurityRealm) service.getValue();
}
return realm.getAuthorizingCallbackHandler(AuthMechanism.PLAIN);
}
示例3: startup
import org.jboss.msc.service.ServiceContainer; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public AsyncFuture<ServiceContainer> startup(Configuration configuration, List<ServiceActivator> extraServices) {
try {
ServiceContainer container = bootstrap(configuration, extraServices).get();
ServiceController<?> controller = container.getRequiredService(Services.JBOSS_AS);
return (AsyncFuture<ServiceContainer>) controller.getValue();
} catch (Exception ex) {
shutdownHook.shutdown(true);
throw ServerLogger.ROOT_LOGGER.cannotStartServer(ex);
}
}
示例4: getRequiredService
import org.jboss.msc.service.ServiceContainer; //导入方法依赖的package包/类
static <T> T getRequiredService(final ServiceContainer container, final ServiceName serviceName, Class<T> type) {
final ServiceController<?> controller = container.getRequiredService(serviceName);
return type.cast(controller.getValue());
}
示例5: getDeploymentService
import org.jboss.msc.service.ServiceContainer; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private ProcessApplicationDeploymentService getDeploymentService(StartContext context, ServiceName deploymentServiceName) {
final ServiceContainer serviceContainer = context.getController().getServiceContainer();
ServiceController<ProcessApplicationDeploymentService> deploymentService = (ServiceController<ProcessApplicationDeploymentService>) serviceContainer.getRequiredService(deploymentServiceName);
return deploymentService.getValue();
}