本文整理汇总了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;
}
示例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);
}
示例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);
}