Set the field or file that owns this listener.
@param owner My owner.
169604
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            BaseField field = m_field;
            if (field != null)
                if (field.getRecord() != owner)
            {   // Points to different file... make sure this is removed if the other file is closed
                field.addListener(new FieldRemoveBOnCloseHandler(this));
            }
        }
    }
303432
public void setOwner(String src, String username, String groupname
                      ) throws IOException {
    checkOpen();
    clearFileStatusCache();
    
    try {
      namenode.setOwner(src, username, groupname);
    } catch(RemoteException re) {
      throw re.unwrapRemoteException(AccessControlException.class,
                                     FileNotFoundException.class);
    }
  }
336836
private void visit_OP_SET_OWNER() throws IOException {
    visitTxId();
    v.visitStringUTF8(EditsElement.PATH);
    v.visitStringUTF8(EditsElement.USERNAME);
    v.visitStringUTF8(EditsElement.GROUPNAME);
  }
1181330
public function setOwner(HTML_QuickForm2_Node $owner)
    {
        if (!$owner instanceof HTML_QuickForm2_Container) {
            throw new HTML_QuickForm2_InvalidArgumentException(
                'Each Rule can only validate Containers, '.
                get_class($owner) . ' given'
            );
        }
        parent::setOwner($owner);
    }
346075
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            if (m_converterSource == null)
                m_converterSource = this.getOwner();
            if (m_converterDest != null)
                if (m_converterDest.getField() != null)
                    if (m_converterSource.getField() == this.getOwner())    // Always!
                        if (((BaseField)m_converterDest.getField()).getRecord() != this.getOwner().getRecord())
            { // Not same file, if target file closes, remove this listener!
                ((BaseField)m_converterDest.getField()).getRecord().addListener(new FileRemoveBOnCloseHandler(this));
            }
        }
        else if (m_bFreeChainedConverters)
        {   // Free all the converters in the chain
            while ((m_converterDest != null) && (m_converterDest != m_converterDest.getField()))
            {
                Converter converterNext = null;
                if (m_converterDest instanceof FieldConverter)
                    converterNext = ((FieldConverter)m_converterDest).getNextConverter();
                m_converterDest.free();
                m_converterDest = converterNext;
            }
            while ((m_converterSource != null) && (m_converterSource != m_converterSource.getField()))
            {
                Converter converterNext = null;
                if (m_converterSource instanceof FieldConverter)
                    converterNext = ((FieldConverter)m_converterSource).getNextConverter();
                m_converterSource.free();
                m_converterSource = converterNext;
            }
        }
    }
1258822
public function setOwner(HTML_QuickForm2_Node $owner)
    {
        if (!$owner instanceof HTML_QuickForm2_Element_InputFile) {
            throw new HTML_QuickForm2_InvalidArgumentException(
                'MimeType Rule can only validate file upload fields, '.
                get_class($owner) . ' given'
            );
        }
        parent::setOwner($owner);
    }
476103
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            MoveOnValidHandler moveBehavior = null;
            m_record.setOpenMode(m_record.getOpenMode() | DBConstants.OPEN_CACHE_RECORDS);    // Cache recently used records.
            
            m_bMoveBehavior = false;    // This flag is set automatically if the Valid record listener has to be used
            
            ReadSecondaryHandler listenerDup = (ReadSecondaryHandler)this.getOwner().getListener(this.getClass());
            while ((listenerDup != this) && (listenerDup != null))
            {
                if (listenerDup.getRecord() == this.getRecord())
                    if (listenerDup.getActualKeyArea() == this.getActualKeyArea())
                {
                    listenerDup.setRecord(null);
                    this.getOwner().removeListener(listenerDup, true); // Make sure there is only one
                    break;
                }
                listenerDup = (ReadSecondaryHandler)listenerDup.getListener(this.getClass());
            }
            
            this.fieldChanged(DBConstants.DISPLAY, DBConstants.READ_MOVE);    // SCREEN_MOVE says this is coming from here

            if (owner instanceof ReferenceField)
            {
                m_keyField = m_record.getKeyArea(keyAreaName).getField(DBConstants.MAIN_KEY_FIELD);   // Handle field (note - null keyAreaName -> counter field)
                moveBehavior = new MoveOnValidHandler(((BaseField)owner), m_keyField, null, true, true);        // Its okay to sync the key with references
                m_keyField = null;
            } 
            else
            {
                MainReadOnlyHandler listener = new MainReadOnlyHandler(keyAreaName);
                m_keyField = m_record.getKeyArea(keyAreaName).getField(DBConstants.MAIN_KEY_FIELD);
                m_keyField.addListener(listener); //    Make sure this field has the BaseListener to read it's file
                    // Make sure you move the key field to this field!!
                moveBehavior = new MoveOnValidHandler(((BaseField)owner), m_keyField, null, false, true);
            } 
            m_record.addListener(moveBehavior);
        }
        else
        {
            if (m_bCloseOnFree) if (this.getDependentListener() != null) // If close and file is still open
            {
                this.setDependentListener(null);    // If case you want to delete me!
                if (m_record != null)
                    m_record.free();  // File is still open, and my listener is still there, close it!
            }
            m_record = null;
            m_keyField = null;
        }
    }
