==================================================================================================================
773857
public static boolean equalValues(Object o1, Object o2) {

        if (o1 == o2) {
            return true;
        }

        if (o1 == null || o2 == null) {
            return false;
        }

        return o1.equals(o2);
    }
99814
public void free() {
    if (consumer != null) {
      if (array != null) {
        consumer.freeArray(array);
      }
      array = null;
    }
  }
647781
public function init()
    {
        $valid = null;

        if ($this->cache->has(self::CACHE_KEY)) {
            $cached = $this->cache->get(self::CACHE_KEY);
            $valid  = $cached && isset($cached['hosts']) && count($cached['hosts']);
        }


        if ($valid) {
            $this->map = $cached;
        } else {
            $this->build();
        }
    }
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");
            }
        }
    }
583835
public function main()
    {
        // INIT
        $this->metaTagList = array();

        $this->initialize();

        $sysLanguageId = 0;
        if (!empty($this->tsSetup['config.']['sys_language_uid'])) {
            $sysLanguageId = $this->tsSetup['config.']['sys_language_uid'];
        }

        // Init News extension
        $this->initExtensionSupport();

        if ($this->tsSetupSeo) {
            $this->collectMetaDataFromPage();
            $customMetaTagList = $this->collectMetaDataFromConnector();

            // #####################################
            // Blacklists
            // #####################################

            // Check search engine indexing blacklist
            if (!empty($this->tsSetupSeo['robotsIndex.']['blacklist.'])) {
                // Page is blacklisted, set to noindex
                $this->tsSetupSeo['robotsIndex'] = 0;
            }

            // #####################################
            // Process StdWrap List
            // #####################################
            $stdWrapItemList = array(
                'title',
                'description',
                'keywords',
                'copyright',
                'email',
                'author',
                'publisher',
                'distribution',
                'rating',
                'lastUpdate',
            );
            foreach ($stdWrapItemList as $key) {
                $this->tsSetupSeo[$key] = $this->applyStdWrap($key, $this->tsSetupSeo[$key]);
            }

            // Call hook
            GeneralUtility::callHookAndSignal(
                __CLASS__,
                'metatagSetup',
                $this,
                $this->tsSetupSeo
            );

            // standard metatags
            $this->generateStandardMetaTags();

            // crawler (eg. robots)
            $this->generateCrawlerMetaTags();

            // geo position
            $this->generateGeoPosMetaTags();

            // services (eg. google plus)
            $this->generateServicesMetaTags();

            // user agent stuff
            $this->generateUserAgentMetaTags();

            // Link meta tags (eg. prev, next...)
            if (!empty($this->tsSetupSeo['linkGeneration'])) {
                $this->generateLinkMetaTags();
            }

            // canonical url
            $this->generateCanonicalUrlMetaTags();

            // OpenGraph
            if (!empty($this->tsSetupSeo['opengraph']) && !empty($this->tsSetupSeo['opengraph.'])) {
                $this->generateOpenGraphMetaTags();
            }

            // Advanced meta tags
            $this->advMetaTags($this->metaTagList, $this->pageRecord, $sysLanguageId, $customMetaTagList);
        }

        // #################
        // SOCIAL
        // #################
        if (!empty($this->tsSetup['plugin.']['metaseo.']['social.'])) {
            $this->tsSetupSeo = $this->tsSetup['plugin.']['metaseo.']['social.'];

            if (!empty($this->tsSetupSeo['googlePlus.']['profilePageId'])) {
                $this->metaTagList['social.googleplus.direct-connect'] = array(
                    'tag'        => 'link',
                    'attributes' => array(
                        'rel'  => 'publisher',
                        'href' => 'https://plus.google.com/' . $this->tsSetupSeo['googlePlus.']['profilePageId'],
                    ),
                );
            }
        }

        $this->processMetaTags($this->metaTagList);

        return $this->renderMetaTags($this->metaTagList);
    }
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 ");
        }
    }
129034
public void init(final Connection connection) throws DevFailed {
		// Check Tango Host Properties (host name, port number)
		// ------------------------------------------------------------
		connection.url = new TangoUrl();
		connection.setDevice_is_dbase(true);
		connection.transparent_reconnection = true; // Always true for Database
		//connection.url.trace();

		ApiUtil.get_orb();
		connect_to_dbase(connection);
		connection.devname = connection.device.name();
		connection.setAlready_connected(true);
    }
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;
        }
    }
730228
@Override
    int write_attribute_asynch_i(final DeviceAttribute da, 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.write_attribute_asynch_i(da, fwd, rid);
		}
	    }
	    return rid;
	}
    }
