Java Code Examples for com.sun.xml.internal.ws.api.server.Container#getSPI()

The following examples show how to use com.sun.xml.internal.ws.api.server.Container#getSPI() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetroConfigLoader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
MetroConfigLoader(Container container, MetroConfigName defaultTubesConfigNames) {
    this.defaultTubesConfigNames = defaultTubesConfigNames;
    ResourceLoader spiResourceLoader = null;
    if (container != null) {
        spiResourceLoader = container.getSPI(ResourceLoader.class);
    }
    // if spi resource can't load resource, default (MetroConfigUrlLoader) is used;
    // it searches the classpath, so it would be most probably used
    // when using jaxws- or metro-defaults from jaxws libraries
    init(container, spiResourceLoader, new MetroConfigUrlLoader(container));
}
 
Example 2
Source File: MetroConfigLoader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
MetroConfigLoader(Container container, MetroConfigName defaultTubesConfigNames) {
    this.defaultTubesConfigNames = defaultTubesConfigNames;
    ResourceLoader spiResourceLoader = null;
    if (container != null) {
        spiResourceLoader = container.getSPI(ResourceLoader.class);
    }
    // if spi resource can't load resource, default (MetroConfigUrlLoader) is used;
    // it searches the classpath, so it would be most probably used
    // when using jaxws- or metro-defaults from jaxws libraries
    init(container, spiResourceLoader, new MetroConfigUrlLoader(container));
}
 
Example 3
Source File: EndpointFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> createEndpoint(
        Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker,
        @Nullable QName serviceName, @Nullable QName portName,
        @Nullable Container container, @Nullable WSBinding binding,
        @Nullable SDDocumentSource primaryWsdl,
        @Nullable Collection<? extends SDDocumentSource> metadata,
        EntityResolver resolver, boolean isTransportSynchronous, boolean isStandard) {
    EndpointFactory factory = container != null ? container.getSPI(EndpointFactory.class) : null;
    if (factory == null)
            factory = EndpointFactory.getInstance();

    return factory.create(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);
}
 
Example 4
Source File: EndpointFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> createEndpoint(
        Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker,
        @Nullable QName serviceName, @Nullable QName portName,
        @Nullable Container container, @Nullable WSBinding binding,
        @Nullable SDDocumentSource primaryWsdl,
        @Nullable Collection<? extends SDDocumentSource> metadata,
        EntityResolver resolver, boolean isTransportSynchronous, boolean isStandard) {
    EndpointFactory factory = container != null ? container.getSPI(EndpointFactory.class) : null;
    if (factory == null)
            factory = EndpointFactory.getInstance();

    return factory.create(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);
}
 
Example 5
Source File: MetroConfigLoader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
MetroConfigLoader(Container container, MetroConfigName defaultTubesConfigNames) {
    this.defaultTubesConfigNames = defaultTubesConfigNames;
    ResourceLoader spiResourceLoader = null;
    if (container != null) {
        spiResourceLoader = container.getSPI(ResourceLoader.class);
    }
    // if spi resource can't load resource, default (MetroConfigUrlLoader) is used;
    // it searches the classpath, so it would be most probably used
    // when using jaxws- or metro-defaults from jaxws libraries
    init(container, spiResourceLoader, new MetroConfigUrlLoader(container));
}
 
Example 6
Source File: MetroConfigLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
MetroConfigLoader(Container container, MetroConfigName defaultTubesConfigNames) {
    this.defaultTubesConfigNames = defaultTubesConfigNames;
    ResourceLoader spiResourceLoader = null;
    if (container != null) {
        spiResourceLoader = container.getSPI(ResourceLoader.class);
    }
    // if spi resource can't load resource, default (MetroConfigUrlLoader) is used;
    // it searches the classpath, so it would be most probably used
    // when using jaxws- or metro-defaults from jaxws libraries
    init(container, spiResourceLoader, new MetroConfigUrlLoader(container));
}
 
Example 7
Source File: EndpointFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> createEndpoint(
        Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker,
        @Nullable QName serviceName, @Nullable QName portName,
        @Nullable Container container, @Nullable WSBinding binding,
        @Nullable SDDocumentSource primaryWsdl,
        @Nullable Collection<? extends SDDocumentSource> metadata,
        EntityResolver resolver, boolean isTransportSynchronous, boolean isStandard) {
    EndpointFactory factory = container != null ? container.getSPI(EndpointFactory.class) : null;
    if (factory == null)
            factory = EndpointFactory.getInstance();

    return factory.create(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);
}
 
