===================================================================
346844
public int checkAccessControl(Database database, String deviceName, TangoUrl devUrl) {
        int access = TangoConst.ACCESS_WRITE;
        synchronized (monitor) {
            if (database.devname==null)
                database.devname = database.device.name();
            if (deviceName.equals(database.devname) && database.isAccess_checked())
                return database.access;
            try {
                //	Else create proxy
                //	Check if AccessProxy object already exists
                if (/*!database.isAccess_checked() &&*/ database.getAccess_proxy()==null) {
                    //	Check if access deviceName is from env (for tests)
                    String access_deviceName = ApiUtil.getAccessDevname();
                    if (access_deviceName==null || access_deviceName.length()==0) {
                        if (access_service_read)
                            if (!database.check_access)
                                return TangoConst.ACCESS_WRITE;

                        //	Get Access service
                        String[] services =
                                getServices(database, TangoConst.ACCESS_SERVICE, "*");
                        if (services.length>0)
                            access_deviceName = services[0];
                        else {
                            //	if not set --> No check
                            //System.out.println("No Access Service Found !");
                            database.check_access = false;
                            access_service_read = true;
                            return TangoConst.ACCESS_WRITE;
                        }
                    }
                    // If tango_host not from env -> add tango_host as header for access device name
                    //  Check if header not already in access_deviceName :-)
                    if (!devUrl.fromEnv && !access_deviceName.startsWith("tango://"))
                        access_deviceName = "tango://" + devUrl.host + ":" + devUrl.port + "/" + access_deviceName;

                    //	Then build Tango Access Control Proxy
                    database.setAccess_proxy(new AccessProxy(access_deviceName));
                }
                if (database.getAccess_proxy()!=null) {
                    access = database.getAccess_proxy().checkAccessControl(deviceName);
                }

                //	if database access not already checked, and not first import -> do it now
                if (!database.isAccess_checked())
                    if (!deviceName.equals(database.device.name()))
                        checkAccess(database);

            } catch (DevFailed e) {
                //	In case of failure, returns always TangoConst.ACCESS_READ
                access = TangoConst.ACCESS_READ;
                //	if cannot import AccessProxy
                //	-> change description to be more explicit
                if (e.errors.length>1)
                    if (e.errors[1].reason.equals("TangoApi_CANNOT_IMPORT_DEVICE"))
                        e.errors[0].desc +=
                                "\nControlled access service defined in Db but unreachable --> Read Only access given to all devices...";

                database.setAccess_devfailed(e);
                //Except.print_exception(e);
            }
        }
        return access;
    }
838348
@Override
    public void setClassProperties(final String name, final Map<String, String[]> properties) throws DevFailed {
        final List<String> args = getArray(properties, name);
        final DeviceData argin = new DeviceData();
        argin.insert(args.toArray(new String[args.size()]));
        database.command_inout("DbPutClassProperty", argin);
    }
139742
@Init
    @StateMachine(endState = DeviceState.ON)
    public void init() throws DevFailed {
        xlogger.entry();
        TangoCacheManager.setPollSize(pollingThreadsPoolSize);
        // logger.debug("init admin device with quartzThreadsPoolSize = {}",
        // quartzThreadsPoolSize);
        status = "The device is ON\nThe polling is ON";
        tangoStats = TangoStats.getInstance();
        xlogger.exit();
    }
1151876
private long doPing(final Connection connection) throws DevFailed {
		checkIfTango(connection, "ping");

		build_connection(connection);

		final long t0 = System.currentTimeMillis();
		try {
	    	connection.device.ping();
		} catch (final DevFailed e) {
	    	final String reason = "TangoApi_CANNOT_PING_DEVICE";
	    	final String desc = "Cannot ping " + connection.devname;
	    	final String origin = "Connection.ping()";
	    	Except.throw_connection_failed(e, reason, desc, origin);
		} catch (final Exception e) {
	    	ApiUtilDAODefaultImpl.removePendingRepliesOfDevice(connection);
	    	throw_dev_failed(connection, e, "ping", false);
		}

		final long t1 = System.currentTimeMillis();
		return (int) (t1 - t0) * 1000; // Set as micro seconds
    }
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();
        }
    }
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();
    }
395675
public function init()
    {
        if ($this->widget !== null) {
            $this->widget->init();
        }

        // ensure the widget has an id
        if ($this->widget->id === null) {
            $this->widget->id = $this->widget->getUniqueId();
        }
    }
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;
    }
