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


Java CurrentServiceContainer.getServiceContainer方法代码示例

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


在下文中一共展示了CurrentServiceContainer.getServiceContainer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: 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

示例4: 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

示例5: 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.getServiceContainer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。