SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Using OSGi in Nakamura Carl Hall [email_address] Hallway Technologies 15 June 2010
Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],11th Sakai Conference - June 15-17, 2010
Starting Lineup ,[object Object],[object Object],[object Object],[object Object],11th Sakai Conference - June 15-17, 2010
Bundles   11th Sakai Conference - June 15-17, 2010
Bundle Life Cycle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],11th Sakai Conference - June 15-17, 2010
Bundle Activation import   org.osgi.framework.BundleActivator ; import   org.osgi.framework.BundleContext ; public   class   Activator   implements  BundleActivator  { public   void  start ( BundleContext context )   { System . out . println ( "Starting: Hello World" ) ; } public   void  stop ( BundleContext context )   { System . out . println ( "Stopping: Goodbye Cruel World" ) ; } } Source: Wikipedia 11th Sakai Conference - June 15-17, 2010
Components   11th Sakai Conference - June 15-17, 2010
Types of Components ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],11th Sakai Conference - June 15-17, 2010
Service Example @Component @Service public class LdapAuthenticationPlugin implements AuthenticationPlugin {    @Property(value = &quot;o=sakai&quot;)    static final String LDAP_BASE_DN = &quot;sakai.auth.ldap.baseDn&quot;;    private String baseDn;    @Reference    private LdapConnectionManager connMgr;    @Activate    protected void activate(Map<?, ?> props) {      baseDn = OsgiUtil.toString(props.get(LDAP_BASE_DN), &quot;o=sakai&quot;);    } } 11th Sakai Conference - June 15-17, 2010
Component Execution @Activate protected void activate(ComponentContext ctx) {} protected void activate(BundleContext ctx) {} protected void activate(Map<?, ?> props) {} @Modified protected void modified(...) {} @Deactivate protected void deactivate(...) {} protected void deactivate(int reasonCode) {} 11th Sakai Conference - June 15-17, 2010
OSGi Services ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],11th Sakai Conference - June 15-17, 2010 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dependency Injection   11th Sakai Conference - June 15-17, 2010
References ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],11th Sakai Conference - June 15-17, 2010
References public class GetAReference {    @Reference    ConnectionManager connMgr; } ----------------------------------------------------------------- @Component @Service public class LdapConnectionManager implements ConnectionManager { } @Component @Service public class JdbcConnectionManager implements ConnectionManager { } 11th Sakai Conference - June 15-17, 2010
Single Instance Reference // OPTIONAL_UNARY == &quot;0..1&quot; // MANDATORY_UNARY == &quot;1..1&quot; @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY,    policy = ReferencePolicy.STATIC) ConnectionManager connMgr; protected void bindConnMgr(ConnectionManager mgr) {    this.connMgr = mgr; } protected void unbindConnMgr(ConnectionManager mgr) {    this.connMgr = null; } 11th Sakai Conference - June 15-17, 2010
Multiple Instance Reference // OPTIONAL_MULTIPLE == &quot;0..n&quot; // MANDATORY_MULTIPLE == &quot;1..n&quot; @Reference(cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE,    policy = ReferencePolicy.DYNAMIC,    referenceInterface = ConnectionManager.class,    bind = &quot;bindManager&quot;,    unbind = &quot;unbindManager&quot;) List<ConnectionManager> managers;  // be sure to instantiate this protected void bindManager(ConnectionManager mgr) {    managers.add(mgr); } protected void unbindManager(ConnectionManager mgr) {    managers.remove(mgr); } 11th Sakai Conference - June 15-17, 2010
Reference Target @Reference PooledConnectionManager connMgr;  //boo! @Reference(target = &quot;(type=pooled)&quot;) ConnectionManager connMgr;  //yay! ----------------------------------------------------------------- @Component @Service @Property(name = &quot;type&quot;, value = &quot;simple&quot;) public class SimpleCM implements ConnectionManager {} @Component @Service @Property(name = &quot;type&quot;, value = &quot;pooled&quot;) public class PooledCM implements ConnectionManager {} 11th Sakai Conference - June 15-17, 2010
Configuration   11th Sakai Conference - June 15-17, 2010
Felix Admin Console 11th Sakai Conference - June 15-17, 2010
New Service Configuration @Reference ConfigurationAdmin cfgAdmin; @Activate protected void activate() {    Configuration cfg =      cfgAdmin.createFactoryConfiguration(&quot;some.factory.pid&quot;);    Hashtable props = new Hashtable();    props.put(&quot;key1&quot;, &quot;val1&quot;);    props.put(&quot;key2&quot;, &quot;val2&quot;);    config.update(props); } 11th Sakai Conference - June 15-17, 2010
Configure A Reference @Reference ConnectionManager connMgr; ----------------------------------------------------------------- @Reference ConfigurationAdmin cfgAdmin; @Activate protected void activate() {    Configuration cfg =      cfgAdmin.createFactoryConfiguration(&quot;some.factory.pid&quot;);    Hashtable props = new Hashtable();    props.put(&quot;connMgr.target&quot;, &quot;(type=pooled)&quot;);    config.update(props); } 11th Sakai Conference - June 15-17, 2010

Weitere ähnliche Inhalte

Was ist angesagt?

Sagas Middleware Architecture
Sagas Middleware ArchitectureSagas Middleware Architecture
Sagas Middleware ArchitectureMateusz Bosek
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Paco de la Cruz
 
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)Paco de la Cruz
 
Workshop 20: ReactJS Part II Flux Pattern & Redux
Workshop 20: ReactJS Part II Flux Pattern & ReduxWorkshop 20: ReactJS Part II Flux Pattern & Redux
Workshop 20: ReactJS Part II Flux Pattern & ReduxVisual Engineering
 
Azure Durable Functions
Azure Durable FunctionsAzure Durable Functions
Azure Durable FunctionsKarthikeyan VK
 
Chapter 4.2
Chapter 4.2Chapter 4.2
Chapter 4.2sotlsoc
 
Developing JSR 286 Portlets
Developing JSR 286 PortletsDeveloping JSR 286 Portlets
Developing JSR 286 PortletsCris Holdorph
 
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with MagentoMagento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magentovarien
 
React + Redux. Best practices
React + Redux.  Best practicesReact + Redux.  Best practices
React + Redux. Best practicesClickky
 
Portlet Specification 3.0 Is Here!
Portlet Specification 3.0 Is Here! Portlet Specification 3.0 Is Here!
Portlet Specification 3.0 Is Here! Dev_Events
 
Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadDavid Gómez García
 
Repetition is bad, repetition is bad.
Repetition is bad, repetition is bad.Repetition is bad, repetition is bad.
Repetition is bad, repetition is bad.Michele Giacobazzi
 
What is new in java 8 concurrency
What is new in java 8 concurrencyWhat is new in java 8 concurrency
What is new in java 8 concurrencykshanth2101
 

Was ist angesagt? (14)

Sagas Middleware Architecture
Sagas Middleware ArchitectureSagas Middleware Architecture
Sagas Middleware Architecture
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30)
 
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
 
Workshop 20: ReactJS Part II Flux Pattern & Redux
Workshop 20: ReactJS Part II Flux Pattern & ReduxWorkshop 20: ReactJS Part II Flux Pattern & Redux
Workshop 20: ReactJS Part II Flux Pattern & Redux
 
Azure Durable Functions
Azure Durable FunctionsAzure Durable Functions
Azure Durable Functions
 
Chapter 4.2
Chapter 4.2Chapter 4.2
Chapter 4.2
 
Developing JSR 286 Portlets
Developing JSR 286 PortletsDeveloping JSR 286 Portlets
Developing JSR 286 Portlets
 
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with MagentoMagento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
Magento Imagine eCommerce Conference - February 2011 - Unit Testing with Magento
 
CC111 Example
CC111 ExampleCC111 Example
CC111 Example
 
React + Redux. Best practices
React + Redux.  Best practicesReact + Redux.  Best practices
React + Redux. Best practices
 
Portlet Specification 3.0 Is Here!
Portlet Specification 3.0 Is Here! Portlet Specification 3.0 Is Here!
Portlet Specification 3.0 Is Here!
 
Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidad
 
Repetition is bad, repetition is bad.
Repetition is bad, repetition is bad.Repetition is bad, repetition is bad.
Repetition is bad, repetition is bad.
 
What is new in java 8 concurrency
What is new in java 8 concurrencyWhat is new in java 8 concurrency
What is new in java 8 concurrency
 

Andere mochten auch

UX Programming: The Sakai 3 Approach
UX Programming: The Sakai 3 ApproachUX Programming: The Sakai 3 Approach
UX Programming: The Sakai 3 ApproachCarl Hall
 
Confidence Instantly
Confidence Instantly Confidence Instantly
Confidence Instantly mavericbryan
 
þágufallssýki
þágufallssýki þágufallssýki
þágufallssýki Brekki
 
20 Points For Quality And Pi V2.3
20 Points For Quality And Pi V2.320 Points For Quality And Pi V2.3
20 Points For Quality And Pi V2.3TimKasse
 

