Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/330.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使Spring引导支持基于Java的语言?_Java_Spring_Spring Boot_Jolie - Fatal编程技术网

如何使Spring引导支持基于Java的语言?

如何使Spring引导支持基于Java的语言?,java,spring,spring-boot,jolie,Java,Spring,Spring Boot,Jolie,我正在进行一个研究项目,我的目标是扩展SpringBoot框架,使其能够处理Jolie语言。我的主要问题是如何增强/扩展Spring Boot以支持其他语言-需要创建什么 我想我应该取得类似的成就,但我仍然不确定要想取得成功必须满足哪些条件。我将尝试回答你的问题。让我们从朱莉解释器是用Java编写的这一事实开始。这将使将Jolie插入基于Java的框架成为Spring Boot 我想象你想创建朱莉微服务,并在你的框架内运行它们,在这篇文章中,有一篇很好的Montesi博客文章解释了如何运行它们

我正在进行一个研究项目,我的目标是扩展SpringBoot框架,使其能够处理Jolie语言。我的主要问题是如何增强/扩展Spring Boot以支持其他语言-需要创建什么


我想我应该取得类似的成就,但我仍然不确定要想取得成功必须满足哪些条件。

我将尝试回答你的问题。让我们从朱莉解释器是用Java编写的这一事实开始。这将使将Jolie插入基于Java的框架成为Spring Boot

我想象你想创建朱莉微服务,并在你的框架内运行它们,在这篇文章中,有一篇很好的Montesi博客文章解释了如何运行它们

在帖子中,您可以看到如何在宿主java应用程序中使用JOLIE代码,
类解释器可以在JOLIE.jar中找到
项目的另一小手可以来自
jolie2java
,该工具为消息类型创建java代码

jolie2java --addSource [true] --format [java|gwt] --packageName package_namespace [--targetPort inputPort_to_be_encoded] file.ol 
这里有一个例子

    type op1Request :void{
      .name:string
      .surname:string
    }

    type op1Response :void{
      .registrationNumber:string
    }
    interface TestInterface {
    RequestResponse:
      op1(op1Request)(op1Response)
    }

and this are the resulting java classes



 package org.matiho.springboot;
    import java.util.List;
    import java.util.LinkedList;
    import jolie.runtime.Value;
    import jolie.runtime.ByteArray;

    public class op1Request {
    private String _surname;
    private String _name;

    public op1Request( Value v ){
    if (v.hasChildren("surname")){
    _surname= v.getFirstChild("surname").strValue();
    }
    if (v.hasChildren("name")){
    _name= v.getFirstChild("name").strValue();
    }
    }
    public op1Request(){
    }
    public String getSurname(){
    return _surname;
    }
    public void setSurname( String value ){
    _surname = value;
    }
    public String getName(){
    return _name;
    }
    public void setName( String value ){
    _name = value;
    }
    public Value getValue(){
    Value vReturn = Value.create();
    if((_surname!=null)){
    vReturn.getNewChild("surname").setValue(_surname);
    }
    if((_name!=null)){
    vReturn.getNewChild("name").setValue(_name);
    }
    return vReturn;
    }
    }
响应类

package org.matiho.springboot;
import java.util.List;
import java.util.LinkedList;
import jolie.runtime.Value;
import jolie.runtime.ByteArray;

public class op1Response {
private String _registrationNumber;

public op1Response( Value v ){
if (v.hasChildren("registrationNumber")){
  _registrationNumber= v.getFirstChild("registrationNumber").strValue();
}
}
public op1Response(){
}
public String getRegistrationNumber(){
  return _registrationNumber;
}
public void setRegistrationNumber( String value ){
  _registrationNumber = value;
}
public Value getValue(){
  Value vReturn = Value.create();
  if((_registrationNumber!=null)){
  vReturn.getNewChild("registrationNumber").setValue(_registrationNumber);
  }
return vReturn;
}
}
在将Jolie导入框架时,我可以看到您在库的兼容性方面遇到了一些问题 希望能有所帮助
附言:你能加上朱莉这个标签吗