Skip to content

Commit

Permalink
Use the standard HK2 topic service
Browse files Browse the repository at this point in the history
Remove the temporary service and use the HK2 topic service instead
  • Loading branch information
OndroMih committed Jul 3, 2024
1 parent 26ff085 commit ff40c03
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
import org.glassfish.hk2.api.PostConstruct;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.api.TypeLiteral;
import org.glassfish.hk2.extras.ExtrasUtilities;
import org.glassfish.hk2.utilities.Binder;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.hk2util.SimpleTopicDistributionService;
import org.glassfish.internal.api.InternalSystemAdministrator;
import org.glassfish.internal.api.ServerContext;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer;
Expand Down Expand Up @@ -142,12 +142,7 @@ private JerseyContainer getJerseyContainer(ResourceConfig config) {
() -> this + ": Creating Jersey container for " + HttpHandler.class + " and " + config);
final GrizzlyHttpContainer httpHandler = ContainerFactory.createContainer(GrizzlyHttpContainer.class, config);
final ServiceLocator jerseyLocator = httpHandler.getApplicationHandler().getInjectionManager().getInstance(ServiceLocator.class);
/*
We enable a temporary distribution service until the HK2 Extras package is fixed so that we can enable
the topic distribution service provided by HK2.
*/
//ExtrasUtilities.enableTopicDistribution(jerseyLocator);
SimpleTopicDistributionService.enable(jerseyLocator);
ExtrasUtilities.enableTopicDistribution(jerseyLocator);
return new JerseyContainer() {
@Override
public void service(Request request, Response response) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
import org.glassfish.hk2.api.PostConstruct;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.api.TypeLiteral;
import org.glassfish.hk2.extras.ExtrasUtilities;
import org.glassfish.hk2.utilities.Binder;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.hk2util.SimpleTopicDistributionService;
import org.glassfish.internal.api.AdminAccessController;
import org.glassfish.internal.api.RemoteAdminAccessException;
import org.glassfish.internal.api.ServerContext;
Expand Down Expand Up @@ -282,12 +282,7 @@ private JerseyContainer getJerseyContainer(ResourceConfig config) {
() -> this + ": Creating Jersey container for " + HttpHandler.class + " and " + config);
final GrizzlyHttpContainer httpHandler = ContainerFactory.createContainer(GrizzlyHttpContainer.class, config);
final ServiceLocator jerseyLocator = httpHandler.getApplicationHandler().getInjectionManager().getInstance(ServiceLocator.class);
/*
We enable a temporary distribution service until the HK2 Extras package is fixed so that we can enable
the topic distribution service provided by HK2.
*/
//ExtrasUtilities.enableTopicDistribution(jerseyLocator);
SimpleTopicDistributionService.enable(jerseyLocator);
ExtrasUtilities.enableTopicDistribution(jerseyLocator);
return new JerseyContainer() {
@Override
public void service(Request request, Response response) throws Exception {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.glassfish.hk2.api.ServiceLocator;

import java.util.Properties;
import org.glassfish.hk2util.SimpleTopicDistributionService;
import org.glassfish.hk2.extras.ExtrasUtilities;

/**
* @author Sanjeeb.Sahoo@Sun.COM
Expand All @@ -43,8 +43,7 @@ public GlassFishImpl(ModuleStartup gfKernel, ServiceLocator habitat, Properties
We enable a temporary distribution service until the HK2 Extras package is fixed so that we can enable
the topic distribution service provided by HK2.
*/
//ExtrasUtilities.enableTopicDistribution(habitat);
SimpleTopicDistributionService.enable(habitat);
ExtrasUtilities.enableTopicDistribution(habitat);

configure(gfProps);
}
Expand Down

0 comments on commit ff40c03

Please sign in to comment.