Andere mochten auch (8)

Why erlang
Why erlangWhy erlang
Why erlang
 
S3CA Samples
S3CA SamplesS3CA Samples
S3CA Samples
 
UX Programming: The Sakai 3 Approach
UX Programming: The Sakai 3 ApproachUX Programming: The Sakai 3 Approach
UX Programming: The Sakai 3 Approach
 
Man in the Mirror
Man in the MirrorMan in the Mirror
Man in the Mirror
 
Confidence Instantly
Confidence Instantly Confidence Instantly
Confidence Instantly
 
Mark Colthorpe Show
Mark Colthorpe ShowMark Colthorpe Show
Mark Colthorpe Show
 
þágufallssýki
þágufallssýki þágufallssýki
þágufallssýki
 
20 Points For Quality And Pi V2.3
20 Points For Quality And Pi V2.320 Points For Quality And Pi V2.3
20 Points For Quality And Pi V2.3
 

Ähnlich wie Using OSGi in Nakamura

Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...LogeekNightUkraine
 
dokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdf
dokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdfdokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdf
dokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdfAppster1
 
dokumen.tips_rediscovering-spring-with-spring-boot1.pdf
dokumen.tips_rediscovering-spring-with-spring-boot1.pdfdokumen.tips_rediscovering-spring-with-spring-boot1.pdf
dokumen.tips_rediscovering-spring-with-spring-boot1.pdfAppster1
 
Job Managment Portlet
Job Managment PortletJob Managment Portlet
Job Managment Portletriround
 
Rediscovering Spring with Spring Boot(1)
Rediscovering Spring with Spring Boot(1)Rediscovering Spring with Spring Boot(1)
Rediscovering Spring with Spring Boot(1)Gunith Devasurendra
 
Declarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleDeclarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleFelix Meschberger
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0Matt Raible
 
MeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
MeasureCamp IX (London) - 10 JavaScript Concepts for web analystsMeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
MeasureCamp IX (London) - 10 JavaScript Concepts for web analystsSimo Ahava
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's Howmrdon
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 
Declarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleDeclarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleFelix Meschberger
 
Declarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleDeclarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleFelix Meschberger
 
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten ZiegelerOSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegelermfrancis
 
Struts 2 + Spring
Struts 2 + SpringStruts 2 + Spring
Struts 2 + SpringBryan Hsueh
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 
A gently introduction to AngularJS
A gently introduction to AngularJSA gently introduction to AngularJS
A gently introduction to AngularJSGregor Woiwode
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasyJBug Italy
 
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020AWSKRUG - AWS한국사용자모임
 

Ähnlich wie Using OSGi in Nakamura (20)

Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
Pavlo Zhdanov "Java and Swift: How to Create Applications for Automotive Head...
 
dokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdf
dokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdfdokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdf
dokumen.tips_rediscovering-spring-with-spring-boot1 (1).pdf
 
dokumen.tips_rediscovering-spring-with-spring-boot1.pdf
dokumen.tips_rediscovering-spring-with-spring-boot1.pdfdokumen.tips_rediscovering-spring-with-spring-boot1.pdf
dokumen.tips_rediscovering-spring-with-spring-boot1.pdf
 
Job Managment Portlet
Job Managment PortletJob Managment Portlet
Job Managment Portlet
 
Rediscovering Spring with Spring Boot(1)
Rediscovering Spring with Spring Boot(1)Rediscovering Spring with Spring Boot(1)
Rediscovering Spring with Spring Boot(1)
 
Declarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleDeclarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi style
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0
 
MeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
MeasureCamp IX (London) - 10 JavaScript Concepts for web analystsMeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
MeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
 
AngularJs-training
AngularJs-trainingAngularJs-training
AngularJs-training
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Declarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleDeclarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi Style
 
Declarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleDeclarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi Style
 
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten ZiegelerOSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
 
Struts 2 + Spring
Struts 2 + SpringStruts 2 + Spring
Struts 2 + Spring
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
A gently introduction to AngularJS
A gently introduction to AngularJSA gently introduction to AngularJS
A gently introduction to AngularJS
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
 

