===================================================================
519197
public static DeviceProxy get(String deviceName, String tangoHost) throws DevFailed {
        //	Get full device name (with tango host) to manage multi tango_host
        String fullDeviceName;
        if (deviceName.startsWith("tango://") || deviceName.startsWith("//"))
            fullDeviceName = deviceName;
        else
            fullDeviceName = "tango://"+tangoHost + "/"+deviceName;

        //	Get it if already exists
        DeviceProxy dev =  proxy_table.get(fullDeviceName);
        if (dev == null) {
            try {
                //	Else create it.
                dev = new DeviceProxy(deviceName);
                proxy_table.put(fullDeviceName, dev);
            }
            catch(DevFailed e) {
                e.printStackTrace();
                throw e;
            }
        }
        return dev;
    }
683787
public function initialize()
    {
        if ($this->all()->count() < 1) {
            return;
        }

        $this->all()->each(function (ActionInterface $action) {
            $action->initialize();
        });

        $this->setHtmlAttribute('data-type', 'display-actions');

        if (! $this->hasHtmlAttribute('class')) {
            $this->setHtmlAttribute('class', 'panel-footer');
        }
    }
877638
@Override
    int read_attribute_asynch_i(final String a, final boolean fwd, final int rid) throws DevFailed {
	synchronized (this) {
	    final Iterator it = elements.iterator();
	    while (it.hasNext()) {
		final GroupElement e = (GroupElement) it.next();
		if (e instanceof GroupDeviceElement || fwd) {
		    e.read_attribute_asynch_i(a, fwd, rid);
		}
	    }
	    return rid;
	}
    }
1285570
public function build()
    {
        if (!$this->blockname || $this->blockname==='vitals') {
            $this->_distro();
            $this->_hostname();
            $this->_kernel();
            $this->_uptime();
            $this->_users();
            $this->_loadavg();
            $this->_processes();
        }
        if (!$this->blockname || $this->blockname==='hardware') {
            $this->_machine();
            $this->_cpuinfo();
            $this->_pci();
            $this->_ide();
            $this->_scsi();
            $this->_nvme();
            $this->_usb();
            $this->_i2c();
        }
        if (!$this->blockname || $this->blockname==='network') {
            $this->_network();
        }
        if (!$this->blockname || $this->blockname==='memory') {
            $this->_memory();
        }
        if (!$this->blockname || $this->blockname==='filesystem') {
            $this->_filesystems();
        }
    }
1349253
public function refresh(): void
    {
        $this->size = null;
        $this->lastModified = null;
        $this->isReadable = null;
        $this->isWritable = null;
        $this->exists = null;
        $this->created = null;
        $this->isSymLink = null;
        $this->isDir = null;
        $this->isFile = null;
        $this->isExecutable = null;
        $this->ownerId = null;
        $this->owner = null;
        $this->group = null;
        $this->groupId = null;
        $this->lastRead = null;
    }
