The method to use when all the dependencies are resolved.
<p>
It means iPojo guarantees that both the manager and the HTTP
service are not null.
</p>

@throws Exception
351464
public void start() throws Exception {

		// Is the DM part of the distribution?
		boolean found = false;
		for( Bundle b : this.bundleContext.getBundles()) {
			if( "net.roboconf.dm".equals( b.getSymbolicName())) {
				found = true;
				break;
			}
		}

		// If we are on an agent, we have nothing to do.
		// Otherwise, we must register a servlet.
		if( found ) {
			this.logger.fine( "iPojo registers a servlet for HTTP messaging." );

			Hashtable<String,String> initParams = new Hashtable<String,String> ();
			initParams.put( "servlet-name", "Roboconf DM (HTTP messaging)" );

			DmWebSocketServlet messagingServlet = new DmWebSocketServlet( this );
			this.httpService.registerServlet( HttpConstants.DM_SOCKET_PATH, messagingServlet, initParams, null );

		} else {
			this.logger.warning( "Roboconf's DM bundle was not found. No servlet will be registered." );
		}
	}
166348
@Override
  protected void run() throws Exception {
    final ResourceLoader resourceLoader = new MojoResourceLoader(getRuntimeRealm(), getScriptpath());
    final Map<String, Object> context = createContext();
    final Map<String, Object> options = Maps.newHashMap();
    final ConsoleWindow console = getRuntime().createConsoleWindow();

    WindowHandle handle = console.open(getRuntimeRealm(), resourceLoader, context, options);
    handle.await();
  }
1213340
protected static void throwMojoExecutionException(Object mojo, String message, Exception cause) throws Exception {
        Class<?> clz = mojo.getClass().getClassLoader().loadClass(MavenNames.MOJO_EXECUTION_EXCEPTION_BIN);
        Constructor<?> con = clz.getConstructor(String.class, Exception.class);
        Exception ex = (Exception) con.newInstance(message, cause);
        throw ex;
    }
26407
@Override
	public void onStart() throws Exception {
		try {
			startResourceManagerServices();
		} catch (Exception e) {
			final ResourceManagerException exception = new ResourceManagerException(String.format("Could not start the ResourceManager %s", getAddress()), e);
			onFatalError(exception);
			throw exception;
		}
	}
1363541
synchronized void onComplete(@javax.annotation.Nullable Throwable error) {
    if (isCompleted()) {
      return;
    }
    currentConfigObserver = null;
    // TODO(songya): add Runnable
    Status status;
    if (error == null) {
      status = Status.OK;
    } else if (error instanceof StatusRuntimeException) {
      status = ((StatusRuntimeException) error).getStatus();
    } else {
      status = Status.UNKNOWN;
    }
    terminateStatus = status;
  }
1340133
public void init() throws ServletException {
        _application = ((ManagedPlatform)ServicePlatform.getService(ManagedPlatform.INSTANCE).first).getName();

/*
        ApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
        if (wac.containsBean("persistence")) { // persistence may not be there if persistent storage is not required
            _persistence = (Persistence)wac.getBean("persistence");
        }
*/
    }
1244932
@Override
    protected void doExecute() throws Exception {
        final CommandHandler commandHandler = new CommandHandlerImpl(this.getLog());

        checkStageDirectoryExistence();

        checkRuntimeExistence(commandHandler);

        runFunctions(commandHandler);
    }
