Registers an object with the framework and relevant subsystems (e.g., the context manager).

@param object Object to register
@return True if object successfully registered. False if object was already registered.
353152
public synchronized boolean registerObject(Object object) {
        if (!MiscUtil.containsInstance(registeredObjects, object)) {
            if (object instanceof IRegisterEvent) {
                IRegisterEvent onRegister = (IRegisterEvent) object;
                onRegisterList.add(onRegister);
                
                for (Object obj : registeredObjects) {
                    onRegister.registerObject(obj);
                }
            }
            
            registeredObjects.add(object);
            
            for (IRegisterEvent onRegister : onRegisterList) {
                onRegister.registerObject(object);
            }
            
            return true;
        }
        
        return false;
    }
24080
public function unregisterModel(PortableElementObject $object){
        $registry = $object->getModel()->getRegistry();
        $registry->delete($object);
        return true;
    }
267364
def register(self, obj, autogenerate=False):
        
        scope = self._scope

        # register a module
        if type(obj).__name__ == 'module':
            for key, value in vars(obj).items():
                # register a climethod
                if isinstance(value, climethod):
                    value.interface = self
                    scope[key] = value

                # register a function
                elif inspect.isfunction(value) and autogenerate:
                    meth = climethod(value)
                    meth.interface = self
                    scope[key] = meth

        # register a climethod
        elif isinstance(obj, climethod):
            obj.interface = self
            scope[obj.__name__] = obj

        # register a function
        elif inspect.isfunction(obj) and autogenerate:
            meth = climethod(obj)
            meth.interface = self
            scope[meth.__name__] = meth
1276649
public final <T> void registerProperty(Class<T> object, String property, Function<T, Object> function) {
        PropertyProvider extender = extenderMap.computeIfAbsent(object,
                aClass -> new PropertyProviderImpl());
        extender.register(property, function);
    }
671083
@Override
    public void registerObject(Object object) {
        if (object instanceof ICareWebStartup) {
            startupRoutines.add((ICareWebStartup) object);
        }
    }
1190467
@Override
	public void registerUserObject(final Object iObject, final ORecordInternal<?> iRecord) {
		if (!(iRecord instanceof ODocument))
			return;

		final ODocument doc = (ODocument) iRecord;

		if (retainObjects) {

			final ORID rid = iRecord.getIdentity();
			if (rid.isValid())
				rid2Records.put(rid, doc);
		}
	}
1341131
@GwtIncompatible("incompatible method")
    private static void register(final Object value) {
        Set<IDKey> registry = getRegistry();
        if (registry == null) {
            registry = new HashSet<>();
            REGISTRY.set(registry);
        }
        registry.add(new IDKey(value));
    }
795787
public final void addObject(Object object) {
        if (object instanceof Iterable) {
            // Iterable
            for (Object o : (Iterable<?>) object) {
                objects.add(o);
            }
        } else if (object.getClass().isArray()) {
            // Array
            for (Object o : (Object[]) object) {
                objects.add(o);
            }
        } else {
            // Single object
            objects.add(object);
        }
    }
686971
public synchronized void lockAndRegister(RuntimeObject rtObject, int lockMode, boolean cascade, List registeredObjects)
    {
        if(log.isDebugEnabled()) log.debug("Lock and register called for " + rtObject.getIdentity());
        // if current object was already locked, do nothing
        // avoid endless loops when circular object references are used
        if(!registeredObjects.contains(rtObject.getIdentity()))
        {
            if(cascade)
            {
                // if implicite locking is enabled, first add the current object to
                // list of registered objects to avoid endless loops on circular objects
                registeredObjects.add(rtObject.getIdentity());
                // lock and register 1:1 references first
                //
                // If implicit locking is used, we have materialize the main object
                // to lock the referenced objects too
                lockAndRegisterReferences(rtObject.getCld(), rtObject.getObjMaterialized(), lockMode, registeredObjects);
            }
            try
            {
                // perform the lock on the object
                // we don't need to lock new objects
                if(!rtObject.isNew())
                {
                    doSingleLock(rtObject.getCld(), rtObject.getObj(), rtObject.getIdentity(), lockMode);
                }
                // after we locked the object, register it to detect status and changes while tx
                doSingleRegister(rtObject, lockMode);
            }
            catch (Throwable t)
            {
                //log.error("Locking of obj " + rtObject.getIdentity() + " failed", t);
                // if registering of object fails release lock on object, because later we don't
                // get a change to do this.
                implementation.getLockManager().releaseLock(this, rtObject.getIdentity(), rtObject.getObj());
                if(t instanceof LockNotGrantedException)
                {
                    throw (LockNotGrantedException) t;
                }
                else
                {
                    log.error("Unexpected failure while locking", t);
                    throw new LockNotGrantedException("Locking failed for "
                            + rtObject.getIdentity()+ ", nested exception is: [" + t.getClass().getName()
                            + ": " + t.getMessage() + "]");
                }
            }
            if(cascade)
            {
                // perform locks and register 1:n and m:n references
                // If implicit locking is used, we have materialize the main object
                // to lock the referenced objects too
                lockAndRegisterCollections(rtObject.getCld(), rtObject.getObjMaterialized(), lockMode, registeredObjects);
            }
        }
    }
