org.springframework.osgi.mock
Class MockServiceReference
java.lang.Object
org.springframework.osgi.mock.MockServiceReference
- All Implemented Interfaces:
- ServiceReference
public class MockServiceReference
- extends Object
- implements ServiceReference
ServiceReference mock.
This mock tries to adhere to the OSGi spec as much as possible by
providing the mandatory serviceId properties such as
Constants.SERVICE_ID
, Constants.OBJECTCLASS
and
Constants.SERVICE_RANKING
.
- Author:
- Costin Leau
MockServiceReference
public MockServiceReference()
MockServiceReference
public MockServiceReference(Bundle bundle)
MockServiceReference
public MockServiceReference(String[] classes)
MockServiceReference
public MockServiceReference(Bundle bundle,
String[] classes)
MockServiceReference
public MockServiceReference(ServiceRegistration registration)
MockServiceReference
public MockServiceReference(Bundle bundle,
Dictionary properties,
ServiceRegistration registration)
MockServiceReference
public MockServiceReference(Bundle bundle,
Dictionary properties,
ServiceRegistration registration,
String[] classes)
getBundle
public Bundle getBundle()
- Specified by:
getBundle
in interface ServiceReference
getProperty
public Object getProperty(String key)
- Specified by:
getProperty
in interface ServiceReference
getPropertyKeys
public String[] getPropertyKeys()
- Specified by:
getPropertyKeys
in interface ServiceReference
getUsingBundles
public Bundle[] getUsingBundles()
- Specified by:
getUsingBundles
in interface ServiceReference
isAssignableTo
public boolean isAssignableTo(Bundle bundle,
String className)
- Specified by:
isAssignableTo
in interface ServiceReference
setProperties
public void setProperties(Dictionary properties)
equals
public boolean equals(Object obj)
- Two mock service references are equal if they contain the same service
id.
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Return a hash code based on the class and service id.
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2006-2008 Spring Framework. All Rights Reserved.