Skip to content

Commit 60914d5

Browse files
committed
update for OSGi - .project
1 parent 906e317 commit 60914d5

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

content/posts/java-osgi-service.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,21 @@ public class MyComponent {
248248
Phương thức bind (bindMyService): Được gọi khi MyService có sẵn trong Service Registry.
249249
Phương thức unbind (unbindMyService): Được gọi khi service bị gỡ khỏi Registry.
250250
❗ Đây là cách tốt để xử lý service lifecycle (khi service bị remove).
251-
```
251+
```
252+
253+
## 0.
254+
`.settings/org.eclipse.pde.ds.annotations.prefs`
255+
256+
dsVersion=V1_4 # Sử dụng phiên bản Declarative Services 1.4 (OSGi R7)
257+
258+
eclipse.preferences.version=1 # Phiên bản định dạng file .prefs (mặc định của Eclipse)
259+
260+
enabled=true # Bật xử lý annotation DS (bắt buộc để sinh file XML)
261+
262+
generateBundleActivationPolicyLazy=true # Tự động thêm "Bundle-ActivationPolicy: lazy" vào MANIFEST.MF
263+
264+
path=OSGI-INF # Thư mục sẽ chứa file XML được sinh (mặc định là OSGI-INF)
265+
266+
validationErrorLevel=error # Nếu annotation sai thì hiện lỗi trong Eclipse (mức: error)
267+
268+
validationErrorLevel.missingImplicitUnbindMethod=error # Báo lỗi nếu thiếu unbind method khi dùng @Reference

0 commit comments

Comments
 (0)