public static < T > T createInstance ( T impl , String name , String category , String subsystem , IOnDemandCallHandler handler , IOnDemandStatsFactory < ? extends IStats > statsFactory , boolean attachLoggers , Class < T > interf , Class < ? > ... additionalInterfaces ) { if ( name == null ) name = extractName ( interf ) ; Class < ? > [ ] interfacesParameter = mergeInterfaces ( interf , additionalInterfaces ) ; @ SuppressWarnings ( "unchecked" ) final MoskitoInvokationProxy proxy = new MoskitoInvokationProxy ( impl , handler , statsFactory , name + ' ' + getInstanceCounter ( name ) , category , subsystem , interfacesParameter ) ; @ SuppressWarnings ( "unchecked" ) T ret = ( T ) proxy . createProxy ( ) ; if ( attachLoggers ) { LoggerUtil . createSLF4JDefaultAndIntervalStatsLogger ( proxy . getProducer ( ) ) ; } return ret ; }
Creates a new proxied instance for an existing implementation .