Skip to content

Commit

Permalink
FELIX-5775 : Service properties not updated for lazy service when con…
Browse files Browse the repository at this point in the history
…figuration changes

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1821750 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
cziegeler committed Jan 20, 2018
1 parent 6bbb41b commit 4ca423d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void log(final int level, final String message, final Throwable ex)
{
if ( isLogEnabled( level ) )
{
getLogger().log(level, prefix.concat(message), ex);
getLogger().log(level, prefix.concat(" ").concat(message), ex);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ private Object getService()
return this;
}


ComponentMethods<S> getComponentMethods()
{
return m_componentMethods;
Expand Down Expand Up @@ -955,6 +956,11 @@ protected boolean unregisterService()
return true;
}

protected ServiceRegistration<S> getServiceRegistration()
{
return registrationManager.getServiceRegistration();
}

AtomicInteger getTrackingCount()
{
return m_trackingCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.felix.scr.impl.inject.MethodResult;
import org.apache.felix.scr.impl.inject.ReferenceMethod;
import org.apache.felix.scr.impl.manager.DependencyManager.OpenStatus;
import org.apache.felix.scr.impl.metadata.DSVersion;
import org.apache.felix.scr.impl.metadata.ReferenceMetadata;
import org.apache.felix.scr.impl.metadata.TargetedPID;
import org.osgi.framework.Bundle;
Expand Down Expand Up @@ -561,12 +562,6 @@ public Dictionary<String, Object> getServiceProperties()
return super.getServiceProperties();
}

final ServiceRegistration<S> getServiceRegistration()
{
return m_componentContext == null? null: m_componentContext.getServiceRegistration();
}


final ServiceReference<S> getServiceReference()
{
ServiceRegistration<S> reg = getServiceRegistration();
Expand All @@ -577,6 +572,16 @@ final ServiceReference<S> getServiceReference()
return null;
}

@Override
protected ServiceRegistration<S> getServiceRegistration()
{
if ( getComponentMetadata().getDSVersion() == DSVersion.DS12Felix )
{
return m_componentContext != null ? m_componentContext.getServiceRegistration() : null;
}
return super.getServiceRegistration();
}

private void updateServiceRegistration()
{
ServiceRegistration<S> sr = getServiceRegistration();
Expand Down

0 comments on commit 4ca423d

Please sign in to comment.