本文整理汇总了Java中mx4j.tools.adaptor.http.HttpAdaptor.setPort方法的典型用法代码示例。如果您正苦于以下问题:Java HttpAdaptor.setPort方法的具体用法?Java HttpAdaptor.setPort怎么用?Java HttpAdaptor.setPort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mx4j.tools.adaptor.http.HttpAdaptor
的用法示例。
在下文中一共展示了HttpAdaptor.setPort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startHtmlAdapter
import mx4j.tools.adaptor.http.HttpAdaptor; //导入方法依赖的package包/类
public void startHtmlAdapter(int port)
{
try
{
HttpAdaptor adapter = new HttpAdaptor();
ObjectName adapterName = new ObjectName("Gemlite:name=HtmlAdapter,port=" + port);
adapter.setPort(port);
ManagementFactory.getPlatformMBeanServer().registerMBean(adapter, adapterName);
adapter.start();
LogUtil.getCoreLog().info("HtmlAdapter started on port: "+port);
}
catch (Exception e)
{
e.printStackTrace();
}
}
示例2: getMBeanServer
import mx4j.tools.adaptor.http.HttpAdaptor; //导入方法依赖的package包/类
/**
* @param idx Index.
* @return MBean server.
* @throws Exception If failed.
*/
private MBeanServer getMBeanServer(int idx) throws Exception {
HttpAdaptor adaptor = new HttpAdaptor();
MBeanServer srv = MBeanServerFactory.createMBeanServer();
adaptor.setPort(Integer.valueOf(GridTestProperties.getProperty("discovery.mbeanserver.selftest.baseport")) +
idx);
srv.registerMBean(adaptor, new ObjectName(HTTP_ADAPTOR_MBEAN_NAME));
adaptor.start();
httpAdaptors.add(adaptor);
return srv;
}
示例3: getMBeanServer
import mx4j.tools.adaptor.http.HttpAdaptor; //导入方法依赖的package包/类
/**
* @return Configured MBean server.
* @throws Exception If failed.
*/
private MBeanServer getMBeanServer() throws Exception {
HttpAdaptor mbeanAdaptor = new HttpAdaptor();
MBeanServer mbeanSrv = MBeanServerFactory.createMBeanServer();
mbeanAdaptor.setPort(
Integer.valueOf(GridTestProperties.getProperty("comm.mbeanserver.selftest.baseport")));
mbeanSrv.registerMBean(mbeanAdaptor, new ObjectName("mbeanAdaptor:protocol=HTTP"));
mbeanAdaptor.start();
return mbeanSrv;
}