===========================================================================
515633
public DevCmdInfo_2 command_query_2(final String command) throws DevFailed, SystemException {
	Util.out4.println("Device_2Impl.command_query_2(" + command + ") arrived");

	// Retrieve number of command and allocate memory to send back info
	final int nb_cmd = device_class.get_command_list().size();
	Util.out4.println(nb_cmd + " command(s) for device");
	DevCmdInfo_2 back = null;
	for (int i = 0; i < nb_cmd; i++) {
	    final Command cmd = (Command) device_class.get_command_list().elementAt(i);
	    if (cmd.get_name().toLowerCase().equals(command.toLowerCase())) {
		final DevCmdInfo_2 tmp = new DevCmdInfo_2();
		tmp.cmd_name = cmd.get_name();
		tmp.cmd_tag = cmd.get_tag();
		tmp.level = cmd.get_disp_level();
		tmp.in_type = cmd.get_in_type();
		tmp.out_type = cmd.get_out_type();
		final String str_in = cmd.get_in_type_desc();
		if (str_in.length() != 0) {
		    tmp.in_type_desc = str_in;
		} else {
		    tmp.in_type_desc = Tango_DescNotSet;
		}
		final String str_out = cmd.get_out_type_desc();
		if (str_out.length() != 0) {
		    tmp.out_type_desc = str_out;
		} else {
		    tmp.out_type_desc = Tango_DescNotSet;
		}
		back = tmp;
	    }
	}

	// throw an exception to client if command not found
	if (back == null) {
	    Except.throw_exception("API_CommandNotFound", "Command " + command + " not found",
		    "Device_2Impl.command_query_2");
	}

	// Record operation request in black box
	blackbox.insert_op(Op_Command_list_2);

	Util.out4.println("Device_2Impl.command_list_query_2 exiting");
	return back;

    }
885885
public function validateResolved()
    {
        $this->prepareForValidation();

        if (! $this->passesAuthorization()) {
            $this->failedAuthorization();
        }

        $instance = $this->getValidatorInstance();

        if ($instance->fails()) {
            $this->failedValidation($instance);
        }
    }
1314776
public void addTangoPeriodicListener(ITangoPeriodicListener listener, String attrName, String[] filters, boolean stateless)
            throws DevFailed {
        TangoPeriodic tangoPeriodic;

        String key = deviceName+"/"+attrName;
        if ((tangoPeriodic = tango_periodic_source.get(key)) == null) {
            tangoPeriodic = new TangoPeriodic(deviceProxy, attrName, filters);
            tango_periodic_source.put(key, tangoPeriodic);
        }

        synchronized (moni) {
            tangoPeriodic.addTangoPeriodicListener(listener, stateless);
        }
    }
654028
public function build()
    {
        parent::build();
        if (!$this->blockname || $this->blockname==='vitals') {
            $this->_uptime();
            $this->_processes();
        }
        if (!$this->blockname || $this->blockname==='hardware') {
            $this->_tb();
        }
        if (!$this->blockname || $this->blockname==='network') {
            $this->_network();
        }
    }
1238348
public function commit()
    {
        if ($this->_currentSegment !== null) {
            $newSegment = $this->_currentSegment->close();
            if ($newSegment !== null) {
                $this->_newSegments[$newSegment->getName()] = $newSegment;
            }
            $this->_currentSegment = null;
        }

        $this->_updateSegments();
    }
379123
public function initialize()
    {
        $this->initializeConnections();
        $this->_table and $this->setSource($this->_table);
        $this->keepSnapshots(true);
    }
750858
private void buildStructure() throws DevFailed {
        DbServer    server;
        if (tgHost ==null || tgPort ==null)
            server = new DbServer(serverName);
        else {
            server = new DbServer(serverName, tgHost, tgPort);
        }

        //  Check if server defined in database.
        String  adminName = (tgHost ==null)? "" : "tango://"+ tgHost +":"+ tgPort +"/";
        adminName += "dserver/"+serverName.toLowerCase();
        new DeviceProxy(adminName);

        //  Build Server classes
        String[]    classNames = server.get_class_list();
        classes.add(new TangoClass("DServer"));
        for (String className : classNames) {
             classes.add(new TangoClass(className));
        }
	}
863380
private synchronized void checkInitialization() throws DevFailed {
        if (initImpl != null) {
            isInitializing = initImpl.isInitInProgress();
        } else {
            isInitializing = false;
        }
        if (isInitializing) {
            throw DevFailedUtils.newDevFailed("CONCURRENT_ERROR", name + " in Init command ");
        }
    }
475604
public function dispose() {
        if ($this->disposed) {
            return;
        }
        $this->disposed = true;
        if ($this->transactions) {
            $this->force_transaction_rollback();
        }

        if ($this->temptables) {
            $this->temptables->dispose();
            $this->temptables = null;
        }
        if ($this->database_manager) {
            $this->database_manager->dispose();
            $this->database_manager = null;
        }
        $this->tables  = null;
    }
