本文整理汇总了Java中org.jboss.as.server.CurrentServiceContainer类的典型用法代码示例。如果您正苦于以下问题:Java CurrentServiceContainer类的具体用法?Java CurrentServiceContainer怎么用?Java CurrentServiceContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CurrentServiceContainer类属于org.jboss.as.server包,在下文中一共展示了CurrentServiceContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGet
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
ServiceContainer sc = CurrentServiceContainer.getServiceContainer();
// for(ServiceName sn: sc.getServiceNames()) {
// log.info("" + sn);
// }
ServiceName sn = ServiceName.of("jboss", "infinispan", "web", "repl");
ServiceController scon = sc.getService(sn);
Cache cache = (Cache)scon.getValue();
log.info("" + cache);
String path = req.getPathInfo();
Object o = null;
if ("/put".equals(path)) {
cache.put("test", "blah");
}
else if ("/get".equals(path)) {
o = cache.get("test");
}
res.setContentType("text/html");
PrintWriter out = res.getWriter();
if (o != null) {
out.println(o);
}
}
示例2: getSecurityDomainContext
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
protected SecurityDomainContext getSecurityDomainContext(String securityDomain) {
if (securityDomain != null && !securityDomain.isEmpty()) {
ServiceName name = ServiceName.JBOSS.append("security", "security-domain", securityDomain); //$NON-NLS-1$ //$NON-NLS-2$
ServiceController<SecurityDomainContext> controller = (ServiceController<SecurityDomainContext>) CurrentServiceContainer.getServiceContainer().getService(name);
if (controller != null) {
return controller.getService().getValue();
}
}
return null;
}
示例3: currentServiceContainer
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private ServiceContainer currentServiceContainer() {
if(System.getSecurityManager() == null) {
return CurrentServiceContainer.getServiceContainer();
}
return AccessController.doPrivileged(new PrivilegedAction<ServiceContainer>() {
@Override
public ServiceContainer run() {
return CurrentServiceContainer.getServiceContainer();
}
});
}
示例4: initialize
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
/**
* Install the MSC service which listens for JMX notifications.
*/
@Override
public void initialize(ExtensionContext context) {
log.info("Initializing " + EXTENSION_NAME);
container = CurrentServiceContainer.getServiceContainer();
if(container.getService(JMXNotificationsService.SERVICE_NAME) == null) {
log.info("Installing " + JMXNotificationsService.SERVICE_NAME);
final ServiceTarget target = container.subTarget();
JMXNotificationsService service = new JMXNotificationsService();
target.addService(JMXNotificationsService.SERVICE_NAME, service)
.install();
}
}
示例5: lookup
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
@Override
public Object lookup(ArquillianResource resource, Annotation... qualifiers) {
return AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
if (initialized.compareAndSet(false, true)) {
ServiceContainer serviceContainer = CurrentServiceContainer.getServiceContainer();
serviceContainerProducer.set(serviceContainer);
}
return serviceContainer.get();
}
});
}
示例6: getNodeNameOfTimerService
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
public String getNodeNameOfTimerService() {
LOGGER.info("Method getNodeNameOfTimerService() is invoke");
ServiceController<?> service = CurrentServiceContainer.getServiceContainer().getService(
HATimerService.SINGLETON_SERVICE_NAME);
// Example how to leverage JBoss Logging to do expensive String concatenation only when needed:
LOGGER.debugf("Service %s", service);
if (service != null) {
return (String) service.getValue();
} else {
throw new IllegalStateException("Service '" + HATimerService.SINGLETON_SERVICE_NAME + "' not found!");
}
}
示例7: getNodeNameOfTimerService
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
public String getNodeNameOfTimerService() {
LOGGER.info("Method getNodeNameOfTimerService() is invoked");
ServiceController<?> service = CurrentServiceContainer.getServiceContainer().getService(
HATimerService.SINGLETON_SERVICE_NAME);
// Example how to leverage JBoss Logging to do expensive String concatenation only when needed:
LOGGER.debugf("Service: %s", service);
if (service != null) {
return (String) service.getValue();
} else {
throw new IllegalStateException("Service '" + HATimerService.SINGLETON_SERVICE_NAME + "' not found!");
}
}
示例8: getWebServer
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private static WebServer getWebServer() {
WebServer result = null;
ServiceName service = ServiceName.JBOSS.append("web");
ServiceContainer container = CurrentServiceContainer.getServiceContainer();
ServiceController<?> controller = container.getService(service);
if (controller == null) {
LOGGER.log(Level.SEVERE, "The service controller is null!");
} else {
result = (WebServer) controller.getService();
}
return result;
}
示例9: getService
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
return (SubsystemService) CurrentServiceContainer.getServiceContainer().getService(Neo4jSubsystemService.serviceName()).getValue();
}
示例10: getService
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
return (SubsystemService) CurrentServiceContainer.getServiceContainer()
.getService(OrientSubsystemService.SERVICE_NAME).getValue();
}
示例11: getService
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
return (SubsystemService) CurrentServiceContainer.getServiceContainer().getService(CassandraSubsystemService.serviceName()).getValue();
}
示例12: connection
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
public static NoSQLConnection connection(String id) {
return (NoSQLConnection) CurrentServiceContainer.getServiceContainer().getRequiredService(SERVICENAME.append(id)).getValue();
}
示例13: getService
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
return (SubsystemService) CurrentServiceContainer.getServiceContainer().getService(serviceName).getValue();
}
示例14: getService
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
return (SubsystemService) CurrentServiceContainer.getServiceContainer().getService(MongoSubsystemService.serviceName()).getValue();
}
示例15: listServiceNames
import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
public static String listServiceNames() {
String s = "";
ServiceContainer sc = CurrentServiceContainer.getServiceContainer();
List<ServiceName> names = sc.getServiceNames();
for(ServiceName n: names) {
log.info(n.toString());
s += n.toString() + "\n";
}
return s;
}