Example 8
Source File: WSDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example 9
Source File: EndpointFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> createEndpoint(
        Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker,
        @Nullable QName serviceName, @Nullable QName portName,
        @Nullable Container container, @Nullable WSBinding binding,
        @Nullable SDDocumentSource primaryWsdl,
        @Nullable Collection<? extends SDDocumentSource> metadata,
        EntityResolver resolver, boolean isTransportSynchronous, boolean isStandard) {
    EndpointFactory factory = container != null ? container.getSPI(EndpointFactory.class) : null;
    if (factory == null)
            factory = EndpointFactory.getInstance();

    return factory.create(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);
}
 
Example 10
Source File: MetroConfigLoader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
MetroConfigLoader(Container container, MetroConfigName defaultTubesConfigNames) {
    this.defaultTubesConfigNames = defaultTubesConfigNames;
    ResourceLoader spiResourceLoader = null;
    if (container != null) {
        spiResourceLoader = container.getSPI(ResourceLoader.class);
    }
    // if spi resource can't load resource, default (MetroConfigUrlLoader) is used;
    // it searches the classpath, so it would be most probably used
    // when using jaxws- or metro-defaults from jaxws libraries
    init(container, spiResourceLoader, new MetroConfigUrlLoader(container));
}
 
Example 11
Source File: EndpointFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> createEndpoint(
        Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker,
        @Nullable QName serviceName, @Nullable QName portName,
        @Nullable Container container, @Nullable WSBinding binding,
        @Nullable SDDocumentSource primaryWsdl,
        @Nullable Collection<? extends SDDocumentSource> metadata,
        EntityResolver resolver, boolean isTransportSynchronous, boolean isStandard) {
    EndpointFactory factory = container != null ? container.getSPI(EndpointFactory.class) : null;
    if (factory == null)
            factory = EndpointFactory.getInstance();

    return factory.create(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);
}
 
Example 12
Source File: MetroConfigLoader.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void init(Container container, ResourceLoader... loaders) {

        String appFileName = null;
        String defaultFileName = null;
        if (container != null) {
            MetroConfigName mcn = container.getSPI(MetroConfigName.class);
            if (mcn != null) {
                appFileName = mcn.getAppFileName();
                defaultFileName = mcn.getDefaultFileName();
            }
        }
        if (appFileName == null) {
            appFileName = defaultTubesConfigNames.getAppFileName();
        }

        if (defaultFileName == null) {
            defaultFileName = defaultTubesConfigNames.getDefaultFileName();
        }
        this.defaultConfigUrl = locateResource(defaultFileName, loaders);
        if (defaultConfigUrl == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0001_DEFAULT_CFG_FILE_NOT_FOUND(defaultFileName)));
        }

        LOGGER.config(TubelineassemblyMessages.MASM_0002_DEFAULT_CFG_FILE_LOCATED(defaultFileName, defaultConfigUrl));
        this.defaultConfig = MetroConfigLoader.loadMetroConfig(defaultConfigUrl);
        if (defaultConfig == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0003_DEFAULT_CFG_FILE_NOT_LOADED(defaultFileName)));
        }
        if (defaultConfig.getTubelines() == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0004_NO_TUBELINES_SECTION_IN_DEFAULT_CFG_FILE(defaultFileName)));
        }
        if (defaultConfig.getTubelines().getDefault() == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0005_NO_DEFAULT_TUBELINE_IN_DEFAULT_CFG_FILE(defaultFileName)));
        }

        this.appConfigUrl = locateResource(appFileName, loaders);
        if (appConfigUrl != null) {
            LOGGER.config(TubelineassemblyMessages.MASM_0006_APP_CFG_FILE_LOCATED(appConfigUrl));
            this.appConfig = MetroConfigLoader.loadMetroConfig(appConfigUrl);
        } else {
            LOGGER.config(TubelineassemblyMessages.MASM_0007_APP_CFG_FILE_NOT_FOUND());
            this.appConfig = null;
        }
    }
 
Example 13
Source File: MetroConfigLoader.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
MetroConfigUrlLoader(Container container) {
    this((container != null) ? container.getSPI(ResourceLoader.class) : null);
    this.container = container;
}
 
Example 14
Source File: MetroConfigLoader.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
MetroConfigUrlLoader(Container container) {
    this((container != null) ? container.getSPI(ResourceLoader.class) : null);
    this.container = container;
}
 
Example 15
Source File: MetroConfigLoader.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
MetroConfigUrlLoader(Container container) {
    this((container != null) ? container.getSPI(ResourceLoader.class) : null);
    this.container = container;
}
 
