@@ -274,27 +274,30 @@ public <T> T getRepository(Class<T> repositoryInterface, RepositoryFragments fra
274
274
logger .debug (LogMessage .format ("Initializing repository instance for %s…" , repositoryInterface .getName ()));
275
275
}
276
276
277
- ApplicationStartup applicationStartup = getStartup ();
278
-
279
277
Assert .notNull (repositoryInterface , "Repository interface must not be null!" );
280
278
Assert .notNull (fragments , "RepositoryFragments must not be null!" );
281
279
280
+ ApplicationStartup applicationStartup = getStartup ();
281
+
282
282
StartupStep repositoryInit = applicationStartup .start ("spring.data.repository.init" );
283
283
284
284
StartupStep repositoryMetadataStep = applicationStartup .start ("spring.data.repository.metadata" );
285
285
RepositoryMetadata metadata = getRepositoryMetadata (repositoryInterface );
286
286
repositoryMetadataStep .end ();
287
287
288
- StartupStep repositoryCompositionStep = applicationStartup .start ("spring.data.repository.metadata " );
288
+ StartupStep repositoryCompositionStep = applicationStartup .start ("spring.data.repository.composition " );
289
289
RepositoryComposition composition = getRepositoryComposition (metadata , fragments );
290
290
RepositoryInformation information = getRepositoryInformation (metadata , composition );
291
291
repositoryCompositionStep .end ();
292
292
293
293
validate (information , composition );
294
294
295
+ StartupStep repositoryTargetStep = applicationStartup .start ("spring.data.repository.target" );
295
296
Object target = getTargetRepository (information );
297
+ repositoryTargetStep .end ();
296
298
297
299
// Create proxy
300
+ StartupStep repositoryProxyStep = applicationStartup .start ("spring.data.repository.proxy" );
298
301
ProxyFactory result = new ProxyFactory ();
299
302
result .setTarget (target );
300
303
result .setInterfaces (repositoryInterface , Repository .class , TransactionalProxy .class );
@@ -323,10 +326,11 @@ public <T> T getRepository(Class<T> repositoryInterface, RepositoryFragments fra
323
326
result .addAdvice (new ImplementationMethodExecutionInterceptor (information , composition , methodInvocationListeners ));
324
327
325
328
T repository = (T ) result .getProxy (classLoader );
329
+ repositoryProxyStep .end ();
326
330
327
331
if (logger .isDebugEnabled ()) {
328
- logger
329
- . debug ( LogMessage . format ( "Finished creation of repository instance for {}." , repositoryInterface .getName ()));
332
+ logger . debug ( LogMessage . format ( "Finished creation of repository instance for {}." ,
333
+ repositoryInterface .getName ()));
330
334
}
331
335
332
336
repositoryInit .end ();
@@ -336,7 +340,11 @@ public <T> T getRepository(Class<T> repositoryInterface, RepositoryFragments fra
336
340
ApplicationStartup getStartup () {
337
341
338
342
try {
339
- ApplicationStartup applicationStartup = beanFactory != null ? beanFactory .getBean (ApplicationStartup .class ) : ApplicationStartup .DEFAULT ;
343
+
344
+ ApplicationStartup applicationStartup = beanFactory != null
345
+ ? beanFactory .getBean (ApplicationStartup .class )
346
+ : ApplicationStartup .DEFAULT ;
347
+
340
348
return applicationStartup != null ? applicationStartup : ApplicationStartup .DEFAULT ;
341
349
}
342
350
catch (NoSuchBeanDefinitionException e ) {
0 commit comments