Add an additional managed instance

@param instance instance to add
@throws Exception errors
962905
public void addInstance(Object instance)
            throws Exception
    {
        if (isDestroyed()) {
            throw new IllegalStateException("System already stopped");
        }
        else {
            startInstance(instance);
            if (methodsMap.get(instance.getClass()).hasFor(PreDestroy.class)) {
                managedInstances.add(instance);
            }
        }
    }
15390
def addInstance(self, inst_id):
        
        self.instances.add(inst_id)
        self.requestTracker.add_instance(inst_id)
        self.numOrderedRequests[inst_id] = (0, 0)
        rm = self.create_throughput_measurement(self.config)

        self.throughputs[inst_id] = rm
        lm = self.latency_measurement_cls(self.config)
        self.clientAvgReqLatencies[inst_id] = lm
        if self.acc_monitor:
            self.acc_monitor.add_instance(inst_id)
1244862
@Override
    public boolean add(BugInstance bugInstance) {
        return add(bugInstance,
                bugInstance.getFirstVersion() == 0L && bugInstance.getLastVersion() == 0L);
    }
1057320
public void addBrowser(DesiredCapabilities cap, int instances) {
    String s = cap.getBrowserName();
    if (s == null || "".equals(s)) {
      throw new InvalidParameterException(cap + " does seems to be a valid browser.");
    }
    if (cap.getPlatform() == null) {
      cap.setPlatform(Platform.getCurrent());
    }
    cap.setCapability(RegistrationRequest.MAX_INSTANCES, instances);
    registrationRequest.getConfiguration().capabilities.add(cap);
    registrationRequest.getConfiguration().fixUpCapabilities();
  }
778929
public void add(@Nullable T item) throws Exception {
		if (exception == null) {
			if (take != null) {
				assert isEmpty();
				SettablePromise<T> take = this.take;
				this.take = null;
				take.set(item);
				if (exception != null) throw exception;
				return;
			}

			doAdd(item);
		} else {
			tryRecycle(item);
			throw exception;
		}
	}
773614
public static void initialize(SingletonProvider instance) {
        synchronized (SingletonProvider.class) {
            if (INSTANCE == null) {
                INSTANCE = instance;
            } else {
                throw new RuntimeException("SingletonProvider is already initialized with " + INSTANCE);
            }
        }
    }
331789
def add_instance(model, _commit=True, **kwargs):
    
    try:
        model = get_model(model)
    except ImportError:
        return None

    instance = model(**kwargs)
    db.session.add(instance)

    try:
        if _commit:
            db.session.commit()
        else:
            db.session.flush()
        return instance.id
    except IntegrityError:
        db.session.rollback()
        return
851638
public void add(Collection<ApplicationInstance> applicationInstances)
    {
        for(ApplicationInstance applicationInstance : applicationInstances)
            this.applicationInstances.put(applicationInstance.getId(), applicationInstance);
    }
711188
void setInstanceId(String instanceId) throws IllegalArgumentException {
        if (instanceId != null && !"".equals(instanceId)) {

            subInstanceId = getSubProcessInstanceId(instanceId);

            try {
                long id = getProcessInstanceId(instanceId);
                mainInstanceId = id < 0 ? null : new Date(id);
            } catch (NumberFormatException nfe) {
                throw new IllegalArgumentException(getLocalizedString("LVM_ERROR_INSTANCEID"), nfe);
            }
        }
    }
1242461
public function add($exception) {
        if($this->checkException($exception) === FALSE) {
            trigger_error(
                'Only subclasses of \Exception and implementations of \Throwable can be aggregated!',
                E_USER_ERROR
            );
        }

        $this->collection[] = $exception;
    }
1229990
private void addInstancesToVIPMaps(Application app, Map<String, VipIndexSupport> virtualHostNameAppMap,
            Map<String, VipIndexSupport> secureVirtualHostNameAppMap) {
        // Check and add the instances to the their respective virtual host name
        // mappings
        for (InstanceInfo info : app.getInstances()) {
            String vipAddresses = info.getVIPAddress();
            if (vipAddresses != null) {
                addInstanceToMap(info, vipAddresses, virtualHostNameAppMap);
            }

            String secureVipAddresses = info.getSecureVipAddress();
            if (secureVipAddresses != null) {
                addInstanceToMap(info, secureVipAddresses, secureVirtualHostNameAppMap);
            }
        }
    }
277481
public function addInstanceDocument( $instance_file = null, $taxonomy_file = null )
	{
		$this->log()->info( "$instance_file" );

		if ( $this->hierarchies !== null )
			throw new Exception( "An instance document cannot be added to a report once the report has been prepared" );

		if ( $instance_file === null )
			throw new Exception( "An instance document has not been supplied." );

		if ( isset( $this->instanceDocuments[ $instance_file ] ) )
			throw new Exception( "The instance document has already been loaded" );

		// Load the document
		/**
		 * An instance document instance
		 * @var XBRL_Instance $instance
		 */
		$instance = null;
		if ( ! XBRL_Instance::FromInstanceDocument( $instance_file, $taxonomy_file, $instance ) )
		{
			throw new Exception( $instance->getError() );
		}

		// If no schema file is yet set, record it.  If the name of the taxonomy schema
		// associated with the instance document loaded is different to the schema of
		// a previously loaded instance document then report an error.
		$schemaFilename = $instance->getSchemaFilename();
		if ( $this->schemaFilename === null )
			$this->schemaFilename = $schemaFilename;
		else if ( $this->schemaFilename !== $schemaFilename )
			throw new Exception( "Instance documents being compared must use the the same taxonomy schema." );

		// Record it
		$this->instanceDocuments[ $instance_file ] =& $instance;
		$this->analyzeContexts( $instance );

		// If no taxonomy is set then record it as well.  Only one taxonomy is allowed per report.
		if ( ! isset( $this->taxonomy ) || $this->taxonomy === null )
			$this->taxonomy =& $instance->getInstanceTaxonomy();
	}
701281
public EntityInstanceWrapper buildInstanceWrapper(final Object instance) throws PMException {
        final EntityInstanceWrapper wrapper = new EntityInstanceWrapper(instance);
        if (hasEntity() && !getEntityContainer().isSelectedNew()) {
            wrapper.setInstanceId(getDataAccess().getInstanceId(this, wrapper));
        }
        return wrapper;
    }
486712
def _attach_to_instance(self, instance):
        
        self._instance = instance
        self.lockable = self.lockable and instance.lockable
27553
def add(self, instance):
        '''
        
        '''

        table = instance.__class__.__name__.lower()
        keys = ", ".join(vars(instance).keys())
        values = tuple(vars(instance).values())

        SQL = """INSERT INTO %s (%s) VALUES(""" % (table, keys)
        SQL += """ "%s",""" * len(values) % (values)
        SQL = SQL[:-1] + ")"

        if self.DEBUG: print(SQL)

        with Session(self.settings) as conn:
            try:
                c = conn.cursor()
                c.execute(SQL)
                conn.commit()
                return True
            except mysql.Error as e:
                if e.errno==1062:
                    print("Already saved to the database")
                    return True
                elif e.errno == 1146:
                    # Table does not exist
                    return True
                else:
                    raise e

                return True
1273598
@Override
    public <T> ObjectStore add(Class<T> type, T instance) {
        Validate.notNull(type, "Type must be specified");
        Validate.notNull(instance, "Instance must be specified");

        store.put(type, instance);
        return this;
    }
139930
public function addInstance(WidgetInstance $instance)
    {
        if (!$this->instances->contains($instance)) {
            $this->instances->add($instance);
            $instance->setContainer($this);
        }
    }