OSGI(Apache Felix)에서 다른 사람의 번들에 대해 AOP를 구현하는 방법은 무엇입니까? (How to implement AOP for someone else's bundles in OSGI (Apache Felix)?)


문제 설명

OSGI(Apache Felix)에서 다른 사람의 번들에 대해 AOP를 구현하는 방법은 무엇입니까? (How to implement AOP for someone else's bundles in OSGI (Apache Felix)?)

OSGI(Apache Felix)

에서 다양한 번들의 클래스에 대해 AOP를 추가하고 싶습니다.

Aspect</를 생성해야 합니다. strong> 및 각 구현별 인터페이스의 메소드에 교차 기능을 추가합니다. (help aspectj와 함께 선호)

문제:

  • 서로 다른 번들에서 목표 인터페이스의 모든 구현
  • 각 번들 자체 클래스 경로가 있습니다.
  • 우리는 마녀 번들에 인터페이스 구현이 있는지 모릅니다

도와주세요 8)


참조 솔루션

방법 1:

OSGi has a Weavinghook that allows you to intercept class loading. This hook allows you to inspect the byte code and modify it before it becomes a class. It also allows you to add imports.

방법 2:

The OSGi weavinghooks specification that covers weaving of classes for adding aspects.

Here is an example of how to use it. The example uses asm but I am pretty sure you can adapt it for aspectj.

Another example uses aspectj but does not have much doc and also misses a command line build.

(by vvatorPeter KriensChristian Schneider)

참조 문서

  1. How to implement AOP for someone else's bundles in OSGI (Apache Felix)? (CC BY‑SA 2.5/3.0/4.0)

#apache-felix #aop #osgi #aspectj #java






관련 질문

Apache Felix 웹 콘솔 브랜딩 (Branding Apache Felix web console)

포함된 Apache Felix를 시작할 수 없습니다. (Cannot start embeded Apache Felix)

Glassfish OSGI 웹 콘솔 자격 증명 (Glassfish OSGI Webconsole Credentials)

Android에 OSGi Felix 포함 (Embed OSGi Felix in Android)

Amdatu OSGI 이벤트 처리기 다른 수신기가 수신 대기 중일 때 수신 대기 시간 지연 (Amdatu OSGI Event Handler time delay to listen when other listener are listening)

OSGi 번들이 Felix 호스트 응용 프로그램으로 시작되지 않음 (OSGi Bundle not starting with Felix Host application)

임베디드 osgi 프레임워크, 서비스 기능을 호출하는 방법은 무엇입니까? (Embedded osgi framework, how to call service functions?)

kaldi 설치 시 libmkl_tbb_thread.so sth 관련 문제 (A problem related to libmkl_tbb_thread.so sth when installing kaldi)

OSGI(Apache Felix)에서 다른 사람의 번들에 대해 AOP를 구현하는 방법은 무엇입니까? (How to implement AOP for someone else's bundles in OSGI (Apache Felix)?)

OSGi r4.1의 ServiceTracker (ServiceTracker in OSGi r4.1)

번들 OSGI를 업데이트하는 동안 서비스/구성 요소를 계속 실행하는 방법 (How to keep service/componnet running while update bundle OSGI)

Equinox에서 Arquillian 실행 (Running Arquillian in Equinox)







코멘트