355281
@Override
  public final synchronized void init() throws Exception {
    FactoryBldAccServices<ResultSet> factoryBldAccServices =
      new FactoryBldAccServices<ResultSet>();
    factoryBldAccServices.setFactoryAppBeans(this);
    setFactoryBldServices(factoryBldAccServices);
    FactoryAccServices<ResultSet> factoryAccServices =
      new FactoryAccServices<ResultSet>();
    factoryAccServices.setFactoryAppBeans(this);
    factoryAccServices.setFactoryBldAccServices(factoryBldAccServices);
    factoryBldAccServices.setFactoryAccServices(factoryAccServices);
    setFactoryOverBeans(factoryAccServices);
    FactoryAccReplicatorXmlHttps<ResultSet> factoryReplicatorXmlHttps =
      new FactoryAccReplicatorXmlHttps<ResultSet>();
    factoryReplicatorXmlHttps.setFactoryAppBeans(this);
    setFactoryReplicatorXmlHttps(factoryReplicatorXmlHttps);
    FactoryAccDatabaseWriterXml<ResultSet> factoryDatabaseWriterXml =
      new FactoryAccDatabaseWriterXml<ResultSet>();
    factoryDatabaseWriterXml.setFactoryAppBeans(this);
    setFactoryDatabaseWriterXml(factoryDatabaseWriterXml);
  }
513961
public synchronized void register() throws Exception {
        if (mbeanName != null) {
            throw new Exception("Agent already registered");
        }
        mbeanName = new ObjectName(getClass().getPackage().getName() + ":type=" + getClass().getSimpleName());
        logger.info("Registering JMX agent " + mbeanName);
        ManagementFactory.getPlatformMBeanServer().registerMBean(this, mbeanName);
        logger.info("JMX agent " + mbeanName + " registered");
    }
333289
@Override
  public final synchronized void init() throws Exception {
    FactoryBldServices<ResultSet> factoryBldServices =
      new FactoryBldServices<ResultSet>();
    factoryBldServices.setFactoryAppBeans(this);
    setFactoryBldServices(factoryBldServices);
    FactoryReplicatorXmlHttps<ResultSet> factoryReplicatorXmlHttps =
      new FactoryReplicatorXmlHttps<ResultSet>();
    factoryReplicatorXmlHttps.setFactoryAppBeans(this);
    setFactoryReplicatorXmlHttps(factoryReplicatorXmlHttps);
    FactoryDatabaseWriterXml<ResultSet> factoryDatabaseWriterXml =
      new FactoryDatabaseWriterXml<ResultSet>();
    factoryDatabaseWriterXml.setFactoryAppBeans(this);
    setFactoryDatabaseWriterXml(factoryDatabaseWriterXml);
  }
183310
@Requires({
    "sourceDependencyLoader != null",
    "type != null"
  })
  @Ensures({
    "importNames != null",
    "rootLineNumberIterator != null"
  })
  @SuppressWarnings("unchecked")
  protected void fetchSourceDependency() throws IOException {
    String fileName = type.getName().getBinaryName()
        + JavaUtils.SOURCE_DEPENDENCY_EXTENSION;
    InputStream in =
        sourceDependencyLoader.getResourceAsStream(fileName);
    if (in == null) {
      throw new FileNotFoundException();
    }
    ObjectInputStream oin = new ObjectInputStream(in);
    try {
      importNames = (Set<String>) oin.readObject();
      rootLineNumberIterator = ((List<Long>) oin.readObject()).iterator();
    } catch (ClassNotFoundException e) {
      throw new IOException(e);
    }
    oin.close();
  }
106627
public void start() throws Exception{
		if(cleanupDirectory){
			CleanUp.start(conf);
		}
		IDatabaseDev db = (IDatabaseDev) em.getDB();//TODO make sure DB platform can be used for development
		ModelDefinitionProvider provider = new ModelDefinitionProvider(db, conf.dbUser, null, conf.includeSchema);
		ModelDef[] origModelList = provider.getTableDefinitions();
		
		new ModelMetaDataGenerator().start(origModelList, conf);
		//TODO: proper support for explicit ModelDefinitions
		ModelDef[] withExplecitList = overrideModelDefFromExplicit(origModelList, explicitMeta);
		ModelDef[] modelList = correctModelList(withExplecitList);
		
		new DAOClassGenerator().start(modelList, conf, true, false);
		new BeanGenerator().start(modelList, conf);
		new MapperGenerator().start(modelList, conf);

		ModelDef[] modelListOwned = setModelOwners(modelList, tableGroups);
		ModelDef[] modelListChilded = setDirectChildren(modelListOwned);

		new ColumnNameGenerator().start(modelListChilded, conf);
		new TableNameGenerator().start(modelListChilded, conf);
		new SchemaTableGenerator().start(modelListChilded, conf);
		new TableColumnGenerator().start(modelListChilded, conf);
		//new ModelMetaDataGenerator().start(modelListChilded, conf);
		
		new DAOInstanceFactoryGenerator().start(modelListChilded, conf);
		new ModelToDAOConversionGenerator().start(modelListChilded, conf);
	}
