devxlogo

Specifying Dependencies

Specifying Dependencies

When writing Java-based services we occasionally require dependencies. That is, our services must start in a certain order. You can specify what services your code is dependent on by overriding the getServiceDependencies method in your service class. For example, to create a service that is dependent on RPC being started, override the method as follows.

     protected Object getServiceDependencies() {     String dependsOn = "RPCSS 00 00";     return dependsOn ;    } 

Note that the dependencies string is a list of double null terminated strings. So, to create a dependency on two services specify the dependsOnstring as “Service1 00Service2 00 00”

devx-admin

Share the Post: