Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

38
Avoid the chaos Handling 100+ OSGi components Balázs Zsoldos

Transcript of Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Page 1: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Avoid the chaosHandling 100+ OSGi components

Balázs Zsoldos

Page 2: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Everit Component Model (ECM) since 2014

Page 3: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Page 4: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Source: Inglourious Basterds

Page 5: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Why another Component Model?

Page 6: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Blueprint

Declarative Services

Page 7: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

OSGi Service

Component

Reference

Page 8: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

DS

DataSource

Business

Log C

Cache

Declarative Services

Page 9: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

UserDataServlet

ServletContext

ErrorServletLoginServlet

Not Supported

Declarative Services

Page 10: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

UserDataServlet

Whiteboardextender

ErrorServletLoginServlet

Whiteboard

Declarative Services

Page 11: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Page 12: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Whiteboardextender

Page 13: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Whiteboardextender

Aries JPA

Extender

Blueprint

Page 14: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Source: Reservoir dogs movie

Page 15: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Whiteboard extender ServletContextComponent

Authentication Filter

URL Redirect Filter

User Mgmt Servlet

Login Servlet

Authentication Filter

URL Redirect Filter

User Mgmt Servlet

Login Servlet

TestComponent

Page 16: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Source: Home Alone movie

Page 17: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Declarative Services

Everit Component Model

Page 18: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

UserDataServlet

ServletContext

ErrorServletLoginServlet

Not Supported

Declarative Services

Page 19: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Package 2

Bundle B

Bundle A

Package 1 Capability

Bundle BBundle B

Page 20: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

UserDataServlet

ServletContext

ErrorServletLoginServlet

Page 21: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

AuthFilter

ServletContext

WhateverFilter

URLRewriteFilter

Page 22: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

AuthFilter

ServletContext

WhateverFilter

URLRewriteFilter

0. 1. 2.

Page 23: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

XML Transform

CamelRoute

XMLDigital Signature

XML Validator

0. 1. 2.

Page 24: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Page 25: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

AuthenticationServlet

ServletContext

AuthorizationServlet

LoginServlet

/login /auth /auth

/a /authrConfigAdmin /authn

Page 26: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

logService.target: (implementation=felix)

servlet.clause: loginServlet;filter:=(service.pid=...)

servlet.clause: ...;init_param1=value1;init_param2=value2

Targeting references

Page 27: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Page 28: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Page 29: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

public enum ComponentState {

STOPPED,

UNSATISFIED,

STARTING,

ACTIVE,

STOPPING,

FAILED,

FAILED_PERMANENT}

// Throwable, restart on configuration change

// Throwable, never restart

Page 30: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

ecm-extender-ri

ecm-component-ri

ecm-component-api

ecm-metadata

ecm-util-method

linkage-api

capabilitycollector

ecm-annotation-metadatabuilder

ecm-annotation

ecm-extender-api

Page 31: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

@StringAttribute

private String stringAttribute;

public void setStringAttribute(String stringAttribute) {

this.stringAttribute = stringAttribute;

}

private Integer integerAttribute;

@IntegerAttribute

public void setIntAttribute(Integer integerAttribute) {

this.integerAttribute = integerAttribute;

}

private String[] names;

@StringAttribute(dynamic = true) public void setStringAttribute(String[] names) {

this.names = names;

}

Page 32: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

OSGiservice Bundle Capability

ECM Component

Page 33: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Demo

Page 34: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

http://everit.org/ecm/index.html

Page 35: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos
Page 36: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Source: Inglourious Basterds

Page 37: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

Source: Inglourious Basterds

Page 38: Avoid the chaos - Handling 100+ OSGi Components - Balázs Zsoldos

ecm-extender-ri

ecm-component-ri

ecm-component-api

ecm-metadata

ecm-util-method

linkage-api

capabilitycollector

ecm-annotation-metadatabuilder

ecm-annotation

ecm-extender-api

OSGiservice Bundle Capability

ECM Component

Twitter: @EveritOrg