felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1567311 - in /felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl: ServiceDependencyImpl.java ServiceEventImpl.java
Date Tue, 11 Feb 2014 19:20:26 GMT
Author: marrs
Date: Tue Feb 11 19:20:26 2014
New Revision: 1567311

URL: http://svn.apache.org/r1567311
Log:
Moved SEI to its own file, added equals/hashCode.

Added:
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceEventImpl.java
Modified:
    felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceDependencyImpl.java

Modified: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceDependencyImpl.java?rev=1567311&r1=1567310&r2=1567311&view=diff
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceDependencyImpl.java
(original)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceDependencyImpl.java
Tue Feb 11 19:20:26 2014
@@ -50,15 +50,4 @@ public class ServiceDependencyImpl exten
 	public void removedService(ServiceReference reference, Object service) {
 		remove(new ServiceEventImpl(reference, service));
 	}
-	
-	private static class ServiceEventImpl extends EventImpl {
-		private ServiceReference m_reference;
-		private Object m_service;
-
-		public ServiceEventImpl(ServiceReference reference, Object service) {
-			super();
-			m_reference = reference;
-			m_service = service;
-		}
-	}
 }

Added: felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceEventImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceEventImpl.java?rev=1567311&view=auto
==============================================================================
--- felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceEventImpl.java (added)
+++ felix/sandbox/marrs/dependencymanager-prototype/dm/src/dm/impl/ServiceEventImpl.java Tue
Feb 11 19:20:26 2014
@@ -0,0 +1,35 @@
+package dm.impl;
+
+import org.osgi.framework.ServiceReference;
+
+public class ServiceEventImpl extends EventImpl {
+	private final ServiceReference m_reference;
+	private final Object m_service;
+
+	public ServiceEventImpl(ServiceReference reference, Object service) {
+		m_reference = reference;
+		m_service = service;
+	}
+	
+	public ServiceReference getReference() {
+		return m_reference;
+	}
+	
+	public Object getService() {
+		return m_service;
+	}
+	
+	@Override
+	public boolean equals(Object obj) {
+		if (obj instanceof ServiceEventImpl) {
+			ServiceEventImpl sdi = (ServiceEventImpl) obj;
+			return sdi.getReference().equals(getReference());
+		}
+		return false;
+	}
+	
+	@Override
+	public int hashCode() {
+		return getReference().hashCode();
+	}
+}
\ No newline at end of file



Mime
View raw message