for (final Resource programmaticResource : runtimeConfig.getResources()) { resourceBagBuilder.registerProgrammaticResource(programmaticResource);
for (final Resource programmaticResource : runtimeConfig.getResources()) { resourceBagBuilder.registerProgrammaticResource(programmaticResource);
/** * Merges fields (e.g. custom binders, properties) of the given application with this application. * <p> * The merging should be done because of the possibility of reloading this {@code ResourceConfig} in a container * so this resource config should know about custom binders and properties of the underlying application to ensure * the reload process will complete successfully. * </p> * * @param application the application which fields should be merged with this application. * @see org.glassfish.jersey.server.spi.Container#reload() * @see org.glassfish.jersey.server.spi.Container#reload(ResourceConfig) */ private void mergeApplications(final Application application) { if (application instanceof ResourceConfig) { // Merge custom binders. final ResourceConfig rc = (ResourceConfig) application; // Merge resources super.registerResources(rc.getResources()); // properties set on the wrapping resource config take precedence // (as those are retrieved from the web.xml, for example) rc.invalidateCache(); rc.addProperties(super.getProperties()); super.addProperties(rc.getProperties()); super.setApplicationName(rc.getApplicationName()); super.setClassLoader(rc.getClassLoader()); rc.lock(); } else if (application != null) { super.addProperties(application.getProperties()); } }
/** * Merges fields (e.g. custom binders, properties) of the given application with this application. * <p> * The merging should be done because of the possibility of reloading this {@code ResourceConfig} in a container * so this resource config should know about custom binders and properties of the underlying application to ensure * the reload process will complete successfully. * </p> * * @param application the application which fields should be merged with this application. * @see org.glassfish.jersey.server.spi.Container#reload() * @see org.glassfish.jersey.server.spi.Container#reload(ResourceConfig) */ private void mergeApplications(final Application application) { if (application instanceof ResourceConfig) { // Merge custom binders. final ResourceConfig rc = (ResourceConfig) application; // Merge resources super.registerResources(rc.getResources()); // properties set on the wrapping resource config take precedence // (as those are retrieved from the web.xml, for example) rc.invalidateCache(); rc.addProperties(super.getProperties()); super.addProperties(rc.getProperties()); super.setApplicationName(rc.getApplicationName()); super.setClassLoader(rc.getClassLoader()); rc.lock(); } else if (application != null) { super.addProperties(application.getProperties()); } }
for (final Resource programmaticResource : runtimeConfig.getResources()) { resourceBagBuilder.registerProgrammaticResource(programmaticResource);
/** * <p>getResources.</p> * * @return a {@link java.util.Set} object. */ public Set<Resource> getResources() { return config.getResources(); }
/** * Merges fields (e.g. custom binders, properties) of the given application with this application. * <p> * The merging should be done because of the possibility of reloading this {@code ResourceConfig} in a container * so this resource config should know about custom binders and properties of the underlying application to ensure * the reload process will complete successfully. * </p> * * @param application the application which fields should be merged with this application. * @see org.glassfish.jersey.server.spi.Container#reload() * @see org.glassfish.jersey.server.spi.Container#reload(ResourceConfig) */ private void mergeApplications(final Application application) { if (application instanceof ResourceConfig) { // Merge custom binders. final ResourceConfig rc = (ResourceConfig) application; // Merge resources super.registerResources(rc.getResources()); // properties set on the wrapping resource config take precedence // (as those are retrieved from the web.xml, for example) rc.invalidateCache(); rc.addProperties(super.getProperties()); super.addProperties(rc.getProperties()); super.setApplicationName(rc.getApplicationName()); super.setClassLoader(rc.getClassLoader()); rc.lock(); } else if (application != null) { super.addProperties(application.getProperties()); } }
protected void unregisterEndpoint(String endpointReferenceId) { Object endpoint = endpoints.remove(endpointReferenceId); if (endpoint == null) { return; } Class<?> endpointClass = endpoint.getClass(); ResourceConfig config = new ResourceConfig(); ResourceConfig orgConfig = getConfiguration(); if (supportDynamicPath(endpointClass) && endpoint instanceof AbstractEndpoint) { String configuredPath = ((AbstractEndpoint) endpoint).getEndpointDefinition().getEndpointPath(); String path = StringUtils.isEmpty(configuredPath) ? getBasePath(endpointReferenceId) : truncatePath(configuredPath); // re-register legacy resource except the un-registered one. orgConfig.getResources().stream() .filter(r -> !r.getPath().startsWith(path)) .forEach(r -> config.registerResources(r)); // non-dynamic endpoints kept as is. orgConfig.getInstances().forEach(i -> config.register(i)); log.debug("Unregister endpoint {} with base path {} from registry.", endpointReferenceId, path); } else { // re-register instances except removed one. orgConfig.getInstances().stream() .filter(instance -> instance != endpoint) .forEach(instance -> config.register(instance)); // keep resources as is orgConfig.getResources().forEach(r -> config.registerResources(r)); log.debug("Unregister endpoint which has reference id: {} from registry.", endpointReferenceId); } config.registerClasses(orgConfig.getClasses()); reload(config); }
for (final Resource programmaticResource : runtimeConfig.getResources()) { resourceBagBuilder.registerProgrammaticResource(programmaticResource);
config = new ResourceConfig(); config.registerClasses(originalConfig.getClasses()); config.registerResources(originalConfig.getResources()); for (Object i : originalConfig.getInstances()) { config.register(i);
/** * Merges fields (e.g. custom binders, properties) of the given application with this application. * <p> * The merging should be done because of the possibility of reloading this {@code ResourceConfig} in a container * so this resource config should know about custom binders and properties of the underlying application to ensure * the reload process will complete successfully. * </p> * * @param application the application which fields should be merged with this application. * @see org.glassfish.jersey.server.spi.Container#reload() * @see org.glassfish.jersey.server.spi.Container#reload(ResourceConfig) */ private void mergeApplications(final Application application) { if (application instanceof ResourceConfig) { // Merge custom binders. final ResourceConfig rc = (ResourceConfig) application; // Merge resources super.registerResources(rc.getResources()); // properties set on the wrapping resource config take precedence // (as those are retrieved from the web.xml, for example) rc.invalidateCache(); rc.addProperties(super.getProperties()); super.addProperties(rc.getProperties()); super.setApplicationName(rc.getApplicationName()); super.setClassLoader(rc.getClassLoader()); rc.lock(); } else if (application != null) { super.addProperties(application.getProperties()); } }
/** * Merges fields (e.g. custom binders, properties) of the given application with this application. * <p> * The merging should be done because of the possibility of reloading this {@code ResourceConfig} in a container * so this resource config should know about custom binders and properties of the underlying application to ensure * the reload process will complete successfully. * </p> * * @param application the application which fields should be merged with this application. * @see org.glassfish.jersey.server.spi.Container#reload() * @see org.glassfish.jersey.server.spi.Container#reload(ResourceConfig) */ private void mergeApplications(final Application application) { if (application instanceof ResourceConfig) { // Merge custom binders. final ResourceConfig rc = (ResourceConfig) application; // Merge resources super.registerResources(rc.getResources()); // properties set on the wrapping resource config take precedence // (as those are retrieved from the web.xml, for example) rc.invalidateCache(); rc.addProperties(super.getProperties()); super.addProperties(rc.getProperties()); super.setApplicationName(rc.getApplicationName()); super.setClassLoader(rc.getClassLoader()); rc.lock(); } else if (application != null) { super.addProperties(application.getProperties()); } }
/** * Merges fields (e.g. custom binders, properties) of the given application with this application. * <p> * The merging should be done because of the possibility of reloading this {@code ResourceConfig} in a container * so this resource config should know about custom binders and properties of the underlying application to ensure * the reload process will complete successfully. * </p> * * @param application the application which fields should be merged with this application. * @see org.glassfish.jersey.server.spi.Container#reload() * @see org.glassfish.jersey.server.spi.Container#reload(ResourceConfig) */ private void mergeApplications(final Application application) { if (application instanceof ResourceConfig) { // Merge custom binders. final ResourceConfig rc = (ResourceConfig) application; // Merge resources super.registerResources(rc.getResources()); // properties set on the wrapping resource config take precedence // (as those are retrieved from the web.xml, for example) rc.invalidateCache(); rc.addProperties(super.getProperties()); super.addProperties(rc.getProperties()); super.setApplicationName(rc.getApplicationName()); super.setClassLoader(rc.getClassLoader()); rc.lock(); } else if (application != null) { super.addProperties(application.getProperties()); } }
/** * Merges fields (e.g. custom binders, properties) of the given application with this application. * <p> * The merging should be done because of the possibility of reloading this {@code ResourceConfig} in a container * so this resource config should know about custom binders and properties of the underlying application to ensure * the reload process will complete successfully. * </p> * * @param application the application which fields should be merged with this application. * @see org.glassfish.jersey.server.spi.Container#reload() * @see org.glassfish.jersey.server.spi.Container#reload(ResourceConfig) */ private void mergeApplications(final Application application) { if (application instanceof ResourceConfig) { // Merge custom binders. final ResourceConfig rc = (ResourceConfig) application; // Merge resources super.registerResources(rc.getResources()); // properties set on the wrapping resource config take precedence // (as those are retrieved from the web.xml, for example) rc.invalidateCache(); rc.addProperties(super.getProperties()); super.addProperties(rc.getProperties()); super.setApplicationName(rc.getApplicationName()); super.setClassLoader(rc.getClassLoader()); rc.lock(); } else if (application != null) { super.addProperties(application.getProperties()); } }
for (final Resource programmaticResource : runtimeConfig.getResources()) { resourceBagBuilder.registerProgrammaticResource(programmaticResource);
for (final Resource programmaticResource : runtimeConfig.getResources()) { resourceBagBuilder.registerProgrammaticResource(programmaticResource);
for (final Resource programmaticResource : runtimeConfig.getResources()) { resourceBagBuilder.registerProgrammaticResource(programmaticResource);