com.alibaba.dubbo.common.Version.getVersion()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中com.alibaba.dubbo.common.Version.getVersion()方法的一些代码示例,展示了Version.getVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getVersion()方法的具体详情如下:
包路径:com.alibaba.dubbo.common.Version
类名称:Version
方法名:getVersion

Version.getVersion介绍

暂无

代码示例

代码示例来源:origin: alibaba/dubbo-spring-boot-starter

private String buildBannerText() {
  StringBuilder bannerTextBuilder = new StringBuilder();
  bannerTextBuilder.append(DubboSpringBootStarterConstants.LINE_SEPARATOR).append(DubboLogo.dubbo)
    .append(" :: Dubbo ::        (v").append(Version.getVersion()).append(")")
    .append(DubboSpringBootStarterConstants.LINE_SEPARATOR);
  return bannerTextBuilder.toString();
 }
}

代码示例来源:origin: apache/incubator-dubbo-spring-boot-project

@ReadOperation
public Map<String, Object> invoke() {
  Map<String, Object> metaData = new LinkedHashMap<>();
  metaData.put("timestamp", System.currentTimeMillis());
  Map<String, String> versions = new LinkedHashMap<>();
  versions.put("dubbo-spring-boot", Version.getVersion(DubboUtils.class, "1.0.0"));
  versions.put("dubbo", Version.getVersion());
  Map<String, String> urls = new LinkedHashMap<>();
  urls.put("dubbo", DUBBO_GITHUB_URL);
  urls.put("mailing-list", DUBBO_MAILING_LIST);
  urls.put("github", DUBBO_SPRING_BOOT_GITHUB_URL);
  urls.put("issues", DUBBO_SPRING_BOOT_ISSUES_URL);
  urls.put("git", DUBBO_SPRING_BOOT_GIT_URL);
  metaData.put("versions", versions);
  metaData.put("urls", urls);
  return metaData;
}

代码示例来源:origin: apache/incubator-dubbo-spring-boot-project

String buildBannerText() {
  StringBuilder bannerTextBuilder = new StringBuilder();
  bannerTextBuilder
      .append(LINE_SEPARATOR)
      .append(LINE_SEPARATOR)
      .append(" :: Dubbo Spring Boot (v").append(Version.getVersion(getClass(), "1.0.0")).append(") : ")
      .append(DUBBO_SPRING_BOOT_GITHUB_URL)
      .append(LINE_SEPARATOR)
      .append(" :: Dubbo (v").append(Version.getVersion()).append(") : ")
      .append(DUBBO_GITHUB_URL)
      .append(LINE_SEPARATOR)
      .append(" :: Discuss group : ")
      .append(DUBBO_MAILING_LIST)
      .append(LINE_SEPARATOR)
  ;
  return bannerTextBuilder.toString();
}

代码示例来源:origin: stackoverflow.com

public void incrementVersion() {
   Version lastUpdate = (Version) em.createQuery("SELECT max (c.version) FROM X c")          .setMaxResults(1).getResultList();
   int ver = lastUpdate.getVersion() + 1;
   lastUpdate.setVersion(ver);
   em.persist(lastUpdate);
 }

代码示例来源:origin: com.alibaba/dubbo-common

private String appendContextMessage(String msg) {
  return " [DUBBO] " + msg + ", dubbo version: " + Version.getVersion() + ", current host: " + NetUtils.getLocalHost();
}

代码示例来源:origin: com.alibaba/dubbo

protected void checkWhetherDestroyed() {
  if (destroyed.get()) {
    throw new RpcException("Rpc cluster invoker for " + getInterface() + " on consumer " + NetUtils.getLocalHost()
        + " use dubbo version " + Version.getVersion()
        + " is now destroyed! Can not invoke any more.");
  }
}

代码示例来源:origin: com.alibaba/dubbo-cluster

protected void checkWhetherDestroyed() {
  if (destroyed.get()) {
    throw new RpcException("Rpc cluster invoker for " + getInterface() + " on consumer " + NetUtils.getLocalHost()
        + " use dubbo version " + Version.getVersion()
        + " is now destroyed! Can not invoke any more.");
  }
}

代码示例来源:origin: net.jahhan/dubbo-cluster

protected void checkWheatherDestoyed() {
  if (destroyed.get()) {
    throw new JahhanException("Rpc cluster invoker for " + getInterface() + " on consumer "
        + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion()
        + " is now destroyed! Can not invoke any more.");
  }
}

代码示例来源:origin: hutai123/dubbox

protected void checkWhetherDestroyed() {
  if(destroyed){
    throw new RpcException("Rpc cluster invoker for " + getInterface() + " on consumer " + NetUtils.getLocalHost()
        + " use dubbo version " + Version.getVersion()
        + " is now destroyed! Can not invoke any more.");
  }
}

代码示例来源:origin: hutai123/dubbox

protected void checkWhetherDestroyed() {
  if(destroyed){
    throw new RpcException("Rpc cluster invoker for " + getInterface() + " on consumer " + NetUtils.getLocalHost()
        + " use dubbo version " + Version.getVersion()
        + " is now destroyed! Can not invoke any more.");
  }
}

代码示例来源:origin: net.jahhan/dubbo-cluster

public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws JahhanException {
    checkInvokers(invokers, invocation);
    Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
    try {
      return invoker.invoke(invocation);
    } catch (Throwable e) {
      if (e instanceof JahhanException && ((JahhanException)e).isBiz()) { // biz exception.
        throw (JahhanException) e;
      }
      throw new JahhanException(e instanceof JahhanException ? ((JahhanException)e).getCode() : 0, "Failfast invoke providers " + invoker.getUrl() + " " + loadbalance.getClass().getSimpleName() + " select from all providers " + invokers + " for service " + getInterface().getName() + " method " + invocation.getMethodName() + " on consumer " + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion() + ", but no luck to perform the invocation. Last error is: " + e.getMessage(), e.getCause() != null ? e.getCause() : e);
    }
  }
}

