OSGI의 AspectJ LoadTimeWeaving (AspectJ LoadTimeWeaving on OSGI)


문제 설명

OSGI의 AspectJ LoadTimeWeaving (AspectJ LoadTimeWeaving on OSGI)

저는 OSGI에서 춘분 jar(org.aspectj.runtime, org.aspectj.weaver, org.eclipse.equinox.weaving.aspectj의 번들 폴더 및 https://wiki.eclipse.org/Equinox_Weaving_QuickStart

번들의 로드 순서는 다음과 같습니다.

[org.eclipse.equinox.weaving.hook::1 ‑> INSTALLED]
[org.aspectj.runtime::11 ‑> INSTALLED]
[org.aspectj.weaver::12 ‑> INSTALLED]
[org.eclipse.equinox.weaving.aspectj::13 ‑> INSTALLED]
[com.common‑calculations_2.11::19 ‑> INSTALLED] //here I used aspects
[com.instrumentation_2.11::48 ‑> INSTALLED] //here I defined the aspects 
Done installing bundles
Starting bundles...
[org.eclipse.equinox.weaving.aspectj::13 ‑> ACTIVE]
[org.aspectj.runtime::11 ‑> ACTIVE]
[org.eclipse.osgi::0 ‑> ACTIVE]
 FRAGMENT Bundle ‑ skip starting: org.eclipse.equinox.weaving.hook
 FRAGMENT Bundle ‑ skip starting: org.aspectj.runtime
[org.aspectj.weaver::12 ‑> ACTIVE]
 FRAGMENT Bundle ‑ skip starting: org.eclipse.equinox.weaving.aspectj
 Bundle started: [com.common‑calculations_2.11::19 ‑> ACTIVE]
 Bundle started: [com.instrumentation_2.11::48 ‑> ACTIVE]

후크 항아리를 어떻게 시작해야 하는지 알고 싶습니다. 도움을 주시면 감사하겠습니다... ps 누군가 "org.eclipse.osgi" 번들과 "org.eclipse.equinox.weaving.hook" 조각을 "


참조 솔루션

방법 1:

Once I wrote a bigger article on this topic on my blog when I faced the issue at my job for a railroad traffic control application. It still runs with aspects at its core functionality ‑ not just for call tracing, but for automatic resource and transaction handling for JPA and thread safety aspects and so on (so I know the solution still work in real life at my former project):

http://ballmerpeak.web.elte.hu/devblog/setting‑up‑aspect‑oriented‑programming‑with‑equinox‑osgi‑and‑ajdt.html

Self‑contained example code is provided at my github:

https://github.com/prenex/equinox_osgi_skeleton

I also add our email's content here if it might help others:

" Hi!

It was a bit time ago when I worked on the topic but surely it was working well for us and still is part of a plugin‑based railroad traffic control application.

For your problem:

1.) Did you put the equinox.weaving.hook bundle near the core org.eclipse.osgi bundle? There were some not‑so‑clear stuff like this requirement the last time I worked on it that is why I wrote it down in a blog post. 2.) Did you try my example code from the following link?

https://github.com/prenex/equinox_osgi_skeleton

I would first try to run this example project of mine which already contains AspectJ in it and then compare your solution line‑by‑line at relevant places until it start to work.

Look at the following commit to see what I changed in a generic equinox+osgi skeleton project to add simple AspectJ support: https://github.com/prenex/equinox_osgi_skeleton/commit/882d7765f31a3fc8ee136e88b689fce116a73d1c

Best regards, Richard Thier

PS.: How did you stumble upon my blog? I am happy someone actually read it and find it helpful even if it does not completely solve all their problems. :‑) "

(by Shico Renprenex)

참조 문서

  1. AspectJ LoadTimeWeaving on OSGI (CC BY‑SA 2.5/3.0/4.0)

#equinox #load-time-weaving #osgi #aspectj #osgi-fragment






관련 질문

Eclipse에서 OSGi 래퍼 번들을 실행할 수 없습니다. .jar은 잘 빌드되고 있지만 파일을 대상/클래스에 복사하려면 어떻게 해야 합니까? (Can't run OSGi wrapper bundle in Eclipse; .jar is building okay, but how do I also copy files into target/classes?)

최대 절전 모드 5.0 + 춘분 4.5.0 및 사용자 정의 UserType (hibernate 5.0 + equinox 4.5.0 and custom UserType)

Domino에 OSGi 서블릿 배치(IBM 프리젠테이션) - 404 오류 (Deploying OSGi Servlet to Domino (IBM presentation) - 404 error)

Java 7을 사용하여 Equinox 3.8.2 프로젝트 컴파일 (Compile Equinox 3.8.2 Project with java 7)

OSGI 애플리케이션에서 EntityManager를 제공하는 모범 사례 (Best practice to provide EntityManager in OSGI applications)

Eclipse RCP 제품 파일 - 플랫폼별 종속성이 있는 여러 플랫폼을 처리하는 방법 (Eclipse RCP Product File - how to handle multiple platforms with platform specific dependencies)

OSGI 번들이 설치 및 시작되었지만 출력이 표시되지 않음 (OSGI Bundle Installed and Started but no visible output)

Jetty 서버의 포트(Equinox OSGi) (Port in Jetty server (Equinox OSGi ))

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

OSGi 가져오기 버전 제한을 동적으로 설정하시겠습니까? (Setting OSGi import version restrictions dynamically?)

OSGI의 AspectJ LoadTimeWeaving (AspectJ LoadTimeWeaving on OSGI)

user.home 디렉토리에 쓰지 못하도록 Eclipse 위치를 어떻게 수정합니까? (How modify Eclipse locations to prevent write to user.home directory?)







코멘트