@SuppressWarnings("unchecked")
    @Override
    public <E extends R> void register(final UniqueKey<E> registrationKey, final E readyObject) {

        // Synchronize the registration
        synchronized (this.componentMap) {

            // Set the key if not set before otherwise does nothing because the registrationKey can be different from the real component key
            if (readyObject.key() == null) {
                readyObject.key((UniqueKey<R>) registrationKey);
            }

            // Attach the facade to allow to retrieve any components
            readyObject.localFacade(this);
            if (!this.componentMap.containsKey(registrationKey)) {
                final Set<R> weakHashSet = Collections.newSetFromMap(new WeakHashMap<R, Boolean>());
                // Store the component into the singleton map
                this.componentMap.put(registrationKey, weakHashSet);
            }
            this.componentMap.get(registrationKey).add(readyObject);
        }

    }
@ SuppressWarnings ( "unchecked" ) @ Override public < E extends R > void register ( final UniqueKey < E > registrationKey , final E readyObject ) { synchronized ( this . componentMap ) { if ( readyObject . key ( ) == null ) { readyObject . key ( ( UniqueKey < R > ) registrationKey ) ; } readyObject . localFacade ( this ) ; if ( ! this . componentMap . containsKey ( registrationKey ) ) { final Set < R > weakHashSet = Collections . newSetFromMap ( new WeakHashMap < R , Boolean > ( ) ) ; this . componentMap . put ( registrationKey , weakHashSet ) ; } this . componentMap . get ( registrationKey ) . add ( readyObject ) ; } }
{@inheritDoc}