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


Java LookupLocator.getPort方法代码示例

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


在下文中一共展示了LookupLocator.getPort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addOne

import net.jini.core.discovery.LookupLocator; //导入方法依赖的package包/类
private void addOne(ServiceRegistrar registrar) {
    LookupLocator loc;
    try {
        loc = registrar.getLocator();
    } catch (Throwable t) {
        logger.log(Level.INFO, "obtaining locator failed", t);
        return;
    }
    String host = loc.getHost();
    if (loc.getPort() != Constants.discoveryPort) {
        host += ":" + loc.getPort();
    }
    JRadioButtonMenuItem reg =
            new RegistrarMenuItem(host, registrar.getServiceID());
    reg.addActionListener(wrap(new Lookup(registrar)));
    if (!(registrars.getMenuComponent(0) instanceof JRadioButtonMenuItem)) {
        registrars.removeAll();
    }
    registrars.add(reg);
}
 
开发者ID:apache,项目名称:river-container,代码行数:21,代码来源:Browser.java

示例2: ServiceNode

import net.jini.core.discovery.LookupLocator; //导入方法依赖的package包/类
ServiceNode(ServiceItem item){
	
	try{
		
		_serviceItem=item;
		_atts=item.attributeSets;
		if(_serviceItem.service instanceof ServiceRegistrar){
			ServiceRegistrar reggie=(ServiceRegistrar)_serviceItem.service;
			LookupLocator ll=reggie.getLocator();
			_strValue=ll.getHost()+":"+ll.getPort();
		}else{
			setName();
			//_serviceItem.service.toString();
		}
	}catch(Exception ex){
		ex.printStackTrace();
		_strValue=_serviceItem.service.toString();
	}
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:20,代码来源:ServiceNode.java

示例3: addServicesToGlyph

import net.jini.core.discovery.LookupLocator; //导入方法依赖的package包/类
private String addServicesToGlyph(Glyph lus,
		DefaultMutableTreeNode selectedNode, String label) {
	// add the services
	int n = selectedNode.getChildCount();
	// _logger.info("+++ Number of glyphs "+lus.getText()+" = "+n);
	for (int i = 0; i < n; i++) {
		DefaultMutableTreeNode kid = (DefaultMutableTreeNode) selectedNode
				.getChildAt(i);
		Object userObject = kid.getUserObject();
		if (userObject instanceof ServiceNode) {

			ServiceNode kidObject = (ServiceNode) userObject;
			Object proxy = kidObject.getServiceItem().service;
			label = TreeRenderer.getJiniName(proxy, kidObject.toString());
			if (proxy instanceof ServiceRegistrar) {
				try {
					ServiceRegistrar reggie = (ServiceRegistrar) proxy;
					LookupLocator loc = reggie.getLocator();
					label += " " + loc.getHost() + ":" + loc.getPort();
				} catch (Exception ex) {
					_logger.info("" + ex);
				}

			} else {
				// REMOVED for 2.3
				// int delim=label.lastIndexOf(".");
				// if(delim!=-1){
				// label=label.substring(delim+1);
				// }
			}

			// _logger.info("+++ adding glyph "+label);
			Glyph g1 = new Glyph(label,/*
										 * TreeRenderer._serviceGlyphIcon.getImage
										 * ()
										 */
			null);
			// modified v4.5 [ix-02]
			g1.setUserObject(kidObject);// .getServiceItem());
			lus.addChild(g1);
		}
	}
	return label;
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:45,代码来源:ServiceBrowserUI.java


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