what does service type mean? | Community
Skip to main content
Level 4
March 10, 2016
Solved

what does service type mean?

  • March 10, 2016
  • 3 replies
  • 1916 views

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 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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

3 replies

Level 4
March 10, 2016

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
{

smacdonald2008
smacdonald2008Accepted solution
Level 10
March 10, 2016

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