Kürzlich hochgeladen

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Kürzlich hochgeladen (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Using OSGi in Nakamura

  • 1. Using OSGi in Nakamura Carl Hall [email_address] Hallway Technologies 15 June 2010
  • 2.
  • 3.
  • 4. Bundles   11th Sakai Conference - June 15-17, 2010
  • 5.
  • 6. Bundle Activation import org.osgi.framework.BundleActivator ; import org.osgi.framework.BundleContext ; public class Activator implements BundleActivator { public void start ( BundleContext context ) { System . out . println ( &quot;Starting: Hello World&quot; ) ; } public void stop ( BundleContext context ) { System . out . println ( &quot;Stopping: Goodbye Cruel World&quot; ) ; } } Source: Wikipedia 11th Sakai Conference - June 15-17, 2010
  • 7. Components   11th Sakai Conference - June 15-17, 2010
  • 8.
  • 9. Service Example @Component @Service public class LdapAuthenticationPlugin implements AuthenticationPlugin {    @Property(value = &quot;o=sakai&quot;)    static final String LDAP_BASE_DN = &quot;sakai.auth.ldap.baseDn&quot;;    private String baseDn;    @Reference    private LdapConnectionManager connMgr;    @Activate    protected void activate(Map<?, ?> props) {      baseDn = OsgiUtil.toString(props.get(LDAP_BASE_DN), &quot;o=sakai&quot;);    } } 11th Sakai Conference - June 15-17, 2010
  • 10. Component Execution @Activate protected void activate(ComponentContext ctx) {} protected void activate(BundleContext ctx) {} protected void activate(Map<?, ?> props) {} @Modified protected void modified(...) {} @Deactivate protected void deactivate(...) {} protected void deactivate(int reasonCode) {} 11th Sakai Conference - June 15-17, 2010
  • 11.
  • 12. Dependency Injection   11th Sakai Conference - June 15-17, 2010
  • 13.
  • 14. References public class GetAReference {    @Reference    ConnectionManager connMgr; } ----------------------------------------------------------------- @Component @Service public class LdapConnectionManager implements ConnectionManager { } @Component @Service public class JdbcConnectionManager implements ConnectionManager { } 11th Sakai Conference - June 15-17, 2010
  • 15. Single Instance Reference // OPTIONAL_UNARY == &quot;0..1&quot; // MANDATORY_UNARY == &quot;1..1&quot; @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY,    policy = ReferencePolicy.STATIC) ConnectionManager connMgr; protected void bindConnMgr(ConnectionManager mgr) {    this.connMgr = mgr; } protected void unbindConnMgr(ConnectionManager mgr) {    this.connMgr = null; } 11th Sakai Conference - June 15-17, 2010
  • 16. Multiple Instance Reference // OPTIONAL_MULTIPLE == &quot;0..n&quot; // MANDATORY_MULTIPLE == &quot;1..n&quot; @Reference(cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE,    policy = ReferencePolicy.DYNAMIC,    referenceInterface = ConnectionManager.class,    bind = &quot;bindManager&quot;,    unbind = &quot;unbindManager&quot;) List<ConnectionManager> managers;  // be sure to instantiate this protected void bindManager(ConnectionManager mgr) {    managers.add(mgr); } protected void unbindManager(ConnectionManager mgr) {    managers.remove(mgr); } 11th Sakai Conference - June 15-17, 2010
  • 17. Reference Target @Reference PooledConnectionManager connMgr;  //boo! @Reference(target = &quot;(type=pooled)&quot;) ConnectionManager connMgr;  //yay! ----------------------------------------------------------------- @Component @Service @Property(name = &quot;type&quot;, value = &quot;simple&quot;) public class SimpleCM implements ConnectionManager {} @Component @Service @Property(name = &quot;type&quot;, value = &quot;pooled&quot;) public class PooledCM implements ConnectionManager {} 11th Sakai Conference - June 15-17, 2010
  • 18. Configuration   11th Sakai Conference - June 15-17, 2010
  • 19. Felix Admin Console 11th Sakai Conference - June 15-17, 2010
  • 20. New Service Configuration @Reference ConfigurationAdmin cfgAdmin; @Activate protected void activate() {    Configuration cfg =      cfgAdmin.createFactoryConfiguration(&quot;some.factory.pid&quot;);    Hashtable props = new Hashtable();    props.put(&quot;key1&quot;, &quot;val1&quot;);    props.put(&quot;key2&quot;, &quot;val2&quot;);    config.update(props); } 11th Sakai Conference - June 15-17, 2010
  • 21. Configure A Reference @Reference ConnectionManager connMgr; ----------------------------------------------------------------- @Reference ConfigurationAdmin cfgAdmin; @Activate protected void activate() {    Configuration cfg =      cfgAdmin.createFactoryConfiguration(&quot;some.factory.pid&quot;);    Hashtable props = new Hashtable();    props.put(&quot;connMgr.target&quot;, &quot;(type=pooled)&quot;);    config.update(props); } 11th Sakai Conference - June 15-17, 2010