Europe
vrijdag 26 juni 2009
vrijdag 26 juni 2009
OSGi Next
Peter KriensOSGi Evangelist
Europe
vrijdag 26 juni 2009
OSGi Service PlatformCore Specification
vrijdag 26 juni 2009
Planning 4.2
• Core released for approval June 10
• Working on the final draft for Compendium as we speak
• Compendium : July 10
• Enterprise Release Autumn
• Residential Release Spring 2010
vrijdag 26 juni 2009
Legend
vrijdag 26 juni 2009
Legend
BundleA
BundleB
vrijdag 26 juni 2009
Legend
BundleA
BundleB
Service
vrijdag 26 juni 2009
Legend
BundleA
BundleB
Service
getService
registerService
vrijdag 26 juni 2009
Legend
BundleA
BundleB
Service
getService
BundleC
registerService
vrijdag 26 juni 2009
Legend
BundleA
BundleB
Service
getService
BundleC
registerService
addServiceListener
vrijdag 26 juni 2009
Legend
BundleA
BundleB
Service
getService
BundleC
registerService
Call/DependencyDirection addServiceListener
vrijdag 26 juni 2009
Core
• Launching
• Bundle Tracker
• Bundle-License Header
• Service Hooks
• Negative Permissions
vrijdag 26 juni 2009
Launching
• To be inside a framework …
• Or outside a framework ...
• That’s the question!
vrijdag 26 juni 2009
Launching
• Standardizes launching different frameworks
• Will enable generic launchers
• Allows you to embed a framework in your application!
vrijdag 26 juni 2009
LaunchingMap<String,String> p = new HashMap<String,String>();
List<String> impls = getMetaInfServices(
loader, FrameworkFactory.class.getName());
if (impls.size() != 1) throw new RuntimeException( "Too many frameworks: "+ impls);
Class<?> clazz = loader.loadClass(impls.get(0)); FrameworkFactory factory = (FrameworkFactory) clazz .newInstance(); Framework fw = factory.newFramework(p); Bundle b = fw.installBundle( “http://.../load/…”); b.start();
vrijdag 26 juni 2009
Bundle Tracker
• Simple tool a la Service Tracker to track bundles
• Very useful for extenders
• Bundles that provide additional functionality based on data in a bundle
• Tracks a set of states
• Handles all concurrency issues
vrijdag 26 juni 2009
Service Hooks
• FindHook
• Intercept getServiceReference(s)
• EventHook
• Intercept Service Event delivery
• ListenerHook
• Find out who is listening to what
vrijdag 26 juni 2009
Service HooksBundle
A
BundleB
vrijdag 26 juni 2009
Service HooksBundle
A
BundleB
ProxyBundle
vrijdag 26 juni 2009
Service HooksBundle
A
BundleB
FindHookEventHook
ProxyBundle
vrijdag 26 juni 2009
Service HooksBundle
A
BundleB
FindHookEventHook
ProxyBundle
vrijdag 26 juni 2009
Service HooksBundle
A
BundleB
FindHookEventHook
ProxyBundle
ListenerHook
vrijdag 26 juni 2009
Service HooksBundle
A
BundleB
FindHookEventHook
ProxyBundle
ListenerHook
vrijdag 26 juni 2009
Negative Permissions
• Java 2 Permissions are only positive
• That is, you grant a permission P
• PackagePermission(com.acme,IMPORT)
• Very hard to say, all permissions except P
• Lack of deny permissions
vrijdag 26 juni 2009
Negative Permissions
DENY { [...BundleSignerCondition "cn=*, o=ACME" "!" ] (...PackagePermission "com.acme.secret.*" "import,exportonly" ) } ALLOW { (...PackagePermission "*" "*" ) }
vrijdag 26 juni 2009
Compendium
• Initial Provisioning
• Bundle Tracker
• Declarative Services
• Remote Services
• Blueprint Extender
vrijdag 26 juni 2009
Remote Services
• RFC 119
• Formerly Distributed OSGi
• Distribution Software uses services to:
• Maps a service to/from a remote system
• Uses a service to abstract a communication endpoint
vrijdag 26 juni 2009
Remote Services
DistributionProvider
DistributionProvider
X’
BundleB
vrijdag 26 juni 2009
Remote Services
XDistribution
ProviderDistribution
Provider
X’
BundleB
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports imports
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports imports
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports imports
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports imports
vrijdag 26 juni 2009
Remote ServicesBundle
A
XDistribution
ProviderDistribution
Provider
X’
BundleB
exports imports
Framework 1 Framework 2
vrijdag 26 juni 2009
Remote Services
• Service Properties define the interaction
• Intents specify the required/provided capabilities
• Filters used to match
• Service Component Architecture (SCA)
• Interaction specified, not mandated
• Flexible configuration options
vrijdag 26 juni 2009
Service Properties<other properties>
service.exported.intents
service.intents
service.exported.intents.extra
service.exported.interfaces
service.exported.configs
<other properties>
service.exported.intents
objectClass
service.imported.configs
service.imported
remote.intents.supported
remote.configs.supported
Distribution Provider
Framework 1 Framework 2
vrijdag 26 juni 2009
Service Properties<other properties>
service.exported.intents
service.intents
service.exported.intents.extra
service.exported.interfaces
service.exported.configs
<other properties>
service.exported.intents
objectClass
service.imported.configs
service.imported
remote.intents.supported
remote.configs.supported
Distribution Provider
Framework 1 Framework 2
vrijdag 26 juni 2009
Service Properties<other properties>
service.exported.intents
service.intents
service.exported.intents.extra
service.exported.interfaces
service.exported.configs
<other properties>
service.exported.intents
objectClass
service.imported.configs
service.imported
remote.intents.supported
remote.configs.supported
Distribution Provider
Framework 1 Framework 2
endpoint
vrijdag 26 juni 2009
Service Properties<other properties>
service.exported.intents
service.intents
service.exported.intents.extra
service.exported.interfaces
service.exported.configs
<other properties>
service.exported.intents
objectClass
service.imported.configs
service.imported
remote.intents.supported
remote.configs.supported
Distribution Provider
Framework 1 Framework 2
endpoint
vrijdag 26 juni 2009
Blueprint Extender
• RFC 124
• Provides Spring DM Functionality
• Blueprint Extender uses XML definitions in bundle to create & wire application objects
• Namespace Handler services, not yet :-(
• Provides damping
• Proxies services
vrijdag 26 juni 2009
Blueprint Extender
XML
vrijdag 26 juni 2009
Blueprint Extender
XMLBlueprintContainer
vrijdag 26 juni 2009
Blueprint Extender
XMLBlueprintContainer
vrijdag 26 juni 2009
BeanMetadata
ServiceMetadata
ReferenceMetadata
Blueprint Extender
XMLBlueprintContainer
vrijdag 26 juni 2009
BeanBeanMetadata
ServiceMetadata
ReferenceMetadata
Blueprint Extender
XMLBlueprintContainer
vrijdag 26 juni 2009
Bean
Service
BeanMetadata
ServiceMetadata
ReferenceMetadata
Blueprint Extender
XMLBlueprintContainer
vrijdag 26 juni 2009
Bean
Service
BeanMetadata
ServiceMetadata
ReferenceMetadata
Blueprint Extender
XMLBlueprintContainer
Reference
vrijdag 26 juni 2009
Bean
Service
BeanMetadata
ServiceMetadata
ReferenceMetadata
Blueprint Extender
XMLBlueprintContainer
Reference
vrijdag 26 juni 2009
Bean
Service
BeanMetadata
ServiceMetadata
ReferenceMetadata
Blueprint Extender
XMLBlueprintContainer
Reference
vrijdag 26 juni 2009
Bean
Service
BeanMetadata
ServiceMetadata
ReferenceMetadata
Blueprint Extender
XMLBlueprintContainer
Reference
vrijdag 26 juni 2009
Bean
Service
BeanMetadata
ServiceMetadata
ReferenceMetadata
Blueprint Extender
XMLBlueprintContainer
ApplicationObjects
Reference
vrijdag 26 juni 2009
Metadata
NonNull
Metadata
Null
Metadata
Component
Metadata
Service
Metadata
Service
Reference
Metadata
Bean
Metadata
Value
Metadata
Collection
Metadata
Map
Metadata
Bean
Argument
Bean
Property
ListenerRegistration
Listener
IdRef
Metadata
Ref
Metadata
Target
Props
Metadata
Reference
Metadata
Ref
Collection
Metadata
Map
Entry
vrijdag 26 juni 2009
Damping Reference
serviceobjectApp proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
serviceobjectApp proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
serviceobjectApp proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
serviceobjectApp proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
serviceobjectApp proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
serviceobjectApp proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
App proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
App proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
App proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Reference
App proxy
serviceobject
serviceobject
vrijdag 26 juni 2009
Damping Ref-list
serviceobjectApp proxy
serviceobject
serviceobject
List
proxy
proxy
vrijdag 26 juni 2009
Enterprise
• Transactions
• JDBC Database Access
• JMX
• JNDI
• JPA
• Connectors
vrijdag 26 juni 2009
Experimental
• TSL
• Nested Frameworks
• OBR
vrijdag 26 juni 2009
TSL
• A Tiny Script Language
• Feels like a shell
• Acts like a script language
• Uses reflection, but simplifies syntax
• No new commands
• Will become Felix project
vrijdag 26 juni 2009
TSLTelnetShell
ConsoleShell
...Shell
OSGiConvert.
EclipseConvert.
FelixConvert.
BasicCmnds
FrameWorkCmnds
ThreadIO
ThreadIO
CommandShell
Converter
* osgi.command.name=xxx osgi.command.function=yyy
...Cmnds
TSLImpl
vrijdag 26 juni 2009
TSL $ echo Hello World Hello World $ echo <bundle 1> initial@reference:file:org.eclipse.osgi.util_3.1.200.v20070605.jar/ [1]
$ ls eclipse eclipse.ini load runner
$ ls /Ws aQute felix-trunk osgi osgi-books
vrijdag 26 juni 2009
TSL
$ <bundle 6> headers Tool Bnd-0.0.169 Bundle-Activator aQute.fileinstall.FileInstall Export-Package aQute.fileinstall ... Created-By 1.6.0_01 (Sun Microsystems Inc.) Bnd-LastModified 1184160147361 Bundle-Version 1.3 Bundle-ManifestVersion2 Manifest-Version 1.0 Import-Package aQute.fileinstall, ... Bundle-Name biz.aQute.fileinstall Bundle-Description This bundle watches a .... Bundle-SymbolicName biz.aQute.fileinstall
vrijdag 26 juni 2009
TSL $ help={each <<$it class> declaredmethods> {$it name }} aQute.shell.runtime.Closure@90a284 $ help <bundle 6> loadClass getResource ... checkLoader closeBundleLoader getLoaderProxy
$ echo $exception E: java.lang.NullPointerException $ echo $exception java.lang.NullPointerException $ $exception printstacktrace $ // the output is temporarily on reall stderr ...
vrijdag 26 juni 2009
Nested Frameworks
• Application Server Vendors want scoping of applications …
• Basic Idea OSGi is:
• The Application == the set of installed bundles
• Compromise:
• All Frameworks to be nested
vrijdag 26 juni 2009
Framework P
Nested Frameworks
SystemBundle
vrijdag 26 juni 2009
Framework P
Nested Frameworks
SystemBundle
CompositeBundle
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle
CompositeBundle
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
CompositeBundle
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
AppBundle
A
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
AppBundle
A
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
AppBundle
A
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
AppBundle
A
AppBundle
B
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
AppBundle
A
AppBundle
B
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
AppBundle
A
AppBundle
B
vrijdag 26 juni 2009
Framework P
Nested Frameworks
Framework CSystemBundle System
Bundle
SurrogateBundle
CompositeBundle
AppBundle
A
AppBundle
B
vrijdag 26 juni 2009
Java Modularity
vrijdag 26 juni 2009
Java Modularity
294vrijdag 26 juni 2009
Java Modularity
2947
vrijdag 26 juni 2009
Java Modularity
42vrijdag 26 juni 2009
Java Modularity
vrijdag 26 juni 2009
Java Modularity
vrijdag 26 juni 2009
Java Modularity
vrijdag 26 juni 2009
Java Modularity
vrijdag 26 juni 2009
Java Modularity
vrijdag 26 juni 2009
Java Modularity
module
vrijdag 26 juni 2009
Java Modularity
module class Foo {}
public class Bar { module int foo() {}}
module interface Baz {}
vrijdag 26 juni 2009
Java Modularity
Visibilityvs
Accessibility
vrijdag 26 juni 2009
Visibility
ClassS
ClassT
ClassT
vrijdag 26 juni 2009
Visibility
ClassS
ClassT
ClassT
vrijdag 26 juni 2009
Visibility
ClassS
ClassT
vrijdag 26 juni 2009
Visibility
ClassS
ClassT
vrijdag 26 juni 2009
Visibility
ClassS
ClassT
vrijdag 26 juni 2009
Visibility
ClassS
ClassT
ModuleSystem
vrijdag 26 juni 2009
Accessibility
public
package
module
private
vrijdag 26 juni 2009
Accessibility
ClassS
vrijdag 26 juni 2009
class
Accessibility
ClassS
ClassT
vrijdag 26 juni 2009
package
class
Accessibility
ClassS
ClassT
Class U
vrijdag 26 juni 2009
module
package
class
Accessibility
ClassS
ClassT
Class U
ClassV
vrijdag 26 juni 2009
module
package
class
Accessibility
ClassS
ClassT
Class U
ClassV
vrijdag 26 juni 2009
module
package
class
Accessibility
ClassS
ClassT
ClassW
Class U
ClassV
vrijdag 26 juni 2009
Is JSR 294 aMeta Module System? (Implemented by OSGi™, Jigsaw, Guice, …)
vrijdag 26 juni 2009
Is JSR 294 aMeta Module System? (Implemented by OSGi™, Jigsaw, Guice, …)
No Java™ Standard for
Modules!vrijdag 26 juni 2009
Bundle
OSGi Modules: Bundle = Module
module
vrijdag 26 juni 2009
Bundle
OSGi Modules: Bundle = Multiple Modules
module A
module B
vrijdag 26 juni 2009
Bundle BBundle A
module
OSGi Modules: Modules Cross Bundles
vrijdag 26 juni 2009
Bundle
OSGi Modules: Nested?
module A
module B
vrijdag 26 juni 2009
Module Dependencies
Bundle A
module A
Bundle B
module B
vrijdag 26 juni 2009
Module Dependencies
Bundle A
module A
Bundle B
module B
requires
provides
permits
vrijdag 26 juni 2009
Module Dependencies
Bundle A
module A
Bundle B
module B
requires
provides
permits?vrijdag 26 juni 2009
vrijdag 26 juni 2009
Europe
vrijdag 26 juni 2009
Top Related