Search in sources :

Example 1 with IndexedFilter

use of org.glassfish.hk2.api.IndexedFilter in project Payara by payara.

the class HK2DomConfigUtilities method addIfNotThere.

private static boolean addIfNotThere(ServiceLocator locator, DynamicConfiguration config, DescriptorImpl desc, HK2Loader loader) {
    IndexedFilter filter = BuilderHelper.createContractFilter(desc.getImplementation());
    if (locator.getBestDescriptor(filter) != null)
        return false;
    if (loader != null) {
        desc.setLoader(loader);
    }
    config.bind(desc);
    return true;
}
Also used : IndexedFilter(org.glassfish.hk2.api.IndexedFilter)

Example 2 with IndexedFilter

use of org.glassfish.hk2.api.IndexedFilter in project Payara by payara.

the class GlassfishNetworkListener method stop.

@Override
public void stop() throws IOException {
    ServiceLocator locator = grizzlyService.getHabitat();
    IndexedFilter removeFilter = BuilderHelper.createNameAndContractFilter(Mapper.class.getName(), (address.toString() + port));
    DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
    DynamicConfiguration config = dcs.createDynamicConfiguration();
    config.addUnbindFilter(removeFilter);
    config.commit();
    unregisterMonitoringStatsProviders();
    super.stop();
}
Also used : ServiceLocator(org.glassfish.hk2.api.ServiceLocator) IndexedFilter(org.glassfish.hk2.api.IndexedFilter) V3Mapper(org.glassfish.internal.grizzly.V3Mapper) Mapper(org.glassfish.grizzly.http.server.util.Mapper) DynamicConfigurationService(org.glassfish.hk2.api.DynamicConfigurationService) DynamicConfiguration(org.glassfish.hk2.api.DynamicConfiguration)

Aggregations

IndexedFilter (org.glassfish.hk2.api.IndexedFilter)2 Mapper (org.glassfish.grizzly.http.server.util.Mapper)1 DynamicConfiguration (org.glassfish.hk2.api.DynamicConfiguration)1 DynamicConfigurationService (org.glassfish.hk2.api.DynamicConfigurationService)1 ServiceLocator (org.glassfish.hk2.api.ServiceLocator)1 V3Mapper (org.glassfish.internal.grizzly.V3Mapper)1