SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Guava’s Event Bus
1
Traditional Events
Listener Listener
Activity
Service / Helper
Thread
Activity
Communication Issues?!
• Tight coupling of components
 Inflexible, changes are expensive
• Boiler plate code
– Define interfaces
– Callbacks for asynch. communication
– Listener management
– Propagation through all layers
EventBus Communication
Fragment Fragment
Activity
Service / Helper
Thread
Activity
Event
Bus
Guava’s EventBus
• A message dispatching system
– to allow publish-subscribe style of
communication between components
– No-nonsense
– Lightweight
– and very practical
• Everything happens within the run-time
boundaries of the same Java application.
https://code.google.com/p/guava-
libraries/wiki/EventBusExplained
Guava’s EventBus
• The Event Bus comes in two flavours:
– Synchronous (backed-up by the EventBus class), and
– Asynchronous (backed-up by the AsyncEventBus class which
extends EventBus)
• com.google.common.eventbus package
• Exposed API
– void register(Object) - registers and caches
subscribers for subsequent event handling
– void unregister(Object) - undoes the register action
– void post(Object) - posts an event (event) to all
registered subscribers
Building an Event Bus
• The Guava’s Event (Message) Bus itself
• The event (message), which can be any Java
object: a Date, a String, your POJO etc…
• The event subscriber (listener) – any
complexity Java class that must have a specially
annotated method for handling events (messages);
EventBus Configuration (Spring way)
• EventBus instances will create when
application is deploying
<bean id="eventBus" class="com.google.common.even
tbus.EventBus" />
<bean id="asyncEventBus"
class="com.google.common.eventbus.AsyncEventBus">
<constructor-arg name="executor" ref="executorService" />
</bean>
EventBus : Listener
• Define an event handler
@Component
Public class EventHandler
{
}
Event
Handler
E
v
e
n
t
B
u
s
EventBus: Listener Registration
• Register handler
@PostConstruct
public void registerHandler()
{
asyncEventBus.register(this);
}
Event
Handler
E
v
e
n
t
B
u
s
register
EventBus: Listener Subscription
• Subscribe for events a.k.a objects
@Subscribe
@AllowConcurrentEvents
public void handleEventMethod(ObjectA objA)
{
}
Event
Handler
E
v
e
n
t
B
u
s
subscribe
register
EventBus: Event Post
• Post an event
// Post information back to event bus
asyncEventBus.post(objA);
Event
Handler
E
v
e
n
t
B
u
s
subscribe
registerEvent
post
Guava Event Bus
E
v
e
n
t
B
u
s
Event
Event
Event
Event
Handler
Event
Handler
Event
Handler
post
post
post
subscribe
subscribe
subscribe
register
register
register
Event Handler Method
• EventBus scans subscribers
– During (first) registration of subscriber and
registers the event listener methods based on
the method’s parameter type
• Event handler methods
– public visibility
– No return value (void)
– Single parameter for the event to receive
14
Type-based Event Routing
• Event type: Java class of the event
• To receive an event, its type must match
• E.g.
post(new User());
handleUserXXX(User user) {…}
Post(new Address());
handleAddressXXX(Address address) {…}
Publish / Subscribe
Publisher
Event
Bus
Publish / Subscribe
Publisher
Event
Bus
Event
post(Object1)
Publish / Subscribe
Publisher
Event
Bus
Subscriber
Event
post(Object1)
Event
handleMethod1(Object1)
Subscriber
Event
handleMethod2(Object1)
Event Type is a Filter
Publisher
Event
Bus
Subscriber
Event
post
(user)
Event
handleUserXXX(User)
Subscriber
handleAddressXXX(Address)
It‘s time to see some
• CODE
EventBus Code: Sender (Spring)
@Autowired
private EventBus eventBus;
…
eventBus.post(user);
…
OR
@Autowired
private AsyncEventBus asyncEventBus;
…
asyncEventBus.post(user);
…
EventBus Code: Receiver (Spring)
@Component
public class UserListener
{
@Autowired
private AsyncEventBus asyncEventBus;
@PostConstruct
public void registerHandler()
{
asyncEventBus.register(this);
}
@PreDestroy
public void unRegisterHandler()
{
asyncEventBus.unregister(this);
}
@Subscribe
@AllowConcurrentEvents
public void handleUserXXX(User user)
{
// your logic
}
}

Weitere ähnliche Inhalte

Was ist angesagt?

