protected void serviceInit(Configuration conf) throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": initing services, size=" + services.size()); } for (Service service : services) { service.init(conf); } super.serviceInit(conf); }
protected void serviceStart() throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": starting services, size=" + services.size()); } for (Service service : services) { // start the service. If this fails that service // will be stopped and an exception raised service.start(); } super.serviceStart(); }
List<Service> services = getServices(); for (int i = numOfServicesStarted - 1; i >= 0; i--) { Service service = services.get(i);
protected void serviceInit(Configuration conf) throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": initing services, size=" + services.size()); } for (Service service : services) { service.init(conf); } super.serviceInit(conf); }
protected void serviceInit(Configuration conf) throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": initing services, size=" + services.size()); } for (Service service : services) { service.init(conf); } super.serviceInit(conf); }
protected void serviceStart() throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": starting services, size=" + services.size()); } for (Service service : services) { // start the service. If this fails that service // will be stopped and an exception raised service.start(); } super.serviceStart(); }
protected void serviceInit(Configuration conf) throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": initing services, size=" + services.size()); } for (Service service : services) { service.init(conf); } super.serviceInit(conf); }
protected void serviceStart() throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": starting services, size=" + services.size()); } for (Service service : services) { // start the service. If this fails that service // will be stopped and an exception raised service.start(); } super.serviceStart(); }
protected void serviceStart() throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": starting services, size=" + services.size()); } for (Service service : services) { // start the service. If this fails that service // will be stopped and an exception raised service.start(); } super.serviceStart(); }
protected void serviceStart() throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": starting services, size=" + services.size()); } for (Service service : services) { // start the service. If this fails that service // will be stopped and an exception raised service.start(); } super.serviceStart(); }
protected void serviceInit(Configuration conf) throws Exception { List<Service> services = getServices(); if (LOG.isDebugEnabled()) { LOG.debug(getName() + ": initing services, size=" + services.size()); } for (Service service : services) { service.init(conf); } super.serviceInit(conf); }
@Test(timeout = 1000) public void testAddInitedSiblingInInit() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); sibling.init(new Configuration()); parent.addService(new AddSiblingService(parent, sibling, STATE.INITED)); parent.init(new Configuration()); parent.start(); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); }
@Test(timeout = 1000) public void testAddInitedSiblingInInit() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); sibling.init(new Configuration()); parent.addService(new AddSiblingService(parent, sibling, STATE.INITED)); parent.init(new Configuration()); parent.start(); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); }
@Test(timeout = 1000) public void testAddStartedSiblingInStop() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); sibling.init(new Configuration()); sibling.start(); parent.addService(new AddSiblingService(parent, sibling, STATE.STOPPED)); parent.init(new Configuration()); parent.start(); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); }
@Test(timeout = 1000) public void testAddStartedSiblingInStop() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); sibling.init(new Configuration()); sibling.start(); parent.addService(new AddSiblingService(parent, sibling, STATE.STOPPED)); parent.init(new Configuration()); parent.start(); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); }
@Test(timeout = 1000) public void testAddStartedSiblingInStart() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); sibling.init(new Configuration()); sibling.start(); parent.addService(new AddSiblingService(parent, sibling, STATE.STARTED)); parent.init(new Configuration()); parent.start(); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); }
@Test(timeout = 1000) public void testAddStartedSiblingInStart() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); sibling.init(new Configuration()); sibling.start(); parent.addService(new AddSiblingService(parent, sibling, STATE.STARTED)); parent.init(new Configuration()); parent.start(); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); }
@Test(timeout = 1000) public void testAddUninitedSiblingInStart() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); parent.addService(new AddSiblingService(parent, sibling, STATE.STARTED)); parent.init(new Configuration()); assertInState(STATE.NOTINITED, sibling); parent.start(); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); }
@Test(timeout = 1000) public void testAddUninitedSiblingInStart() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); parent.addService(new AddSiblingService(parent, sibling, STATE.STARTED)); parent.init(new Configuration()); assertInState(STATE.NOTINITED, sibling); parent.start(); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); }
@Test(timeout = 1000) public void testAddStartedSiblingInInit() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); sibling.init(new Configuration()); sibling.start(); parent.addService(new AddSiblingService(parent, sibling, STATE.INITED)); parent.init(new Configuration()); assertInState(STATE.STARTED, sibling); parent.start(); assertInState(STATE.STARTED, sibling); parent.stop(); assertEquals("Incorrect number of services", 2, parent.getServices().size()); assertInState(STATE.STOPPED, sibling); }