1285295
public static synchronized void init(final boolean useDb, final String adminDeviceName) throws DevFailed {
        // Modified properties fo ORB usage.
        final Properties props = System.getProperties();
        props.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
        props.put("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");
        // register interceptors
        props.put("org.omg.PortableInterceptor.ORBInitializerClass.ForwardInit",
                InterceptorInitializer.class.getCanonicalName());
        // Set retry properties
        props.put("jacorb.retries", "0");
        props.put("jacorb.retry_interval", "100");

        props.put("jacorb.codeset", true);
        // props.put("jacorb.config.dir", "fr/esrf/TangoApi");

        // Initial timeout for establishing a connection.
        props.put("jacorb.connection.client.connect_timeout", "5000");

        // Set the Largest transfert.
        final String str = checkORBgiopMaxMsgSize();
        props.put("jacorb.maxManagedBufSize", str);

        // Set jacorb verbosity at minimum value
        props.put("jacorb.config.log.verbosity", "0");

        // only used for no db device
        props.setProperty("jacorb.implname", SERVER_IMPL_NAME);
        // System.setProperties(props);
        // props.setProperty("jacorb.net.tcp_listener",
        // ConnectionListener.class.getName());

        // Initialize ORB
        orb = ORB.init(new String[] {}, props);

        try {
            poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
            // boot_manager =
            // BootManagerHelper.narrow(orb.resolve_initial_references("BootManager"));
        } catch (final InvalidName e) {
            throw DevFailedUtils.newDevFailed(e);
        } catch (final INITIALIZE e) {
            // ignore, occurs when starting several times a server that failed
            if (!useDb) {
                throw DevFailedUtils.newDevFailed(e);
            }
        }

        try {
            if (!useDb) {
                // If the database is not used, create a POA with the
                // USER_ID policy
                final org.omg.CORBA.Policy[] policies = new org.omg.CORBA.Policy[2];
                policies[0] = poa.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID);
                policies[1] = poa.create_lifespan_policy(LifespanPolicyValue.PERSISTENT);
                final org.omg.PortableServer.POAManager manager = poa.the_POAManager();
                poa = poa.create_POA(NODB_POA, manager, policies);
            }
        } catch (final org.omg.PortableServer.POAPackage.AdapterAlreadyExists e) {
            throw DevFailedUtils.newDevFailed(e);
        } catch (final org.omg.PortableServer.POAPackage.InvalidPolicy e) {
            throw DevFailedUtils.newDevFailed(e);
        }

        final POAManager manager = poa.the_POAManager();
        try {
            manager.activate();
        } catch (final org.omg.PortableServer.POAManagerPackage.AdapterInactive ex) {
            throw DevFailedUtils.newDevFailed("API_CantActivatePOAManager", "The POA activate method throws an exception");
        }

        if (useDb) {

            // Build device name and try to import it from database
            final DeviceImportInfo importInfo = DatabaseFactory.getDatabase().importDevice(adminDeviceName);
            if (importInfo.isExported()) {
                LOGGER.debug("{} is set as exported in tango db - checking if it is already running", adminDeviceName);
                // if is exported, try to connect to it
                ORBManager.checkServerRunning(importInfo, adminDeviceName);
            }
        }
    }
379123
public function initialize()
    {
        $this->initializeConnections();
        $this->_table and $this->setSource($this->_table);
        $this->keepSnapshots(true);
    }
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();
    }
464722
private void initCtrlAccess(final Connection connection) throws DevFailed {
		if (connection.url.use_db && connection.check_access && !connection.check_access_done) {

	    	connection.access = ApiUtil.get_db_obj(connection.url.host, connection.url.strPort)
		    	.checkAccessControl(connection.devname, connection.url);

	    	//System.out.println(connection.devname + " -> " +
	    	// ((connection.access==TangoConst.ACCESS_READ)? "Read" : "Write"));

		} else {
	    	connection.access = TangoConst.ACCESS_WRITE;
		}
		connection.check_access_done = true;
    }
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;
    }
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);
		 }
    }
1363690
@Override
    public void onCreate(SQLiteDatabase db) {
        try {
            if(builder.tables == null){
                throw new SQLiteHelperException("The array of String tables can't be null!!");
            }
            executePragma(db);

            builder.onCreateCallback.onCreate(db);
        } catch (SQLiteHelperException e) {
            Log.e(this.getClass().toString(), Log.getStackTraceString(e), e);
        }
    }
25855
public void deleteClassPipeProperties(Database database, String className,
                                         String pipeName, List<String> propertyNames) throws DevFailed {

        String[]    array = new String[propertyNames.size()+2];
        int i=0;
        array[i++] = className;
        array[i++] = pipeName;
        for (String propertyName : propertyNames)
            array[i++] = propertyName;
        DeviceData  argIn = new DeviceData();
        argIn.insert(array);
        database.command_inout("DbDeleteClassPipeProperty", argIn);
    }