277510
public function create()
    {
        $autoIncrementField = $this->getAutoIncrementField();
        if ($autoIncrementField && $this->$autoIncrementField === null) {
            $this->$autoIncrementField = $this->getNextAutoIncrementId();
        }

        $fields = $this->getFields();
        foreach ($this->getAutoFilledData(self::OP_CREATE) as $field => $value) {
            /** @noinspection NotOptimalIfConditionsInspection */
            if (!in_array($field, $fields, true) || $this->$field !== null) {
                continue;
            }
            $this->$field = $value;
        }

        $this->validate($fields);

        $this->eventsManager->fireEvent('model:beforeSave', $this);
        $this->eventsManager->fireEvent('model:beforeCreate', $this);

        $fieldValues = [];
        $defaultValueFields = [];
        foreach ($fields as $field) {
            if ($this->$field !== null) {
                $fieldValues[$field] = $this->$field;
            } elseif ($field !== $autoIncrementField) {
                $defaultValueFields[] = $field;
            }
        }

        foreach ($this->getJsonFields() as $field) {
            if (is_array($this->$field)) {
                $fieldValues[$field] = json_encode($this->$field, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
            }
        }

        /**
         * @var \ManaPHP\DbInterface $connection
         */
        $connection = $this->_di->getShared($this->getDb($this));

        if ($autoIncrementField && $this->$autoIncrementField === null) {
            $this->$autoIncrementField = (int)$connection->insert($this->getSource($this), $fieldValues, true);
        } else {
            $connection->insert($this->getSource($this), $fieldValues);
        }

        if ($defaultValueFields) {
            if ($r = static::query(null, $this)->select($defaultValueFields)->where($this->_getPrimaryKeyValuePairs())->fetch(true)) {
                foreach ($r[0] as $field => $value) {
                    $this->$field = $value;
                }
            }
        }

        $this->_snapshot = $this->toArray();

        $this->eventsManager->fireEvent('model:afterCreate', $this);
        $this->eventsManager->fireEvent('model:afterSave', $this);

        return $this;
    }
152362
public function update()
    {
        if (!$this->exists()) {
            throw new \RuntimeException('Cannot update a table that doesn\'t exist!');
        }

        // update table
        foreach ($this->getPendingColumns() as $column) {
            $this->getAdapter()->addColumn($this, $column);
        }

        foreach ($this->getIndexes() as $index) {
            $this->getAdapter()->addIndex($this, $index);
        }

        foreach ($this->getForeignKeys() as $foreignKey) {
            $this->getAdapter()->addForeignKey($this, $foreignKey);
        }

        $this->saveData();
        $this->reset(); // reset pending changes
    }
1032788
public static function init(): void
    {
        if (static::$adapters === null) {
        	static::$randomNumber = rand(100000, 999999);

        	// set the "who"
            static::resetWho();

            static::$adapters = [];
            $configs = Application::getConfig('application')->get('log', []);

            $count = 0;
            foreach ($configs as $index => $config) {
                $enabled = $config['enabled'] && is_array($config['options']['log']) && count($config['options']['log']) > 0;

                // TODO: Register module if needed

                if ($enabled) {
                    if (!isset($config['adapter_class'])) {
                        throw new ConfigException("Logger[{$index}] defined in application config is missing adapter_class key");
                    }

                    // if the config is enabled, then make new instance
                    $adapter = $config['adapter_class'];

                    static::$adapters[$count] = new $adapter($config['options']);

                    // Log class must be instance of AbstractLogAdapter
                    if (!(static::$adapters[$count] instanceof AbstractLogAdapter)) {
                        throw new Exception("Log adapter {$adapter} must extend AbstractLogAdapter");
                    }

                    static::$enabledAdapters[$config['adapter_class']] = true;

                    foreach ($config['options']['log'] as $level) {
                        static::$enabledLevels[$level] = true;
                    }

                    $count++;
                }
            }
        }
    }
419248
public function run()
    {
        // truncate any tables which are about to be updated
        $this->emptyTables();

        // loop through types and execute
        foreach ($this->dataMigrationTypeProvider->getTypes() as $dataMigration) {
            /** @var AbstractDataMigration $dataMigration */
            $dataMigration->execute();
            $this->logActions($dataMigration);
        }

        /**
         * Save config value
         */
        $this->saveAllOrderStatusesAsString();
        $this->saveAllProductTypesAsString();
        $this->saveAllProductVisibilitiesAsString();
        $this->generateAndSaveCode();
    }
1362420
public void init(final Connection connection, final String devname) throws DevFailed {
		 connection.url = new TangoUrl(devname);
		 connection.setDevice_is_dbase(false);
		 connection.devname = connection.url.devname;

		 // Check if connection is possible
		 if (connection.url.protocol == TANGO && connection.url.use_db) {
	    	 connection.ior = get_exported_ior(connection);
		 }
    }
1373143
public static void initPoolConf() throws DevFailed {
        polledDevices.clear();
        final Map<String, String[]> prop = PropertiesUtils.getDeviceProperties(ServerManager.getInstance()
                .getAdminDeviceName());
        if (prop.containsKey(POLLING_THREADS_POOL_CONF)) {
            final String[] pollingThreadsPoolConf = prop.get(POLLING_THREADS_POOL_CONF);
            for (int i = 0; i < pollingThreadsPoolConf.length; i++) {
                if (cacheList.containsKey(pollingThreadsPoolConf[i]) && !pollingThreadsPoolConf[i].isEmpty()
                        && !polledDevices.contains(pollingThreadsPoolConf[i])) {
                    polledDevices.add(pollingThreadsPoolConf[i]);
                }
            }
        }
    }
3823
public function init()
    {
        $this->_init();

        if ($this->id_field) {
            $this->addField($this->id_field, [
                'system'    => true,
            ]);
        }
    }
755843
public function handle(): void
    {
        $this->dbMigrate();
        $this->populateReactionTypes();
        $this->populateReacters();
        $this->populateReactants();
        $this->populateReactions();
        $this->dbCleanup();
        $this->filesystemCleanup();
    }