Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Immediate Component Vs Delayed Component

Avatar

Level 7

what is delayed and immediate component in simple words ?

i found somehwere in google :

  • Delayed Component
    Activation is not done until there is a request for a service object. Therefore even class loading and instantiation can be delayed until that time. A Delayed Component needs to specify a service.
  • Immediate Component
    Activated as soon as its dependencies are satisfied. An Immediate Component does not need to specify a service

I didnt get this specifying service things ?

As per my understanding if we put

@Component(immediate = true/false)

we will get Delayed and Immediate component on that basis .

Can anyone please explain to me in my case if I am having one service Hellosrviceimplem.java and helloservice interface ....and put @Component(immediate = true/false) what would be the scenerio?

1 Accepted Solution

Avatar

Correct answer by
Level 10

FROM OSGi docs --

The OSGi Declarative services specification defines three types of components:

  • Immediate Components are immediately created when the providing bundle is started and may or may not provide services
  • Delayed Components provide services but are only created when used by a service consumer.
  • Factory Components are created on demand by calling the ComponentFactory.newInstance(Dictionary) method of the Component Factory service registered for the component.

More info -- java - How to start immediate = false component? - Stack Overflow

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

FROM OSGi docs --

The OSGi Declarative services specification defines three types of components:

  • Immediate Components are immediately created when the providing bundle is started and may or may not provide services
  • Delayed Components provide services but are only created when used by a service consumer.
  • Factory Components are created on demand by calling the ComponentFactory.newInstance(Dictionary) method of the Component Factory service registered for the component.

More info -- java - How to start immediate = false component? - Stack Overflow