@ SuppressWarnings ( "unchecked" ) protected < E extends R > List < E > buildComponentList ( final UniqueKey < E > uniqueKey ) throws CoreException { // Build a new instance of the component final List < E > readyObjectList = globalFacade ( ) . componentFactory ( ) . buildComponents ( uniqueKey . classField ( ) ) ; for ( final E readyObject : readyObjectList ) { // Retrieve the right event type to track JRebirthEventType type = JRebirthEventType . NONE ; if ( readyObject instanceof Model ) { type = JRebirthEventType . CREATE_MODEL ; } else if ( readyObject instanceof Service ) { type = JRebirthEventType . CREATE_SERVICE ; } else if ( readyObject instanceof Command ) { type = JRebirthEventType . CREATE_COMMAND ; } // Track this instantiation event globalFacade ( ) . trackEvent ( type , this . getClass ( ) , readyObject . getClass ( ) ) ; // Attach the local facade // Already Done by register method readyObject . localFacade ( this ) ; UniqueKey < E > readyKey = null ; if ( uniqueKey instanceof MultitonKey ) { final Object keyPart = ( ( MultitonKey < ? > ) uniqueKey ) . value ( ) ; readyKey = ( UniqueKey < E > ) Key . createMulti ( readyObject . getClass ( ) , keyPart instanceof List ? ( ( List < ? > ) keyPart ) . toArray ( ) : new Object [ ] { keyPart } , uniqueKey . optionalData ( ) . toArray ( ) ) ; } else if ( uniqueKey instanceof ClassKey ) { readyKey = ( UniqueKey < E > ) Key . createSingle ( readyObject . getClass ( ) , uniqueKey . optionalData ( ) . toArray ( ) ) ; } readyKey . registrationKey ( uniqueKey ) ; // Create the unique key readyObject . key ( ( UniqueKey < R > ) readyKey ) ; } // EnhancedComponent Ready ! return readyObjectList ; }
Build a new instance of the ready object class .