Example 16
Source File: MetroConfigLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void init(Container container, ResourceLoader... loaders) {

        String appFileName = null;
        String defaultFileName = null;
        if (container != null) {
            MetroConfigName mcn = container.getSPI(MetroConfigName.class);
            if (mcn != null) {
                appFileName = mcn.getAppFileName();
                defaultFileName = mcn.getDefaultFileName();
            }
        }
        if (appFileName == null) {
            appFileName = defaultTubesConfigNames.getAppFileName();
        }

        if (defaultFileName == null) {
            defaultFileName = defaultTubesConfigNames.getDefaultFileName();
        }
        this.defaultConfigUrl = locateResource(defaultFileName, loaders);
        if (defaultConfigUrl == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0001_DEFAULT_CFG_FILE_NOT_FOUND(defaultFileName)));
        }

        LOGGER.config(TubelineassemblyMessages.MASM_0002_DEFAULT_CFG_FILE_LOCATED(defaultFileName, defaultConfigUrl));
        this.defaultConfig = MetroConfigLoader.loadMetroConfig(defaultConfigUrl);
        if (defaultConfig == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0003_DEFAULT_CFG_FILE_NOT_LOADED(defaultFileName)));
        }
        if (defaultConfig.getTubelines() == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0004_NO_TUBELINES_SECTION_IN_DEFAULT_CFG_FILE(defaultFileName)));
        }
        if (defaultConfig.getTubelines().getDefault() == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0005_NO_DEFAULT_TUBELINE_IN_DEFAULT_CFG_FILE(defaultFileName)));
        }

        this.appConfigUrl = locateResource(appFileName, loaders);
        if (appConfigUrl != null) {
            LOGGER.config(TubelineassemblyMessages.MASM_0006_APP_CFG_FILE_LOCATED(appConfigUrl));
            this.appConfig = MetroConfigLoader.loadMetroConfig(appConfigUrl);
        } else {
            LOGGER.config(TubelineassemblyMessages.MASM_0007_APP_CFG_FILE_NOT_FOUND());
            this.appConfig = null;
        }
    }
 
Example 17
Source File: MetroConfigLoader.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
MetroConfigUrlLoader(Container container) {
    this((container != null) ? container.getSPI(ResourceLoader.class) : null);
    this.container = container;
}
 
Example 18
Source File: MetroConfigLoader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void init(Container container, ResourceLoader... loaders) {

        String appFileName = null;
        String defaultFileName = null;
        if (container != null) {
            MetroConfigName mcn = container.getSPI(MetroConfigName.class);
            if (mcn != null) {
                appFileName = mcn.getAppFileName();
                defaultFileName = mcn.getDefaultFileName();
            }
        }
        if (appFileName == null) {
            appFileName = defaultTubesConfigNames.getAppFileName();
        }

        if (defaultFileName == null) {
            defaultFileName = defaultTubesConfigNames.getDefaultFileName();
        }
        this.defaultConfigUrl = locateResource(defaultFileName, loaders);
        if (defaultConfigUrl == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0001_DEFAULT_CFG_FILE_NOT_FOUND(defaultFileName)));
        }

        LOGGER.config(TubelineassemblyMessages.MASM_0002_DEFAULT_CFG_FILE_LOCATED(defaultFileName, defaultConfigUrl));
        this.defaultConfig = MetroConfigLoader.loadMetroConfig(defaultConfigUrl);
        if (defaultConfig == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0003_DEFAULT_CFG_FILE_NOT_LOADED(defaultFileName)));
        }
        if (defaultConfig.getTubelines() == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0004_NO_TUBELINES_SECTION_IN_DEFAULT_CFG_FILE(defaultFileName)));
        }
        if (defaultConfig.getTubelines().getDefault() == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0005_NO_DEFAULT_TUBELINE_IN_DEFAULT_CFG_FILE(defaultFileName)));
        }

        this.appConfigUrl = locateResource(appFileName, loaders);
        if (appConfigUrl != null) {
            LOGGER.config(TubelineassemblyMessages.MASM_0006_APP_CFG_FILE_LOCATED(appConfigUrl));
            this.appConfig = MetroConfigLoader.loadMetroConfig(appConfigUrl);
        } else {
            LOGGER.config(TubelineassemblyMessages.MASM_0007_APP_CFG_FILE_NOT_FOUND());
            this.appConfig = null;
        }
    }
 
Example 19
Source File: MetroConfigLoader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
MetroConfigUrlLoader(Container container) {
    this((container != null) ? container.getSPI(ResourceLoader.class) : null);
    this.container = container;
}
 
Example 20
Source File: MetroConfigLoader.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
MetroConfigUrlLoader(Container container) {
    this((container != null) ? container.getSPI(ResourceLoader.class) : null);
    this.container = container;
}