1 package org.sapia.soto.examples; 2 3 import org.sapia.soto.Service; 4 5 6 14 public class SecondaryService implements Service { 15 private MasterService _svc; 16 17 20 public SecondaryService() { 21 super(); 22 } 23 24 public void setSomeService(MasterService svc) { 25 _svc = svc; 26 } 27 28 public MasterService getSomeService() { 29 return _svc; 30 } 31 32 public boolean hasMaster() { 33 return _svc != null; 34 } 35 36 39 public void init() throws Exception { 40 System.out.println("initializing " + getClass()); 41 } 42 43 46 public void start() throws Exception { 47 System.out.println("starting " + getClass()); 48 } 49 50 53 public void dispose() { 54 } 55 56 public void doSomethingElse() { 57 System.out.println("Calling master service..."); 58 _svc.doSomething(); 59 } 60 } 61 | Popular Tags |