Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Java
Expertise: Advanced
Mar 15, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

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\000\000";
     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\000Service2\000\000"
Manoj K.
Thanks for your registration, follow us on our social networks to keep up-to-date