@1-14x0r So we have a Custom ServerLoader to override ports. Here is the link to it: https://gist.github.com/ajay-gov/408ab8fbc252419f8a481f2231ecf677. The line that changes the port is here : https://gist.github.com/ajay-gov/408ab8fbc252419f8a481f2231ecf677#file-myserverloader-L109-L113. This assumes that the property name passed into the java class is 'port'
So give this new ServerLoader you have to do the following:
run {
dependsOn jar
systemProperties System.getProperties()
doFirst {
jvmArgs += [
'--module-path', files(configurations.runtimeClasspath, jar.archivePath).asPath,
'--module', "${moduleName}/${mainClassName}"
]
classpath = files()
}
}
java -Xmx 128M...
for Location1 and java -Xmx 2G...
for Location 2
/myagent/:id
for a type MyAgent, invoking /myagent/1 will create a new instance of the MyAgent type. So when you say "start on run", I am assuming that you want to start a particular instance of the web agent. You can do so by sending a command
to that Web Agent. Here is an example: https://github.com/swimos/cookbook/blob/master/web_agents/src/main/java/swim/basic/BasicPlane.java#L38
Plane
in the main
method. Currently this is the only way to do it. In our next release you will be able to instantiate new Web Agents with know URIs by adding it in the recon file where you define the plane