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


Java SocketBinding.getAbsolutePort方法代码示例

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


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

示例1: getAddress

import org.jboss.as.network.SocketBinding; //导入方法依赖的package包/类
/**
 * Return the address.
 * 
 * @return An address string
 */
public String getAddress() {
    String schema = "http";
    String hostAddress = "127.0.0.1";
    int port = 8080;

    ListenerService listener = ServerUtil.getDefaultListener();
    if (listener != null) {
        if (listener instanceof HttpsListenerService) {
            schema = "https";
        } else if (listener instanceof HttpListenerService) {
            schema = "http";
        } else {
            ExtensionLogger.ROOT_LOGGER.defaultListenerIsNotHttpListener(listener.getClass().getName());
            schema = "http";
        }

        InjectedValue<SocketBinding> inject = listener.getBinding();
        if (inject != null) {
            SocketBinding binding = inject.getValue();
            InetAddress address = binding.getAddress();
            hostAddress = address.getHostAddress();
            port = binding.getAbsolutePort();
        }else {
            Set<String> aliases = ServerUtil.getDefaultHostAliases();
            if (aliases != null && !aliases.isEmpty()) {
                hostAddress = aliases.iterator().next();
            }
            ExtensionLogger.ROOT_LOGGER.noSocketBindingDefinitionFound(hostAddress, Integer.toString(port));
        }
    } else {
        ExtensionLogger.ROOT_LOGGER.noDefaultListenerDefined(schema, hostAddress, Integer.toString(port));
    }

    return schema + "://" + hostAddress + ":" + port + "/" + _contextName;
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:41,代码来源:RemoteEndpointListener.java

示例2: advertise

import org.jboss.as.network.SocketBinding; //导入方法依赖的package包/类
public synchronized void advertise(String name, SocketBinding binding, String... tags) {
    Registration registration = new Registration(sourceKey(this.node), name, binding.getAddress().getHostAddress(), binding.getAbsolutePort(), tags);

    this.registrations.put(name + ":" + binding.getName(), registration);
    advertise(registration);
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology-jgroups,代码行数:7,代码来源:JGroupsTopologyConnector.java

示例3: advertise

import org.jboss.as.network.SocketBinding; //导入方法依赖的package包/类
@Override
public void advertise(String name, SocketBinding binding, String... tags) {
    Registration registration = new Registration("consul", name, binding.getAddress().getHostAddress(), binding.getAbsolutePort(), tags);
    getAdvertiser().advertise(registration);
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology-consul,代码行数:6,代码来源:ConsulTopologyConnector.java

示例4: advertise

import org.jboss.as.network.SocketBinding; //导入方法依赖的package包/类
public synchronized void advertise(String name, SocketBinding binding, String... tags) throws Exception {
    Registration registration = new Registration(sourceKey(this.node), name, binding.getAddress().getHostAddress(), binding.getAbsolutePort(), tags);

    this.registrations.put(name + ":" + binding.getName(), registration);
    advertise(registration);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:7,代码来源:JGroupsTopologyConnector.java

示例5: advertise

import org.jboss.as.network.SocketBinding; //导入方法依赖的package包/类
@Override
public void advertise(String name, SocketBinding binding, String...tags) {
    Registration registration = new Registration("consul", name, binding.getAddress().getHostAddress(), binding.getAbsolutePort(), tags );
    this.advertiser.advertise(registration);
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:6,代码来源:ConsulTopologyConnector.java


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