|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.gemini.blueprint.mock.MockServiceReference
public class MockServiceReference
ServiceReference mock.
This mock tries to adhere to the OSGi spec as much as possible by providing the mandatory serviceId properties such asConstants.SERVICE_ID, Constants.OBJECTCLASS and
Constants.SERVICE_RANKING.
| Constructor Summary | |
|---|---|
MockServiceReference()
Constructs a new MockServiceReference instance using
defaults. |
|
MockServiceReference(org.osgi.framework.Bundle bundle)
Constructs a new MockServiceReference instance associated
with the given bundle. |
|
MockServiceReference(org.osgi.framework.Bundle bundle,
Dictionary properties,
org.osgi.framework.ServiceRegistration registration)
Constructs a new MockServiceReference instance associated
with the given bundle, service registration and having the given service
properties. |
|
MockServiceReference(org.osgi.framework.Bundle bundle,
Dictionary properties,
org.osgi.framework.ServiceRegistration registration,
String[] classes)
Constructs a new MockServiceReference instance. |
|
MockServiceReference(org.osgi.framework.Bundle bundle,
String[] classes)
Constructs a new MockServiceReference instance associated
with the given bundle and matching the given class names. |
|
MockServiceReference(org.osgi.framework.ServiceRegistration registration)
Constructs a new MockServiceReference instance associated
with the given service registration. |
|
MockServiceReference(String[] classes)
Constructs a new MockServiceReference instance matching
the given class namess. |
|
| Method Summary | |
|---|---|
int |
compareTo(Object reference)
|
boolean |
equals(Object obj)
Two mock service references are equal if they contain the same service id. |
org.osgi.framework.Bundle |
getBundle()
|
Object |
getProperty(String key)
|
String[] |
getPropertyKeys()
|
org.osgi.framework.Bundle[] |
getUsingBundles()
|
int |
hashCode()
Returns a hash code based on the class and service id. |
boolean |
isAssignableTo(org.osgi.framework.Bundle bundle,
String className)
|
void |
setProperties(Dictionary properties)
Sets the properties associated with this reference. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MockServiceReference()
MockServiceReference instance using
defaults.
public MockServiceReference(org.osgi.framework.Bundle bundle)
MockServiceReference instance associated
with the given bundle.
bundle - associated reference bundlepublic MockServiceReference(String[] classes)
MockServiceReference instance matching
the given class namess.
classes - associated class names
public MockServiceReference(org.osgi.framework.Bundle bundle,
String[] classes)
MockServiceReference instance associated
with the given bundle and matching the given class names.
bundle - associated bundleclasses - matching class namespublic MockServiceReference(org.osgi.framework.ServiceRegistration registration)
MockServiceReference instance associated
with the given service registration.
registration - service registration
public MockServiceReference(org.osgi.framework.Bundle bundle,
Dictionary properties,
org.osgi.framework.ServiceRegistration registration)
MockServiceReference instance associated
with the given bundle, service registration and having the given service
properties.
bundle - associated bundleproperties - reference propertiesregistration - associated service registrations
public MockServiceReference(org.osgi.framework.Bundle bundle,
Dictionary properties,
org.osgi.framework.ServiceRegistration registration,
String[] classes)
MockServiceReference instance. This
constructor gives access to all the parameters of the mock service
reference such as associated bundle, reference properties, service
registration and reference class names.
bundle - associated bundleproperties - reference propertiesregistration - service registrationclasses - reference class names| Method Detail |
|---|
public org.osgi.framework.Bundle getBundle()
getBundle in interface org.osgi.framework.ServiceReferencepublic Object getProperty(String key)
getProperty in interface org.osgi.framework.ServiceReferencepublic String[] getPropertyKeys()
getPropertyKeys in interface org.osgi.framework.ServiceReferencepublic org.osgi.framework.Bundle[] getUsingBundles()
getUsingBundles in interface org.osgi.framework.ServiceReference
public boolean isAssignableTo(org.osgi.framework.Bundle bundle,
String className)
isAssignableTo in interface org.osgi.framework.ServiceReferencepublic void setProperties(Dictionary properties)
properties - public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic int compareTo(Object reference)
compareTo in interface ComparablecompareTo in interface org.osgi.framework.ServiceReference
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||