Skip to content

Commit

Permalink
Bug 564282 - API revision | question extensibility
Browse files Browse the repository at this point in the history
 - remove outdated OSGi-component life cycle methods

Signed-off-by: elena.parovyshnaya <[email protected]>
  • Loading branch information
eparovyshnaya committed Jun 15, 2020
1 parent 6faffae commit a520c7e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
import org.eclipse.passage.lic.internal.base.requirements.UnsatisfiableRequirement;
import org.eclipse.passage.lic.internal.equinox.i18n.EquinoxMessages;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Deactivate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -48,16 +45,6 @@ public final class BundleRequirements implements ResolvedRequirements {
private final Logger logger = LoggerFactory.getLogger(BundleRequirements.class);
private Optional<BundleContext> context;

@Activate
public void activate() {
this.context = Optional.ofNullable(FrameworkUtil.getBundle(getClass()).getBundleContext());
}

@Deactivate
public void deactivate() {
this.context = Optional.empty();
}

@Override
public StringServiceId id() {
return new StringServiceId("manifest"); //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
import org.eclipse.passage.lic.internal.equinox.i18n.EquinoxMessages;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.runtime.ServiceComponentRuntime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -63,30 +60,6 @@ public StringServiceId id() {
return new StringServiceId("OSGi component"); //$NON-NLS-1$
}

@Activate
public void activate(BundleContext bundle) {
this.context = Optional.ofNullable(bundle);
}

@Deactivate
public void deactivate() {
this.context = Optional.empty();
}

@Reference
public void bindRuntime(ServiceComponentRuntime input) {
this.runtime = Optional.ofNullable(input);
}

public void unbindRuntime(ServiceComponentRuntime input) {
if (!runtime.isPresent()) {
return;
}
if (runtime.get() == input) {
runtime = Optional.empty();
}
}

@Override
public Collection<Requirement> all() {
if (!runtime.isPresent()) {
Expand Down

0 comments on commit a520c7e

Please sign in to comment.