Expand my Community achievements bar.

SOLVED

what does service type mean?

Avatar

Level 5

In our felix console under components, we see service type attribute displayed. It was displayed as service but on upgrading it changed to singleton

I know what singleton is, but I am wondering what are different types, where are they specified and significance of each

 

Bundle org.imf.cq.imf-bundle (554) 
Implementation Class org.imf.av.impl.McAfeeVirusDetectServiceImpl 
Default State enabled 
Activation immediate 
Configuration Policy optional 
Service Type service 
Services org.imf.av.VirusDetectService 
Properties component.id = 1597
component.name = org.imf.av.impl.McAfeeVirusDetectServiceImpl
service.pid = org.imf.av.impl.McAfeeVirusDetectServiceImpl 

1 Accepted Solution

Avatar

Correct answer by
Level 10

We never put "Singleton" as value of an annotation so not sure where that is coming from."

A singleton means that bundle only have one version could exist in the OSGi runtime. I have not heard from any previous community members this happening.

Here is a good stackoverflow that covers this: 

http://stackoverflow.com/questions/12626878/osgi-service-vs-singleton

View solution in original post

3 Replies

Avatar

Level 5

Scott,

These areticles explain what annotations I can have. We never put "Singleton" as value of an annotation so not sure where that is coming from. The example I mentioned has just this specified. Nowhere does it specify singleton. So when we updated it to 6.1, somehow that service type reads "singleton". Do you have any idea how that could happen? And I assumed, if you are using services by reference annotation, they would be singleton, no?

@Component(immediate=true, metatype = true, label = "IMF Virus Detect Service based on McAfee - uvscan", description = "IMF Virus Detect Service based on McAfee - uvscan")
@Service
public class McAfeeVirusDetectServiceImpl implements VirusDetectService
{

Avatar

Correct answer by
Level 10

We never put "Singleton" as value of an annotation so not sure where that is coming from."

A singleton means that bundle only have one version could exist in the OSGi runtime. I have not heard from any previous community members this happening.

Here is a good stackoverflow that covers this: 

http://stackoverflow.com/questions/12626878/osgi-service-vs-singleton