void connect ( Object from , String from_out , Object to , String to_in ) { // add them to the set of commands if ( from == to ) { throw new ComponentException ( "src == dest." ) ; } if ( to_in == null || from_out == null ) { throw new ComponentException ( "Some field arguments are null" ) ; } ComponentAccess ca_from = lookup ( from ) ; ComponentAccess ca_to = lookup ( to ) ; Access from_access = ca_from . output ( from_out ) ; checkFA ( from_access , from , from_out ) ; Access to_access = ca_to . input ( to_in ) ; checkFA ( to_access , to , to_in ) ; if ( ! canConnect ( from_access , to_access ) ) { throw new ComponentException ( "Type/Access mismatch, Cannot connect: " + from + ' ' + to_in + " -> " + to + ' ' + from_out ) ; } // src data object FieldContent data = from_access . getData ( ) ; data . tagIn ( ) ; data . tagOut ( ) ; dataSet . add ( data ) ; to_access . setData ( data ) ; // connect the two if ( checkCircular ) { validator . addConnection ( from , to ) ; validator . checkCircular ( ) ; } if ( log . isLoggable ( Level . CONFIG ) ) { log . config ( String . format ( "@Out(%s) -> @In(%s)" , from_access . toString ( ) , to_access . toString ( ) ) ) ; } // ens.fireConnect(from_access, to_access); }
Connect out to in