554371
public void unregister( ActiveObject object )
	{
		synchronized (watchList)
		{
			for (int i = 0; i < watchList.size(); i++)
			{
				WeakReference<ActiveObject> weakRef = watchList.get(i);
				ActiveObject obj = weakRef.get();
				if (obj == null)
				{
					// Object was garbage collected, remove and continue
					watchList.remove(i--);
					continue;
				}
				
				if (obj == object)
				{
					// Found it !
					watchList.remove(i);
					break;
				}
			}
		}
	}
48086
public function registerObject($service, $object)
    {
		if (!is_object($object)) {
			throw new ResolutionException("Service '$service' cannot be register as it's value is invalid");
		}

        $this->services[$service] = function () use ($object) { return $object; };
    }
188371
public static boolean isForgeProxy(Object object)
   {
      if (object != null)
      {
         Class<?>[] interfaces = object.getClass().getInterfaces();
         if (interfaces != null)
         {
            for (Class<?> iface : interfaces)
            {
               if (iface.getName().equals(ForgeProxy.class.getName()))
               {
                  return true;
               }
            }
         }
      }
      return false;
   }
214463
public function register($key, $object)
	{
		$this->_registry[$key] = $this->_memoize($object);
		return $this;
	}
209351
@GwtIncompatible("incompatible method")
    private static void register(final Object lhs, final Object rhs) {
        Set<Pair<IDKey, IDKey>> registry = getRegistry();
        if (registry == null) {
            registry = new HashSet<>();
            REGISTRY.set(registry);
        }
        final Pair<IDKey, IDKey> pair = getRegisterPair(lhs, rhs);
        registry.add(pair);
    }
532057
public synchronized ObjectName register(Object obj) throws JMException {
		if (mbeanServer == null) {
			throw new JMException("JmxServer has not be started");
		}
		ObjectName objectName = ObjectNameUtil.makeObjectName(obj);
		ReflectionMbean mbean;
		try {
			mbean = new ReflectionMbean(obj, getObjectDescription(obj));
		} catch (Exception e) {
			throw createJmException("Could not build MBean object for: " + obj, e);
		}
		doRegister(objectName, mbean);
		return objectName;
	}
18184
public UUID registerIfUnknown(final Object object) {
        final Optional<UUID> id = getId(object);
        if (!id.isPresent()) {
            return registerObject(object);
        }
        return id.get();
    }
1261698
public void registerListenersOnEverything(final Object object) {
        try {
            // the removeListener() call ensures that the listener is not added more than once
            new PropertyVisitor(object) {
                @Override
                protected boolean visitSingleValueProperty(final Property<?> fieldValue) {
                    fieldValue.removeListener(propertyListener);
                    fieldValue.addListener(propertyListener);
                    return true;
                }

                @Override
                protected boolean visitCollectionProperty(final ListProperty<?> fieldValue) {
                    fieldValue.removeListener(listListener);
                    fieldValue.addListener(listListener);
                    return true;
                }

                @Override
                protected boolean visitCollectionProperty(final MapProperty<?, ?> fieldValue) {
                    fieldValue.removeListener(mapListener);
                    fieldValue.addListener(mapListener);
                    return true;
                }

                @Override
                protected boolean visitCollectionProperty(final SetProperty<?> fieldValue) {
                    fieldValue.removeListener(setListener);
                    fieldValue.addListener(setListener);
                    return false;
                }
            };
        } catch (final IllegalAccessException e) {
            topology.onError(new SynchronizeFXException(e));
        } catch (final SecurityException e) {
            topology.onError(new SynchronizeFXException(
                    "Maybe you're JVM doesn't allow reflection for this application?", e));
        }
    }