@Override public Engine onCreateEngine(EngineOptions pEngineOptions) { Engine engine = newEngine(pEngineOptions); if(scheduleEngineStart){ engine.start(); scheduleEngineStart = !scheduleEngineStart; } return engine; } @Override public synchronized void onResumeGame() { if(mEngine != null) { super.onResumeGame(); scheduleEngineStart = true; } }
import javax.inject.*; public class Car { @Inject public Engine engine; @Inject Car() { System.out.println("Car constructor"); } public void start() { engine.start(); } }
public class Vehicle { private Engine engine; protected Color color = Color.BLACK; public Vehicle() { this.engine = new Engine(); } public final void start() { System.out.println("starting engine..."); engine.start(); System.out.println("engine started"); } public final Color getColor() { return this.color; } } public class Car extends Vehicle { public Car(Color color) { super(); this.color = color; } }
class Vehicle { Engine myEngine = new Engine(); void start() { myEngine.start(); } void stop() { myEngine.stop(); } } class VehicleWithSteering extends Vehicle { Steering mySteering = new Steering(); void start() { mySteering.reset(); myEngine.start(); } void steerLeft() { mySteering.left(); } void steerRight() { mySteering.right(); } }
engine.start();
/** * Add a new Engine to the set of defined Engines. * * @param engine The engine to be added */ public synchronized void addEngine(Engine engine) { if( log.isDebugEnabled() ) log.debug("Adding engine (" + engine.getInfo() + ")"); // Add this Engine to our set of defined Engines Engine results[] = new Engine[engines.length + 1]; for (int i = 0; i < engines.length; i++) results[i] = engines[i]; results[engines.length] = engine; engines = results; // Start this Engine if necessary if (getState().isAvailable()) { try { engine.start(); } catch (LifecycleException e) { log.error("Engine.start", e); } } this.container = engine; }
/** * Add a new Engine to the set of defined Engines. * * @param engine The engine to be added */ public synchronized void addEngine(Engine engine) { if( log.isDebugEnabled() ) log.debug("Adding engine (" + engine.getInfo() + ")"); // Add this Engine to our set of defined Engines Engine results[] = new Engine[engines.length + 1]; for (int i = 0; i < engines.length; i++) results[i] = engines[i]; results[engines.length] = engine; engines = results; // Start this Engine if necessary if (getState().isAvailable()) { try { engine.start(); } catch (LifecycleException e) { log.error("Engine.start", e); } } this.container = engine; }
/** * Add a new Engine to the set of defined Engines. * * @param engine The engine to be added */ public synchronized void addEngine(Engine engine) { if( log.isDebugEnabled() ) log.debug("Adding engine (" + engine.getInfo() + ")"); // Add this Engine to our set of defined Engines Engine results[] = new Engine[engines.length + 1]; for (int i = 0; i < engines.length; i++) results[i] = engines[i]; results[engines.length] = engine; engines = results; // Start this Engine if necessary if (getState().isAvailable()) { try { engine.start(); } catch (LifecycleException e) { log.error("Engine.start", e); } } this.container = engine; }
/** * Start nested components ({@link Connector}s and {@link Engine}s) and * implement the requirements of * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected void startInternal() throws LifecycleException { if( log.isInfoEnabled() ) log.info("Starting tomcat server"); // Validate the setup of our required system properties initDirs(); // Initialize some naming specific properties initNaming(); setState(LifecycleState.STARTING); // Start our defined Engines first for (int i = 0; i < engines.length; i++) { engines[i].start(); } // Start our defined Connectors second for (int i = 0; i < connectors.length; i++) { ((Lifecycle) connectors[i]).start(); } }
/** * Start nested components ({@link Connector}s and {@link Engine}s) and * implement the requirements of * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected void startInternal() throws LifecycleException { if( log.isInfoEnabled() ) log.info("Starting tomcat server"); // Validate the setup of our required system properties initDirs(); // Initialize some naming specific properties initNaming(); setState(LifecycleState.STARTING); // Start our defined Engines first for (int i = 0; i < engines.length; i++) { engines[i].start(); } // Start our defined Connectors second for (int i = 0; i < connectors.length; i++) { ((Lifecycle) connectors[i]).start(); } }
/** * Start nested components ({@link Connector}s and {@link Engine}s) and * implement the requirements of * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected void startInternal() throws LifecycleException { if( log.isInfoEnabled() ) log.info("Starting tomcat server"); // Validate the setup of our required system properties initDirs(); // Initialize some naming specific properties initNaming(); setState(LifecycleState.STARTING); // Start our defined Engines first for (int i = 0; i < engines.length; i++) { engines[i].start(); } // Start our defined Connectors second for (int i = 0; i < connectors.length; i++) { ((Lifecycle) connectors[i]).start(); } }
/** * Add a new Engine to the set of defined Engines. * * @param engine The engine to be added */ public synchronized void addEngine(Engine engine) { if( log.isDebugEnabled() ) log.debug("Adding engine (" + engine.getInfo() + ")"); // Add this Engine to our set of defined Engines Engine results[] = new Engine[engines.length + 1]; for (int i = 0; i < engines.length; i++) results[i] = engines[i]; results[engines.length] = engine; engines = results; // Start this Engine if necessary if (getState().isAvailable()) { try { engine.start(); } catch (LifecycleException e) { log.error("Engine.start", e); } } this.container = engine; }
/** * Add a new Engine to the set of defined Engines. * * @param engine The engine to be added */ public synchronized void addEngine(Engine engine) { if( log.isDebugEnabled() ) log.debug("Adding engine (" + engine.getInfo() + ")"); // Add this Engine to our set of defined Engines Engine results[] = new Engine[engines.length + 1]; for (int i = 0; i < engines.length; i++) results[i] = engines[i]; results[engines.length] = engine; engines = results; // Start this Engine if necessary if (getState().isAvailable()) { try { engine.start(); } catch (LifecycleException e) { log.error("Engine.start", e); } } this.container = engine; }
/** * Start nested components ({@link Connector}s and {@link Engine}s) and * implement the requirements of * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected void startInternal() throws LifecycleException { if( log.isInfoEnabled() ) log.info("Starting tomcat server"); // Validate the setup of our required system properties initDirs(); // Initialize some naming specific properties initNaming(); setState(LifecycleState.STARTING); // Start our defined Engines first for (int i = 0; i < engines.length; i++) { engines[i].start(); } // Start our defined Connectors second for (int i = 0; i < connectors.length; i++) { ((Lifecycle) connectors[i]).start(); } }
/** * Start nested components ({@link Connector}s and {@link Engine}s) and * implement the requirements of * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected void startInternal() throws LifecycleException { if( log.isInfoEnabled() ) log.info("Starting tomcat server"); // Validate the setup of our required system properties initDirs(); // Initialize some naming specific properties initNaming(); setState(LifecycleState.STARTING); // Start our defined Engines first for (int i = 0; i < engines.length; i++) { engines[i].start(); } // Start our defined Connectors second for (int i = 0; i < connectors.length; i++) { ((Lifecycle) connectors[i]).start(); } }
if (this.engine != null) { try { this.engine.start(); } catch (LifecycleException e) { log.warn(sm.getString("standardService.engine.startFailed"), e);
if (this.engine != null) { try { this.engine.start(); } catch (LifecycleException e) { log.warn(sm.getString("standardService.engine.startFailed"), e);