[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링OpenStack Korea Community
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkSVDevOps
 
CloudStack Best Practice in PPTV
CloudStack Best Practice in PPTVCloudStack Best Practice in PPTV
CloudStack Best Practice in PPTVgavin_lee
 
[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험NHN FORWARD
 
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...Vietnam Open Infrastructure User Group
 
Learn how to use Harbor
Learn how to use HarborLearn how to use Harbor
Learn how to use HarborSteve Wong
 
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드Ian Choi
 
Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Yoshifumi Kawai
 
Troubleshooting Apache Cloudstack
Troubleshooting Apache CloudstackTroubleshooting Apache Cloudstack
Troubleshooting Apache CloudstackRadhika Puthiyetath
 
Ansible ネットワーク自動化チュートリアル (JANOG42)
Ansible ネットワーク自動化チュートリアル (JANOG42)Ansible ネットワーク自動化チュートリアル (JANOG42)
Ansible ネットワーク自動化チュートリアル (JANOG42)akira6592
 
What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? Shady Selim
 
An Introduction to OpenStack
An Introduction to OpenStackAn Introduction to OpenStack
An Introduction to OpenStackScott Lowe
 
Software Defined Datacenter with Proxmox
Software Defined Datacenter with ProxmoxSoftware Defined Datacenter with Proxmox
Software Defined Datacenter with ProxmoxGLC Networks
 
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기Ian Choi
 
Load Balancing-as-a-Service (LBaaS) with octavia in openstack
Load Balancing-as-a-Service (LBaaS) with octavia in openstackLoad Balancing-as-a-Service (LBaaS) with octavia in openstack
Load Balancing-as-a-Service (LBaaS) with octavia in openstackYashar Esmaildokht
 

Was ist angesagt? (20)

[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
 
CloudStack Architecture
CloudStack ArchitectureCloudStack Architecture
CloudStack Architecture
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
 
MAAS High Availability Overview
MAAS High Availability OverviewMAAS High Availability Overview
MAAS High Availability Overview
 
CloudStack Best Practice in PPTV
CloudStack Best Practice in PPTVCloudStack Best Practice in PPTV
CloudStack Best Practice in PPTV
 
[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험
 
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
 
Learn how to use Harbor
Learn how to use HarborLearn how to use Harbor
Learn how to use Harbor
 
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
 
Logging system of Android
Logging system of AndroidLogging system of Android
Logging system of Android
 
Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)
 
Troubleshooting Apache Cloudstack
Troubleshooting Apache CloudstackTroubleshooting Apache Cloudstack
Troubleshooting Apache Cloudstack
 
Ansible ネットワーク自動化チュートリアル (JANOG42)
Ansible ネットワーク自動化チュートリアル (JANOG42)Ansible ネットワーク自動化チュートリアル (JANOG42)
Ansible ネットワーク自動化チュートリアル (JANOG42)
 
What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How?
 
An Introduction to OpenStack
An Introduction to OpenStackAn Introduction to OpenStack
An Introduction to OpenStack
 
Fluentd vs. Logstash for OpenStack Log Management
Fluentd vs. Logstash for OpenStack Log ManagementFluentd vs. Logstash for OpenStack Log Management
Fluentd vs. Logstash for OpenStack Log Management
 
Software Defined Datacenter with Proxmox
Software Defined Datacenter with ProxmoxSoftware Defined Datacenter with Proxmox
Software Defined Datacenter with Proxmox
 
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
 
Load Balancing-as-a-Service (LBaaS) with octavia in openstack
Load Balancing-as-a-Service (LBaaS) with octavia in openstackLoad Balancing-as-a-Service (LBaaS) with octavia in openstack
Load Balancing-as-a-Service (LBaaS) with octavia in openstack
 

Ähnlich wie Guava’s Event Bus

Infinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBusInfinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBusInfinum
 
EventBus for Android
EventBus for AndroidEventBus for Android
EventBus for Androidgreenrobot
 
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, NutanixGuaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, NutanixHostedbyConfluent
 
Komunikacja oparta o zdarzenia z wykorzystaniem AWS Event Bridge
Komunikacja oparta o zdarzenia z wykorzystaniem AWS Event BridgeKomunikacja oparta o zdarzenia z wykorzystaniem AWS Event Bridge
Komunikacja oparta o zdarzenia z wykorzystaniem AWS Event BridgeThe Software House
 
Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?InnovationM
 
Multi-Process JavaScript Architectures
Multi-Process JavaScript ArchitecturesMulti-Process JavaScript Architectures
Multi-Process JavaScript ArchitecturesMark Trostler
 
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...VMware Tanzu
 
Explained: Domain events
Explained: Domain eventsExplained: Domain events
Explained: Domain eventsJoão Pires
 
Scala API - Azure Event Hub Integration
Scala API - Azure Event Hub IntegrationScala API - Azure Event Hub Integration
Scala API - Azure Event Hub IntegrationBraja Krishna Das
 
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_NETWAYS
 
Automating Research Data Flows and an Introduction to the Globus Platform
Automating Research Data Flows and an Introduction to the Globus PlatformAutomating Research Data Flows and an Introduction to the Globus Platform
Automating Research Data Flows and an Introduction to the Globus PlatformGlobus
 
AxonHub beta release 11 april 2018
AxonHub beta release 11 april 2018AxonHub beta release 11 april 2018
AxonHub beta release 11 april 2018Frans van Buul
 
Istio Playground
Istio PlaygroundIstio Playground
Istio PlaygroundQAware GmbH
 
Actors or Not: Async Event Architectures
Actors or Not: Async Event ArchitecturesActors or Not: Async Event Architectures
Actors or Not: Async Event ArchitecturesYaroslav Tkachenko
 
Band of brothers, building scalable social web apps on windows azure with asp...
Band of brothers, building scalable social web apps on windows azure with asp...Band of brothers, building scalable social web apps on windows azure with asp...
Band of brothers, building scalable social web apps on windows azure with asp...Marjan Nikolovski
 
Service workers
Service workersService workers
Service workersjungkees
 
Automating Research Data Flows and Introduction to the Globus Platform
Automating Research Data Flows and Introduction to the Globus PlatformAutomating Research Data Flows and Introduction to the Globus Platform
Automating Research Data Flows and Introduction to the Globus PlatformGlobus
 
Timeline Service v.2 (Hadoop Summit 2016)
Timeline Service v.2 (Hadoop Summit 2016)Timeline Service v.2 (Hadoop Summit 2016)
Timeline Service v.2 (Hadoop Summit 2016)Sangjin Lee
 
Timeline service V2 at the Hadoop Summit SJ 2016
Timeline service V2 at the Hadoop Summit SJ 2016Timeline service V2 at the Hadoop Summit SJ 2016
Timeline service V2 at the Hadoop Summit SJ 2016Vrushali Channapattan
 

Ähnlich wie Guava’s Event Bus (20)

Infinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBusInfinum Android Talks #02 - EventBus
Infinum Android Talks #02 - EventBus
 
EventBus for Android
EventBus for AndroidEventBus for Android
EventBus for Android
 
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, NutanixGuaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
 
Komunikacja oparta o zdarzenia z wykorzystaniem AWS Event Bridge
Komunikacja oparta o zdarzenia z wykorzystaniem AWS Event BridgeKomunikacja oparta o zdarzenia z wykorzystaniem AWS Event Bridge
Komunikacja oparta o zdarzenia z wykorzystaniem AWS Event Bridge
 
GreenRobot-Eventbus
GreenRobot-EventbusGreenRobot-Eventbus
GreenRobot-Eventbus
 
Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?
 
Multi-Process JavaScript Architectures
Multi-Process JavaScript ArchitecturesMulti-Process JavaScript Architectures
Multi-Process JavaScript Architectures
 
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
 
Explained: Domain events
Explained: Domain eventsExplained: Domain events
Explained: Domain events
 
Scala API - Azure Event Hub Integration
Scala API - Azure Event Hub IntegrationScala API - Azure Event Hub Integration
Scala API - Azure Event Hub Integration
 
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
 
Automating Research Data Flows and an Introduction to the Globus Platform
Automating Research Data Flows and an Introduction to the Globus PlatformAutomating Research Data Flows and an Introduction to the Globus Platform
Automating Research Data Flows and an Introduction to the Globus Platform
 
AxonHub beta release 11 april 2018
AxonHub beta release 11 april 2018AxonHub beta release 11 april 2018
AxonHub beta release 11 april 2018
 
Istio Playground
Istio PlaygroundIstio Playground
Istio Playground
 
Actors or Not: Async Event Architectures
Actors or Not: Async Event ArchitecturesActors or Not: Async Event Architectures
Actors or Not: Async Event Architectures
 
Band of brothers, building scalable social web apps on windows azure with asp...
Band of brothers, building scalable social web apps on windows azure with asp...Band of brothers, building scalable social web apps on windows azure with asp...
Band of brothers, building scalable social web apps on windows azure with asp...
 
Service workers
Service workersService workers
Service workers
 
Automating Research Data Flows and Introduction to the Globus Platform
Automating Research Data Flows and Introduction to the Globus PlatformAutomating Research Data Flows and Introduction to the Globus Platform
Automating Research Data Flows and Introduction to the Globus Platform
 
Timeline Service v.2 (Hadoop Summit 2016)
Timeline Service v.2 (Hadoop Summit 2016)Timeline Service v.2 (Hadoop Summit 2016)
Timeline Service v.2 (Hadoop Summit 2016)
 
Timeline service V2 at the Hadoop Summit SJ 2016
Timeline service V2 at the Hadoop Summit SJ 2016Timeline service V2 at the Hadoop Summit SJ 2016
Timeline service V2 at the Hadoop Summit SJ 2016
 

Kürzlich hochgeladen

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 

Kürzlich hochgeladen (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 

Guava’s Event Bus

Hinweis der Redaktion

  1. TraditionalAs stated above — the traditional method requires an interface declaration, an explicit subscription, and knowledge of the object that is posting the particular event. Additionally, it forces the object that is posting the event to invent its own method of publishing the event.
  2. The Guava’s Event (Message) Bus itself – represented by the EventBus class that provides methods for subscribers (event listeners) to register and unregister themselves with the Bus as well as a method for dispatching events (messages) to the target subscribers The event (message), which can be any Java object: a Date, a String, your POJO, anything that can be routed by the Bus to your subscriber The event subscriber (listener) – an arbitrary complexity Java class that must have a specially annotated method for handling events (messages); this method is a call-back function that must return void and take one parameter of the same type as the type of the corresponding event (a Date, a String, your POJO, etc.)