658027
@Override
    public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {

        setResolveInit();

        clearCandidates();

        Enumeration<NetworkInterface> ifaces = null;

        try {
            ifaces = NetworkInterface.getNetworkInterfaces();
        } catch (SocketException e) {
            LOGGER.log(Level.WARNING, "exception", e);
        }

        while (ifaces.hasMoreElements()) {

            NetworkInterface iface = ifaces.nextElement();
            Enumeration<InetAddress> iaddresses = iface.getInetAddresses();

            while (iaddresses.hasMoreElements()) {
                InetAddress iaddress = iaddresses.nextElement();
                if (!iaddress.isLoopbackAddress() && !iaddress.isLinkLocalAddress() && !iaddress.isSiteLocalAddress()) {
                    TransportCandidate tr = new TransportCandidate.Fixed(iaddress.getHostAddress() != null ? iaddress.getHostAddress() : iaddress.getHostName(), getFreePort());
                    tr.setLocalIp(iaddress.getHostAddress() != null ? iaddress.getHostAddress() : iaddress.getHostName());
                    addCandidate(tr);
                    setResolveEnd();
                    return;
                }
            }
        }

        try {
            ifaces = NetworkInterface.getNetworkInterfaces();
        } catch (SocketException e) {
            LOGGER.log(Level.WARNING, "exception", e);
        }

        while (ifaces.hasMoreElements()) {

            NetworkInterface iface = ifaces.nextElement();
            Enumeration<InetAddress> iaddresses = iface.getInetAddresses();

            while (iaddresses.hasMoreElements()) {
                InetAddress iaddress = iaddresses.nextElement();
                if (!iaddress.isLoopbackAddress() && !iaddress.isLinkLocalAddress()) {
                    TransportCandidate tr = new TransportCandidate.Fixed(iaddress.getHostAddress() != null ? iaddress.getHostAddress() : iaddress.getHostName(), getFreePort());
                    tr.setLocalIp(iaddress.getHostAddress() != null ? iaddress.getHostAddress() : iaddress.getHostName());
                    addCandidate(tr);
                    setResolveEnd();
                    return;
                }
            }
        }

        try {
            TransportCandidate tr = new TransportCandidate.Fixed(InetAddress.getLocalHost().getHostAddress() != null ? InetAddress.getLocalHost().getHostAddress() : InetAddress.getLocalHost().getHostName(), getFreePort());
            tr.setLocalIp(InetAddress.getLocalHost().getHostAddress() != null ? InetAddress.getLocalHost().getHostAddress() : InetAddress.getLocalHost().getHostName());
            addCandidate(tr);
        } catch (Exception e) {
            LOGGER.log(Level.WARNING, "exception", e);
        }
        setResolveEnd();

    }
1342854
@SuppressWarnings("static-method")
	protected void handleInvocationTargetException(Throwable targetException, Context context) {
		// ignore NullPointerException, as not having to check for NPEs all the time is a convenience feature
		if (!(targetException instanceof NullPointerException)) {
			Exceptions.throwUncheckedException(targetException);
		}
	}
