org.springframework.osgi.mock
Class MockServiceRegistration

java.lang.Object
  extended by org.springframework.osgi.mock.MockServiceRegistration
All Implemented Interfaces:
ServiceRegistration

public class MockServiceRegistration
extends Object
implements ServiceRegistration

ServiceRegistration mock.

The mock allows the service properties modification (through setProperties(Dictionary)) as long as the underlying reference is of type MockServiceReference.

Author:
Costin Leau

Constructor Summary
MockServiceRegistration()
          Constructs a new MockServiceRegistration instance using defaults.
MockServiceRegistration(Dictionary props)
          Constructs a new MockServiceRegistration instance with the given properties.
MockServiceRegistration(String[] clazz, Dictionary props)
          Constructs a new MockServiceRegistration instance using the given class names and properties.
 
Method Summary
 boolean equals(Object obj)
           
 ServiceReference getReference()
           
 int hashCode()
           
 void setProperties(Dictionary props)
           
 void setReference(ServiceReference reference)
          Sets the service reference associated with this registration.
 void unregister()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockServiceRegistration

public MockServiceRegistration()
Constructs a new MockServiceRegistration instance using defaults.


MockServiceRegistration

public MockServiceRegistration(Dictionary props)
Constructs a new MockServiceRegistration instance with the given properties.

Parameters:
props - registration properties

MockServiceRegistration

public MockServiceRegistration(String[] clazz,
                               Dictionary props)
Constructs a new MockServiceRegistration instance using the given class names and properties.

Parameters:
clazz -
props -
Method Detail

getReference

public ServiceReference getReference()
Specified by:
getReference in interface ServiceRegistration

setReference

public void setReference(ServiceReference reference)
Sets the service reference associated with this registration.

Parameters:
reference - service reference

setProperties

public void setProperties(Dictionary props)
Specified by:
setProperties in interface ServiceRegistration

unregister

public void unregister()
Specified by:
unregister in interface ServiceRegistration

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2006-2011 Spring Framework. All Rights Reserved.