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


Java CurrentServiceContainer类代码示例

本文整理汇总了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);
        }
    }
 
开发者ID:NovaOrdis,项目名称:playground,代码行数:36,代码来源:AccessServlet.java

示例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;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:11,代码来源:JBossSecurityHelper.java

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

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

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

示例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!");
    }
}
 
开发者ID:red-fox-mulder,项目名称:eap-6.1-quickstarts,代码行数:15,代码来源:ServiceAccessBean.java

示例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!");
    }
}
 
开发者ID:wfink,项目名称:jboss-as-quickstart,代码行数:15,代码来源:ServiceAccessBean.java

示例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;
}
 
开发者ID:lorislab,项目名称:smonitor,代码行数:13,代码来源:JBoss7ConnectorService.java

示例9: getService

import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
    return (SubsystemService) CurrentServiceContainer.getServiceContainer().getService(Neo4jSubsystemService.serviceName()).getValue();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:4,代码来源:Neo4jExtension.java

示例10: getService

import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
    return (SubsystemService) CurrentServiceContainer.getServiceContainer()
            .getService(OrientSubsystemService.SERVICE_NAME).getValue();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:5,代码来源:OrientExtension.java

示例11: getService

import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
    return (SubsystemService) CurrentServiceContainer.getServiceContainer().getService(CassandraSubsystemService.serviceName()).getValue();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:4,代码来源:CassandraExtension.java

示例12: connection

import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
public static NoSQLConnection connection(String id) {
    return (NoSQLConnection) CurrentServiceContainer.getServiceContainer().getRequiredService(SERVICENAME.append(id)).getValue();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:4,代码来源:ConnectionServiceAccess.java

示例13: getService

import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
    return (SubsystemService) CurrentServiceContainer.getServiceContainer().getService(serviceName).getValue();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:4,代码来源:DriverScanDependencyProcessor.java

示例14: getService

import org.jboss.as.server.CurrentServiceContainer; //导入依赖的package包/类
private SubsystemService getService() {
    return (SubsystemService) CurrentServiceContainer.getServiceContainer().getService(MongoSubsystemService.serviceName()).getValue();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:4,代码来源:MongoExtension.java

示例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;
    }
 
开发者ID:NovaOrdis,项目名称:playground,代码行数:17,代码来源:MscUtil.java


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