Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*******************************************************************************/
package org.apache.wink.server.internal.application;
import java.lang.reflect.Modifier;
import java.util.Set;
import javax.ws.rs.core.Application;
import org.apache.wink.common.WinkApplication;
import org.apache.wink.common.internal.i18n.Messages;
import org.apache.wink.common.internal.registry.ProvidersRegistry;
import org.apache.wink.common.internal.registry.metadata.ProviderMetadataCollector;
import org.apache.wink.common.internal.registry.metadata.ResourceMetadataCollector;
import org.apache.wink.server.internal.registry.ResourceRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Processes the Application object. First singletons are processed and later
* classes. If the provided Application extends WinkApplication, instances are
* also processed AFTER the singletons and the classes.
*
* Pay Attention that classes returned by getSingletons are ignored by both
* getClasses and getInstances. And classes returned by getClasses are ignored
* by getInstances.
*
* @see Application
* @see WinkApplication
*/
public class ApplicationProcessor {
private static final Logger logger = LoggerFactory.getLogger(ApplicationProcessor.class);
private final Application application;
private final ResourceRegistry resourceRegistry;
private final ProvidersRegistry providersRegistry;
private final boolean isSystemApplication;
public ApplicationProcessor(Application application,
ResourceRegistry resourceRegistry,
ProvidersRegistry providersRegistry,
boolean isSystemApplication) {
super();
this.application = application;
this.resourceRegistry = resourceRegistry;
this.providersRegistry = providersRegistry;
this.isSystemApplication = isSystemApplication;
}
public void process() {
logger.trace("Processing Application: {}", application); //$NON-NLS-1$
double priority = WinkApplication.DEFAULT_PRIORITY;
if (application instanceof WinkApplication) {
priority = ((WinkApplication)application).getPriority();
logger.trace("WinkApplication priority is set to: {}", priority); //$NON-NLS-1$
}
// process singletons
Set