242138
public synchronized void initDevice() {
        MDC.setContextMap(contextMap);
        xlogger.entry();
        if (stateImpl == null) {
            stateImpl = new StateImpl(businessObject, null, null);
        }
        if (statusImpl == null) {
            statusImpl = new StatusImpl(businessObject, null, null);
        }
        if (initImpl == null) {
            buildInit(null, false);
        }
        doInit();
        try {
            pushInterfaceChangeEvent(true);
        } catch (final DevFailed e) {
            // ignore
            logger.error("error pushing event", e);
        }
        logger.debug("device init done");
        xlogger.exit();
    }
119374
public void init(final DeviceData deviceData, final ORB orb) throws DevFailed {
        deviceData.setAny(orb.create_any());
    }
832681
public function init()
    {
        if (true === $this->beforeInit()) {
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_AFTER_SAVE, [$this, 'onSave']);
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_AFTER_UPDATE, [$this, 'onUpdate']);
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_BEFORE_DELETE, [$this, 'onDelete']);
        }
    }
755843
public function handle(): void
    {
        $this->dbMigrate();
        $this->populateReactionTypes();
        $this->populateReacters();
        $this->populateReactants();
        $this->populateReactions();
        $this->dbCleanup();
        $this->filesystemCleanup();
    }
670801
public function init()
    {
        parent::init();

        foreach ($this->columns as $column) {
            $column->init();
            // index the column by id if it is not already indexed
            if (!array_key_exists($column->id, $this->columns_by_id)) {
                $this->columns_by_id[$column->id] = $column;
            }
        }

        foreach ($this->extra_rows as $row) {
            $row->init();
            // index the row by id if it is not already indexed
            if (!array_key_exists($row->id, $this->rows_by_id)) {
                $this->rows_by_id[$row->id] = $row;
            }
        }

        foreach ($this->groups as $group) {
            $group->init();
            // index the group by id if it is not already indexed
            if (!array_key_exists($group->id, $this->groups_by_id)) {
                $this->groups_by_id[$group->id] = $group;
            }
        }

        foreach ($this->spanning_columns as $column) {
            $column->init();
            // index the row column by id if it is not already indexed
            if (!array_key_exists($column->id, $this->spanning_columns_by_id)) {
                $this->spanning_columns_by_id[$column->id] = $column;
            }
        }
    }
767330
@Override
   public void onCreate(SQLiteDatabase db) {
      int pointer = context.getResources().getIdentifier(INIT_CREATE_SQL, "string", context.getPackageName());
      if (pointer == 0) {
         Log.e(TAG, "undefined sql id - " + INIT_CREATE_SQL);
      } else {
         String createTabelSql = context.getResources().getString(pointer);
         for (String sql : createTabelSql.split(";")) {
            db.execSQL(sql);
         }
      }
   }
1000705
public void put_device_attribute_property(Database database, String deviceName, DbAttribute[] attr)
            throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        DeviceData argIn = new DeviceData();
        try {
            //	value is an array
            argIn.insert(ApiUtil.toStringArray(deviceName, attr, 2));
            command_inout(database, "DbPutDeviceAttributeProperty2", argIn);
        } catch (DevFailed e) {
            if (e.errors[0].reason.equals("API_CommandNotFound")) {
                //	Value is just one element
                argIn.insert(ApiUtil.toStringArray(deviceName, attr, 1));
                command_inout(database, "DbPutDeviceAttributeProperty", argIn);
            } else
                throw e;
        }
    }
467198
public static void initialize() {
		if (isInitialized) {
			return;
		}
		isInitialized = true;
		printLogo();
		try {
			logger.info("--- Para.initialize() [{}] ---", Config.ENVIRONMENT);

			for (InitializeListener initListener : INIT_LISTENERS) {
				if (initListener != null) {
					initListener.onInitialize();
					logger.debug("Executed {}.onInitialize().", initListener.getClass().getName());
				}
			}
			logger.info("Instance #{} initialized.", Config.WORKER_ID);
		} catch (Exception e) {
			logger.error("Failed to initialize Para.", e);
		}
	}
245242
private function init()
    {
        /** @var $genericDevice \Wurfl\Device\ModelDeviceInterface */
        $genericDevice = $this->getDevice(WurflConstants::GENERIC);

        if (!is_null($genericDevice)) {
            $this->capabilitiesName       = array_keys($genericDevice->getCapabilities());
            $this->groupIDCapabilitiesMap = $genericDevice->getGroupIdCapabilitiesNameMap();
        }
    }