428198
public synchronized void rem_obj_polling(final String[] argin, final boolean with_db_upd)
            throws DevFailed {
        Util.out4.println("In rem_obj_polling command");
        for (final String arg : argin) {
            Util.out4.println("Input string = " + arg);
        }

        // Check that parameters number is correct
        if (argin.length != 3) {
            Except.throw_exception("API_WrongNumberOfArgs", "Incorrect number of inout arguments",
                    "DServer.rem_obj_polling");
        }

        // Find the device
        final Util tg = Util.instance();
        DeviceImpl dev = null;
        try {
            dev = tg.get_device_by_name(argin[0]);
        } catch (final DevFailed e) {
            Except.re_throw_exception(e, "API_DeviceNotFound", "Device " + argin + " not found",
                    "DServer.rem_obj_polling");
        }
        // Check that the device is polled
        assert dev != null;
        if (dev.is_polled() == false) {
            Except.throw_exception("API_DeviceNotPolled", "Device " + argin[0] + " is not polled",
                    "DServer.rem_obj_polling_period");
        }

        // Find the wanted object in the list of device polled object
        final String obj_type = argin[1].toLowerCase();
        final String obj_name = argin[2].toLowerCase();
        int type = Tango_POLL_CMD;

        if (obj_type.equals(Tango_PollCommand)) {
            type = Tango_POLL_CMD;
        } else if (obj_type.equals(Tango_PollAttribute)) {
            type = Tango_POLL_ATTR;
        } else {
            Except.throw_exception("API_NotSupported",
                    "Object type " + obj_type + " not supported", "DServer.rem_obj_polling_period");
        }

        final Vector poll_list = dev.get_poll_obj_list();
        for (int i = 0; i < poll_list.size(); i++) {
            final PollObj poll_obj = (PollObj) poll_list.elementAt(i);
            if (poll_obj.get_type() == type) {
                if (poll_obj.get_name().equals(obj_name)) {
                    poll_list.remove(i);
                }
            }
        }

        Util.out4.println("Sending cmd to polling thread");
        final TangoMonitor mon = tg.get_poll_monitor();
        final PollThCmd shared_cmd = tg.get_poll_shared_cmd();
        if (shared_cmd.cmd_pending == true) {
            mon.signal();
        }
        shared_cmd.cmd_pending = true;
        shared_cmd.cmd_code = Tango_POLL_REM_OBJ;
        shared_cmd.dev = dev;
        shared_cmd.name = obj_name;
        shared_cmd.type = type;
        mon.signal();

        Util.out4.println("Cmd sent to polling thread");

        // Wait for thread to execute command
        boolean interrupted;
        while (shared_cmd.cmd_pending == true) {
            interrupted = mon.wait_it(Tango_DEFAULT_TIMEOUT);
            if (shared_cmd.cmd_pending == true && interrupted == false) {
                // Util.out4
                System.out.println("TIME OUT");
                Except.throw_exception("API_CommandTimedOut", "Polling thread blocked !!!",
                        "DServer.rem_obj_polling");
            }
        }
        Util.out4.println("Thread cmd normally executed");

        // Mark the device as non polled if this was the last polled object
        if (poll_list.size() == 0) {
            dev.is_polled(false);
        }

        // Update database property. This means remove object entry in the
        // polling
        // properties if they exist or add it to the list of device not polled
        // for automatic polling defined at command/attribute level.
        // Do this if possible and wanted.
        if (with_db_upd && Util._UseDb) {
            final DbDatum db_info = new DbDatum("polled_attr");
            boolean update_needed = false;
            if (type == Tango_POLL_CMD) {
                db_info.name = "polled_cmd";
                final Vector cmd_list = dev.get_polled_cmd();
                int i;
                for (i = 0; i < cmd_list.size(); i++) {
                    final String s = (String) cmd_list.elementAt(i);
                    if (s.equals(obj_name)) {
                        cmd_list.remove(i);
                        cmd_list.remove(i);
                        db_info.insert(stringVect2StringArray(cmd_list));
                        update_needed = true;
                        break;
                    }
                    i++;
                }
                if (update_needed == false) {
                    final Vector non_auto_cmd = dev.get_non_auto_polled_cmd();
                    for (i = 0; i < non_auto_cmd.size(); i++) {
                        final String s = (String) non_auto_cmd.elementAt(i);
                        if (s.equals(obj_name)) {
                            break;
                        }
                    }
                    if (i == cmd_list.size()) {
                        non_auto_cmd.add(obj_name);
                        db_info.name = "non_auto_polled_cmd";
                        db_info.insert(stringVect2StringArray(non_auto_cmd));
                        update_needed = true;
                    }
                }
            } else {
                final Vector attr_list = dev.get_polled_attr();
                int i;
                for (i = 0; i < attr_list.size(); i++) {
                    final String s = (String) attr_list.elementAt(i);
                    if (s.equals(obj_name)) {
                        attr_list.remove(i);
                        attr_list.remove(i);
                        db_info.insert(stringVect2StringArray(attr_list));
                        update_needed = true;
                        break;
                    }
                    i++;
                }
                if (update_needed == false) {
                    final Vector non_auto_attr = dev.get_non_auto_polled_attr();
                    for (i = 0; i < non_auto_attr.size(); i++) {
                        final String s = (String) non_auto_attr.elementAt(i);
                        if (s.equals(obj_name)) {
                            break;
                        }
                    }
                    if (i == attr_list.size()) {
                        non_auto_attr.add(obj_name);
                        db_info.name = "non_auto_polled_cmd";
                        db_info.insert(stringVect2StringArray(non_auto_attr));
                        update_needed = true;
                    }
                }
            }
            if (update_needed == true) {
                final DbDatum[] send_data = new DbDatum[1];
                send_data[0] = db_info;
                dev.get_db_device().put_property(send_data);
                Util.out4.println("Polling properties updated");
            }
        }
    }
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);
		 }
    }