代码示例来源:origin: linux-china/dubbo3

public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
    checkInvokers(invokers, invocation);
    Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
    try {
      return invoker.invoke(invocation);
    } catch (Throwable e) {
      if (e instanceof RpcException && ((RpcException)e).isBiz()) { // biz exception.
        throw (RpcException) e;
      }
      throw new RpcException(e instanceof RpcException ? ((RpcException)e).getCode() : 0, "Failfast invoke providers " + invoker.getUrl() + " " + loadbalance.getClass().getSimpleName() + " select from all providers " + invokers + " for service " + getInterface().getName() + " method " + invocation.getMethodName() + " on consumer " + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion() + ", but no luck to perform the invocation. Last error is: " + e.getMessage(), e.getCause() != null ? e.getCause() : e);
    }
  }
}

代码示例来源:origin: linux-china/dubbo3

public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
    checkInvokers(invokers, invocation);
    Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
    try {
      return invoker.invoke(invocation);
    } catch (Throwable e) {
      if (e instanceof RpcException && ((RpcException)e).isBiz()) { // biz exception.
        throw (RpcException) e;
      }
      throw new RpcException(e instanceof RpcException ? ((RpcException)e).getCode() : 0, "Failfast invoke providers " + invoker.getUrl() + " " + loadbalance.getClass().getSimpleName() + " select from all providers " + invokers + " for service " + getInterface().getName() + " method " + invocation.getMethodName() + " on consumer " + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion() + ", but no luck to perform the invocation. Last error is: " + e.getMessage(), e.getCause() != null ? e.getCause() : e);
    }
  }
}

代码示例来源:origin: hutai123/dubbox

protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation) {
  if (invokers == null || invokers.size() == 0) {
    throw new RpcException("Failed to invoke the method "
        + invocation.getMethodName() + " in the service " + getInterface().getName() 
        + ". No provider available for the service " + directory.getUrl().getServiceKey()
        + " from registry " + directory.getUrl().getAddress() 
        + " on the consumer " + NetUtils.getLocalHost()
        + " using the dubbo version " + Version.getVersion()
        + ". Please check if the providers have been started and registered.");
  }
}

代码示例来源:origin: net.jahhan/dubbo-cluster

protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation) {
  if (invokers == null || invokers.size() == 0) {
    throw new JahhanException("Failed to invoke the method " + invocation.getMethodName()
        + " in the service " + getInterface().getName() + ". No provider available for the service "
        + directory.getUrl().getServiceKey() + " from registry " + directory.getUrl().getAddress()
        + " on the consumer " + NetUtils.getLocalHost() + " using the dubbo version " + Version.getVersion()
        + ". Please check if the providers have been started and registered.");
  }
}

代码示例来源:origin: com.alibaba/dubbo

protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation) {
  if (invokers == null || invokers.isEmpty()) {
    throw new RpcException("Failed to invoke the method "
        + invocation.getMethodName() + " in the service " + getInterface().getName()
        + ". No provider available for the service " + directory.getUrl().getServiceKey()
        + " from registry " + directory.getUrl().getAddress()
        + " on the consumer " + NetUtils.getLocalHost()
        + " using the dubbo version " + Version.getVersion()
        + ". Please check if the providers have been started and registered.");
  }
}

代码示例来源:origin: hutai123/dubbox

protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation) {
  if (invokers == null || invokers.size() == 0) {
    throw new RpcException("Failed to invoke the method "
        + invocation.getMethodName() + " in the service " + getInterface().getName() 
        + ". No provider available for the service " + directory.getUrl().getServiceKey()
        + " from registry " + directory.getUrl().getAddress() 
        + " on the consumer " + NetUtils.getLocalHost()
        + " using the dubbo version " + Version.getVersion()
        + ". Please check if the providers have been started and registered.");
  }
}

代码示例来源:origin: com.alibaba/dubbo-cluster

protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation) {
  if (invokers == null || invokers.isEmpty()) {
    throw new RpcException("Failed to invoke the method "
        + invocation.getMethodName() + " in the service " + getInterface().getName()
        + ". No provider available for the service " + directory.getUrl().getServiceKey()
        + " from registry " + directory.getUrl().getAddress()
        + " on the consumer " + NetUtils.getLocalHost()
        + " using the dubbo version " + Version.getVersion()
        + ". Please check if the providers have been started and registered.");
  }
}

代码示例来源:origin: linux-china/dubbo3

private void sendChannelReadOnlyEvent(){
  Request request = new Request();
  request.setEvent(Request.READONLY_EVENT);
  request.setTwoWay(false);
  request.setVersion(Version.getVersion());
  
  Collection<Channel> channels = getChannels();
  for (Channel channel : channels) {
    try {
      if (channel.isConnected())channel.send(request, getUrl().getParameter(Constants.CHANNEL_READONLYEVENT_SENT_KEY, true));
    } catch (RemotingException e) {
      logger.warn("send connot write messge error.", e);
    }
  }
}

代码示例来源:origin: linux-china/dubbo3

private void sendChannelReadOnlyEvent(){
  Request request = new Request();
  request.setEvent(Request.READONLY_EVENT);
  request.setTwoWay(false);
  request.setVersion(Version.getVersion());
  
  Collection<Channel> channels = getChannels();
  for (Channel channel : channels) {
    try {
      if (channel.isConnected())channel.send(request, getUrl().getParameter(Constants.CHANNEL_READONLYEVENT_SENT_KEY, true));
    } catch (RemotingException e) {
      logger.warn("send connot write messge error.", e);
    }
  }
}

相关文章