本文整理汇总了Java中org.apache.openejb.server.ServiceManager类的典型用法代码示例。如果您正苦于以下问题:Java ServiceManager类的具体用法?Java ServiceManager怎么用?Java ServiceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServiceManager类属于org.apache.openejb.server包,在下文中一共展示了ServiceManager类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startNetworkServices
import org.apache.openejb.server.ServiceManager; //导入依赖的package包/类
@PostConstruct
public void startNetworkServices() throws Exception {
if (ServiceManager.get() != null) {
return;
}
getLog().info("Starting network services");
manager = ServiceManager.getManager();
manager.init();
manager.start(false);
}
示例2: init
import org.apache.openejb.server.ServiceManager; //导入依赖的package包/类
@Override
public void init(final Properties props) throws Exception {
if (props == null) {
return;
}
virtualHost = props.getProperty("virtualHost", "localhost");
auth = props.getProperty("auth", "NONE");
realm = props.getProperty("realm", "PropertiesLogin");
enabled = ServiceManager.isEnabled(props);
}
示例3: checkZipIsOn
import org.apache.openejb.server.ServiceManager; //导入依赖的package包/类
@Test
public void checkZipIsOn() throws Exception {
int checked = 0;
for (final ServerService daemon : SimpleServiceManager.class.cast(ServiceManager.get()).getDaemons()) {
if (ServiceDaemon.class.isInstance(daemon) && daemon.getName().equals("ejbd")) {
assertTrue(EjbDaemon.class.cast(Reflections.get(Reflections.get(Reflections.get(Reflections.get(Reflections.get(Reflections.get(Reflections.get(daemon, "next"),
"service"), "service"), "service"),
"service"), "service"), "server")).isGzip());
checked++;
}
}
assertEquals(1, checked);
}
示例4: test
import org.apache.openejb.server.ServiceManager; //导入依赖的package包/类
@Test
public void test() throws Exception {
System.setProperty("openejb.jmx.active", "true");
final MBeanServer server = LocalMBeanServer.get();
OpenEJB.init(new Properties());
final Properties p = new Properties();
p.put("server", "org.apache.openejb.server.ejbd.EjbServer");
p.put("bind", "127.0.0.1");
p.put("port", "0");
p.put("disabled", "false");
p.put("threads", "10");
p.put("backlog", "200");
p.put("discovery", "ejb:ejbd://{bind}:{port}");
final ServerService service = ServiceManager.manage("ejbd", p, new EjbServer());
service.init(p);
service.start();
ServiceManager.register("ejbd", service, server);
ObjectName invocationsName = new ObjectName("openejb:type=ServerService,name=ejbd");
MBeanInfo beanInfo = server.getMBeanInfo(invocationsName);
for (MBeanAttributeInfo info : beanInfo.getAttributes()) {
System.out.println(info);
}
service.stop();
OpenEJB.destroy();
}
示例5: start
import org.apache.openejb.server.ServiceManager; //导入依赖的package包/类
public void start(final BundleContext bundleContext) throws Exception {
manager = new ServiceManagerExtender(bundleContext);
registration = bundleContext.registerService(ServiceManager.class.getName(), manager, null);
}