@@ -0,0 +1,2702 @@
+package com.github.rinfield.app.resource;%0A%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0Aimport java.util.stream.Collectors;%0A%0Aimport javax.inject.Inject;%0Aimport javax.ws.rs.GET;%0Aimport javax.ws.rs.Path;%0Aimport javax.ws.rs.Produces;%0Aimport javax.ws.rs.core.Response;%0A%0Aimport org.glassfish.hk2.api.ActiveDescriptor;%0Aimport org.glassfish.hk2.api.DescriptorType;%0Aimport org.glassfish.hk2.api.DescriptorVisibility;%0Aimport org.glassfish.hk2.api.ServiceHandle;%0Aimport org.glassfish.hk2.api.ServiceLocator;%0A%0A@Path(%22/hk2%22)%0A@Produces(%22application/json%22)%0Apublic class HK2StatusResource %7B%0A%0A    @Inject%0A    private ServiceLocator locator;%0A%0A    @GET%0A    public Response get() %7B%0A        final List%3C?%3E result = locator.getAllServiceHandles(sh -%3E true)%0A            .stream().map(DescriptorResponse::from)%0A            .sorted((a, b) -%3E a.id.compareTo(b.id))%0A            .collect(Collectors.toList());%0A        return Response.ok(result).build();%0A    %7D%0A%0A    public static class DescriptorResponse %7B%0A        public final Long id;%0A        public final Long locatorId;%0A        public final Set%3CString%3E contracts;%0A        public final String implementation;%0A        public final String scope;%0A        public final Integer rank;%0A        public final Set%3CString%3E qualifiers;%0A        public final DescriptorType descriptorType;%0A        public final DescriptorVisibility descriptorVisibility;%0A        public final Map%3CString, List%3CString%3E%3E metadata;%0A        public final String loader;%0A        public final String analysisName;%0A        public final Integer identityHashCode;%0A        public final Boolean proxyable;%0A        public final Boolean proxyForSameScope;%0A        public final Boolean reified;%0A%0A        public static DescriptorResponse from(final ServiceHandle%3C?%3E handle) %7B%0A            return new DescriptorResponse(handle.getActiveDescriptor());%0A        %7D%0A%0A        public DescriptorResponse(final ActiveDescriptor%3C?%3E d) %7B%0A            implementation = d.getImplementation();%0A            contracts = d.getAdvertisedContracts();%0A            scope = d.getScope();%0A            qualifiers = d.getQualifiers();%0A            descriptorType = d.getDescriptorType();%0A            descriptorVisibility = d.getDescriptorVisibility();%0A            metadata = d.getMetadata();%0A            rank = d.getRanking();%0A            loader = d.getLoader() == null ? null : d.getLoader().toString();%0A            proxyable = d.isProxiable();%0A            proxyForSameScope = d.isProxyForSameScope();%0A            analysisName = d.getClassAnalysisName();%0A            id = d.getServiceId();%0A            locatorId = d.getLocatorId();%0A            identityHashCode = d.hashCode();%0A            reified = d.isReified();%0A        %7D%0A    %7D%0A%7D%0A

add resouce for hk2 status