是否可以先启动myapp-1,myapp-2然后休眠 30 秒,然后再启动myapp-3?
尝试过这个docker-compose.yml但没有运气。
version: '3'
services:
myapp-1:
container_name: myapp-1
image: myapp:latest
restart: always
myapp-2:
container_name: myapp-2
image: myapp:latest
restart: always
test-sleep:
image: busybox
command: ["/bin/sleep", "30"]
depends_on:
- "myapp-1"
- "myapp-2"
myapp-3:
container_name: myapp-3
image: myapp:latest
restart: always
depends_on:
- "test-sleep"
Run Code Online (Sandbox Code Playgroud) 我有一个简单的课程
public class Pet {
private String petName;
private int petAge;
public Pet() {
}
public Pet(String petName, int petAge) {
this.petName = petName;
this.petAge = petAge;
}
}
Run Code Online (Sandbox Code Playgroud)
当我试图找到参数时,我得到两个零.我仍然无法找出原因.有什么建议吗?
Constructor[] constructors = Pet.class.getDeclaredConstructors();
for (Constructor c : constructors) {
System.out.println(c.getTypeParameters().length);
}
Run Code Online (Sandbox Code Playgroud)