970390
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
        {
            InitFieldHandler behavior = (InitFieldHandler)this.getOwner().getListener(InitFieldHandler.class.getName());
            if (this.getOwner().getRecord().getEditMode() == DBConstants.EDIT_CURRENT)
                behavior = null;    // Special case - if there is a current record, make sure initonce works.
            if (behavior != null)
                this.setFirstTime(false);  // If InitFieldHandler already set the initial value, don't set the first time.
        }
    }
537423
public void init(ListenerOwner owner)
    {
        m_owner = owner;
        m_nextListener = null;
        m_bEnabled = true;
        m_dependentListener = null;
        m_dependentStateListener = null;
        if (owner != null)
            owner.addListener(this);
    }
415003
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
            if (m_fldTarget == null)
                if (m_fsTarget != null)
                    m_fldTarget = this.getOwner().getField(m_fsTarget);
    }
400847
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner == null)
            return;
        if (m_recordMain != null)
        {   // If they are using the main record, then make sure the key area is correct.
            ReferenceField fieldThisRecord = this.getOwner().getReferenceField(m_recordMain);
            if (fieldThisRecord != null)
                if (fieldThisRecord.getReferenceRecord(null, false) == null)
                    fieldThisRecord.setReferenceRecord(m_recordMain);   // Make sure these are linked
            this.getOwner().setKeyArea(fieldThisRecord);
            // Listen carefully:
            // If the main record belongs to another screen and the screen is closed,
            // do not change the sub-field.
            if (fieldThisRecord != null)
                if (this.getOwner().getRecordOwner() != null)
                    if (m_recordMain.getRecordOwner() != null)
                        if (this.getOwner().getRecordOwner() != m_recordMain.getRecordOwner())
                            fieldThisRecord.addListener(new InitIfSubFieldHandler(null));
        }
        else if (m_fldThisFile == null)
        {
            if (m_strKeyName == null)
                m_strKeyName = this.getOwner().getKeyArea().getKeyName();
            if (m_strKeyName != null)
            {
            	this.getOwner().setKeyArea(m_strKeyName);
            	if (m_fldMainFile != null)
            		m_fldThisFile = this.getOwner().getKeyArea().getField(0);
            	if (m_fldMainFile2 != null)
            		m_fldThisFile2 = this.getOwner().getKeyArea().getField(1);
            	if (m_fldMainFile3 != null)
            		m_fldThisFile3 = this.getOwner().getKeyArea().getField(2);
            }
        }
    }
1305677
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_recordToSync != null)
        {
            if (!m_recordToSync.getBaseRecord().getTableNames(false).equals(this.getOwner().getBaseRecord().getTableNames(false)))
            {   // Must be the same base tables!
                m_recordToSync = null;
                return;
            }
            m_recordToSync.addListener(new FileRemoveBOnCloseHandler(this));
        }
    }
980439
public function setOwner($user)
    {
        // Note: We need to do a bit of uuid juggling here, because we can't bind the workspaces Owner to a specific
        // implementation, and creating entity relations via interfaces is not supported by Flow. Since the property
        // mapper will call setOwner() with a string parameter (because the property $owner is string), but developers
        // will want to use objects, we need to support both.
        if ($user === null || $user === '') {
            $this->owner = null;
            return;
        }
        if (is_string($user) && preg_match('/^([a-f0-9]){8}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){12}$/', $user)) {
            $this->owner = $user;
            return;
        }
        if (!$user instanceof UserInterface) {
            throw new \InvalidArgumentException(sprintf('$user must be an instance of UserInterface, %s given.', gettype($user)), 1447764244);
        }
        $this->owner = $this->persistenceManager->getIdentifierByObject($user);
    }
63385
public void setOwner(ListenerOwner owner)
    {
        if (owner == null)
        {
            if (m_messageListener != null)
            {
                m_messageListener.free();
                m_messageListener = null;
            }
        }
        super.setOwner(owner);
        if (owner != null)
        {
            Record record = this.getOwner().getRecord();
            MessageManager messageManager = ((Application)record.getTask().getApplication()).getMessageManager();
            if (messageManager != null)
            {
                BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, this, null);
                messageManager.addMessageFilter(messageFilter);
                m_messageListener = new  WaitForFieldChangeMessageListener(messageFilter, this);
                record.setupRecordListener(m_messageListener, false, false);   // I need to listen for record changes
            }
        }            
    }
546420
protected void setOwnerId(Integer id){
        if(getOwnerId() != null){
            logger.warn("Attempting to set owner id for an object where it as previously been set. Ignoring new id");
            return;
        }
        meta_put(OWNER_ID_KEY, id); // dont allow null
    }
111368
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            if (m_fldValue1 != null)
                if (m_fldValue1.getRecord() != this.getOwner().getRecord())
                    m_fldValue1.addListener(new FieldRemoveBOnCloseHandler(this));      // Not same file, if target file closes, remove this listener!
            if (m_fldValue2 != null)
                if (m_fldValue2.getRecord() != this.getOwner().getRecord())
                if (m_fldValue2.getRecord() != m_fldValue1.getRecord())
                    m_fldValue2.addListener(new FieldRemoveBOnCloseHandler(this));      // Not same file, if target file closes, remove this listener!
        }
    }
1097255
public function withOwner($owner, callable $callback, $args = [])
    {
        try {
            $this->setOwner($owner);
            return $callback(...$args);
        } finally {
            $this->clearOwner();
        }
    }