40869
@Override
  public void execute() throws Exception {
    ApiClient apiClient = new ApiClient(ApiClient.getToken(), false);
    int rateRemain = apiClient.getRateLimitRemain();
    System.out.println("Your Github API token is valid.");
    System.out.println(rateRemain+ " requests remaining.");
  }
48256
protected void doStart() throws Exception
    {
        if (isStarted())
            return;

        // save context classloader
        Thread thread= Thread.currentThread();
        ClassLoader lastContextLoader= thread.getContextClassLoader();

        MultiException mex= null;
        try
        {
            // Find the webapp
            resolveWebApp();

            // Get the handler
            getServletHandler();
          
            _configurations=loadConfigurations();
            
            // initialize the classloader            
            configureClassPath();
            initClassLoader(true);
            thread.setContextClassLoader(getClassLoader());
            initialize();
            
            // Do the default configuration
            configureDefaults();

            // Set classpath for Jasper.
            Map.Entry entry= _webAppHandler.getHolderEntry("test.jsp");
            if (entry != null)
            {
                ServletHolder jspHolder= (ServletHolder)entry.getValue();
                if (jspHolder != null && jspHolder.getInitParameter("classpath") == null)
                {
                    String fileClassPath= getFileClassPath();
                    jspHolder.setInitParameter("classpath", fileClassPath);
                    if (log.isDebugEnabled())
                        log.debug("Set classpath=" + fileClassPath + " for " + jspHolder);
                }
            }
            
            // configure webapp
            configureWebApp();

            // If we have servlets, don't init them yet
            _webAppHandler.setAutoInitializeServlets(false);

            // Start handlers
            super.doStart();

            mex= new MultiException();
            // Context listeners
            if (_contextListeners != null && _webAppHandler != null)
            {
                ServletContextEvent event= new ServletContextEvent(getServletContext());
                for (int i= 0; i < LazyList.size(_contextListeners); i++)
                {
                    try
                    {
                        ((ServletContextListener)LazyList.get(_contextListeners, i)).contextInitialized(event);
                    }
                    catch (Exception ex)
                    {
                        mex.add(ex);
                    }
                }
            }

            // OK to Initialize servlets now
            if (_webAppHandler != null && _webAppHandler.isStarted())
            {
                try
                {
                    _webAppHandler.initializeServlets();
                }
                catch (Exception ex)
                {
                    mex.add(ex);
                }
            }
        }
        catch (Exception e)
        {
            log.warn("Configuration error on " + _war, e);
            throw e;
        }
        finally
        {
            thread.setContextClassLoader(lastContextLoader);
        }

        if (mex != null)
            mex.ifExceptionThrow();
    }
417175
@Setup(Level.Trial)
  public void setup() throws Exception {
    registry = new MutableHandlerRegistry();
    fullMethodNames = new ArrayList<>(serviceCount * methodCountPerService);
    for (int serviceIndex = 0; serviceIndex < serviceCount; ++serviceIndex) {
      String serviceName = randomString();
      ServerServiceDefinition.Builder serviceBuilder = ServerServiceDefinition.builder(serviceName);
      for (int methodIndex = 0; methodIndex < methodCountPerService; ++methodIndex) {
        String methodName = randomString();

        MethodDescriptor<Void, Void> methodDescriptor = MethodDescriptor.<Void, Void>newBuilder()
            .setType(MethodDescriptor.MethodType.UNKNOWN)
            .setFullMethodName(MethodDescriptor.generateFullMethodName(serviceName, methodName))
            .setRequestMarshaller(TestMethodDescriptors.voidMarshaller())
            .setResponseMarshaller(TestMethodDescriptors.voidMarshaller())
            .build();
        serviceBuilder.addMethod(methodDescriptor,
            new ServerCallHandler<Void, Void>() {
              @Override
              public Listener<Void> startCall(ServerCall<Void, Void> call,
                  Metadata headers) {
                return null;
              }
            });
        fullMethodNames.add(methodDescriptor.getFullMethodName());
      }
      registry.addService(serviceBuilder.build());
    }
  }