184752
public function compile()
    {
        if (null !== $this->parameterBag) {
            $blocks = $this->getCoreBlocks();
            $blocks = array_merge($blocks, $this->getThirdPartyBlocks());
            foreach ($blocks as $block) {
                $this->prepareBlock($block);
            }
        }

        Config::read($this);

        parent::compile();
    }
1093632
public void add_device(String devname, String classname, String servname) throws DevFailed {
		databaseDAO.add_device(this, devname, classname, servname);
    }
755843
public function handle(): void
    {
        $this->dbMigrate();
        $this->populateReactionTypes();
        $this->populateReacters();
        $this->populateReactants();
        $this->populateReactions();
        $this->dbCleanup();
        $this->filesystemCleanup();
    }
314729
public function init()
    {
        /* @var SeoBehavior $behavior */
        $behavior = $this->controller->asa('seo');

        if ($behavior !== null && $behavior->title !== null)
            $this->_title = $behavior->title;
        else if ($this->defaultTitle !== null)
            $this->_title = $this->defaultTitle;

        if ($behavior !== null && $behavior->metaDescription !== null)
            $this->_description = $behavior->metaDescription;
        else if ($this->defaultDescription !== null)
            $this->_description = $this->defaultDescription;

        if ($behavior !== null && $behavior->metaKeywords !== null)
            $this->_keywords = $behavior->metaKeywords;
        else if ($this->defaultKeywords !== null)
            $this->_keywords = $this->defaultKeywords;

        if ($behavior !== null)
            $this->_properties = array_merge($behavior->metaProperties, $this->defaultProperties);
        else
            $this->_properties = $this->defaultProperties;

        if ($behavior !== null && $behavior->canonical !== null)
            $this->_canonical = $behavior->canonical;
    }
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));
        }
	}
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);
        }
    }
53774
public function process()
    {
        parent::process();

        try {
            $value = $this->getNumericValue($this->value);
        } catch (SwatIntegerOverflowException $e) {
            $value = null;
        }

        if ($value !== null) {
            if (
                $this->minimum_value !== null &&
                $value < $this->minimum_value
            ) {
                $message = $this->getValidationMessage('below-minimum');
                $minimum_value = str_replace(
                    '%',
                    '%%',
                    $this->getDisplayValue($this->minimum_value)
                );

                $message->primary_content = sprintf(
                    $message->primary_content,
                    $minimum_value
                );

                $this->addMessage($message);
            }
            if (
                $this->maximum_value !== null &&
                $value > $this->maximum_value
            ) {
                $message = $this->getValidationMessage('above-maximum');
                $maximum_value = str_replace(
                    '%',
                    '%%',
                    $this->getDisplayValue($this->maximum_value)
                );

                $message->primary_content = sprintf(
                    $message->primary_content,
                    $maximum_value
                );

                $this->addMessage($message);
            }
        }
    }
1336043
public function commit()
  {
    if (!is_null($this->_changes)) {
      $this->_commit($this->_changes);

      $this->_changes = null;
    }
  }
432541
public function enable()
    {
        if ($this->enabled) {
            return;
        }
        if (!$this->fd) {
            return;
        }
        $this->enabled = true;
        if ($this->ev === null) {
            if ($this->eventLoop === null) {
                $this->eventLoop = EventLoop::$instance;
            }
            $this->ev = $this->eventLoop->listener(
                [$this, 'onAcceptEv'],
                null,
                \EventListener::OPT_CLOSE_ON_FREE | \EventListener::OPT_REUSEABLE,
                -1,
                $this->fd
            );
            $this->onBound();
        } else {
            $this->ev->enable();
        }
    }
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
    }