0
ServiceFactoryBeanおよびServiceListFactoryBeanを使用してSPI実装インスタンスを収集し、サービスBeanに自動配線します。これらのクラスをインターセプトしてパフォーマンスを測定し、呼び出しをログするためのいくつかの側面を作成しました。ServiceListFactoryBeanオブジェクト用のプロキシを作成していない
私は、SpringがServiceFactoryBeanで取得されたインスタンスのプロキシを作成し、サービスBeanに注入されていることに気付きました。しかし、ServiceListFactoryBeanによって取得されたインスタンスのリストのプロキシは作成していません。
これらのBeanのプロキシを作成するには、どのように私の側面が働くかを春に教えてください。 SPI実装を収集し、
@Bean
public ServiceFactoryBean faceImageStorageProvider() {
ServiceFactoryBean serviceFactoryBean = new ServiceFactoryBean();
serviceFactoryBean.setServiceType(FaceImageStorageProvider.class);
return serviceFactoryBean;
}
@Bean
public ServiceListFactoryBean notificationSenders() {
ServiceListFactoryBean serviceListFactoryBean = new ServiceListFactoryBean();
serviceListFactoryBean.setServiceType(NotificationSender.class);
return serviceListFactoryBean;
}
側面をオートワイヤリングのためにそれらを公開
設定(この1作品)
@Pointcut("execution(* com.xxx.spi.storage.FaceImageStorageProvider.*(..))")
private void anyFaceImageStorageProviderAPI() {}
(この1つのdoesntの仕事 - 後
は私のコードスニペットです)
@Pointcut("execution(* com.xxx.spi.notification.NotificationSender.*(..))")
private void anyNotificationSenderAPI() {}