Osgi Basics PDF
Osgi Basics PDF
S Y S T E M I N T E G R AT I O N W I T H J B O S S
<plugin>
<groupId>org.apache.felix</groupId>
<ar tifactId>maven-bundle-plugin</ar tifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Activator>org.wikipedia.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
IMPORT PACK. PRIORITIES
RESOLVED bundle state has precedence before INSTALLED
Greater versions have precedence
Property match (e.g. vendor="sun")
Directive "uses:=<package-name>"
p u b l i c i n t e r f a c e B u n d l e L i s t e n e r ex t e n d s Eve n t L i s t e n e r {
p u b l i c vo i d b u n d l e C h a n g e d ( B u n d l e Eve n t e ve n t ) ;
}
Service listener
Tracks service events (REGISTERED, MODIFIED, ...)
Used in ServiceTracker (advanced service monitoring)
p u b l i c i n t e r f a c e S e r v i c e L i s t e n e r ex t e n d s Eve n t L i s t e n e r {
p u b l i c vo i d s e r v i c e C h a n g e d ( S e r v i c e Eve n t e ve n t ) ;
}
</beans>
OSGI ENTERPRISE
Web applications
web.xml
Web-ContextPath in MANIFEST.MF
Dependency Injection
Blueprint
Spring
JNDI
osgi:service/<interface>[/<proper ties>]
Service proper ty "osgi.jndi.service.name" for custom JNDI names
osgi:service/<jndi-name>
JPA, JDBC
problems with dynamic classpath
solution: OSGi services (Datasources, EntityManagers)
persistence.xml ("Meta-Persistence" in MANIFEST.MF)
container/aplication managed
JTA
container/aplication managed
OSGI ENTERPRISE (2)
Blueprint + JPA + Transactions