com.sun.xml.internal.ws.resources.ModelerMessages Java Examples

The following examples show how to use com.sun.xml.internal.ws.resources.ModelerMessages. 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: WebServiceFeatureList.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #2
Source File: WebServiceFeatureList.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #3
Source File: WebServiceFeatureList.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #4
Source File: WebServiceFeatureList.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #5
Source File: WebServiceFeatureList.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #6
Source File: WebServiceFeatureList.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #7
Source File: WebServiceFeatureList.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #8
Source File: WebServiceFeatureList.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #9
Source File: WebServiceFeatureList.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void mergeFeatures(WebServiceFeature[] features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #10
Source File: WebServiceFeatureList.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Merges the extra features that are not already set on binding.
 * i.e, if a feature is set already on binding through some other API
 * the corresponding wsdlFeature is not set.
 *
 * @param features          Web Service features that need to be merged with already configured features.
 * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
 *                          policy configuration) conflicts with feature setting in Deployed Service and
 *                          logs warning if there are any conflicts.
 */
public void mergeFeatures(@NotNull Iterable<WebServiceFeature> features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #11
Source File: WebServiceFeatureList.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Merges the extra features that are not already set on binding.
 * i.e, if a feature is set already on binding through some other API
 * the corresponding wsdlFeature is not set.
 *
 * @param features          Web Service features that need to be merged with already configured features.
 * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
 *                          policy configuration) conflicts with feature setting in Deployed Service and
 *                          logs warning if there are any conflicts.
 */
public void mergeFeatures(@NotNull Iterable<WebServiceFeature> features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #12
Source File: WebServiceFeatureList.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void mergeFeatures(WebServiceFeature[] features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #13
Source File: WebServiceFeatureList.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Merges the extra features that are not already set on binding.
 * i.e, if a feature is set already on binding through some other API
 * the corresponding wsdlFeature is not set.
 *
 * @param features          Web Service features that need to be merged with already configured features.
 * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
 *                          policy configuration) conflicts with feature setting in Deployed Service and
 *                          logs warning if there are any conflicts.
 */
public void mergeFeatures(@NotNull Iterable<WebServiceFeature> features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #14
Source File: WebServiceFeatureList.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Merges the extra features that are not already set on binding.
 * i.e, if a feature is set already on binding through some other API
 * the corresponding wsdlFeature is not set.
 *
 * @param features          Web Service features that need to be merged with already configured features.
 * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
 *                          policy configuration) conflicts with feature setting in Deployed Service and
 *                          logs warning if there are any conflicts.
 */
public void mergeFeatures(@NotNull Iterable<WebServiceFeature> features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #15
Source File: WebServiceFeatureList.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void mergeFeatures(WebServiceFeature[] features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #16
Source File: WebServiceFeatureList.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Merges the extra features that are not already set on binding.
 * i.e, if a feature is set already on binding through some other API
 * the corresponding wsdlFeature is not set.
 *
 * @param features          Web Service features that need to be merged with already configured features.
 * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
 *                          policy configuration) conflicts with feature setting in Deployed Service and
 *                          logs warning if there are any conflicts.
 */
public void mergeFeatures(@NotNull Iterable<WebServiceFeature> features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #17
Source File: WebServiceFeatureList.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void mergeFeatures(WebServiceFeature[] features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #18
Source File: WebServiceFeatureList.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Merges the extra features that are not already set on binding.
 * i.e, if a feature is set already on binding through some other API
 * the corresponding wsdlFeature is not set.
 *
 * @param features          Web Service features that need to be merged with already configured features.
 * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
 *                          policy configuration) conflicts with feature setting in Deployed Service and
 *                          logs warning if there are any conflicts.
 */
public void mergeFeatures(@NotNull Iterable<WebServiceFeature> features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #19
Source File: WebServiceFeatureList.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void mergeFeatures(WebServiceFeature[] features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #20
Source File: WebServiceFeatureList.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void mergeFeatures(WebServiceFeature[] features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #21
Source File: WebServiceFeatureList.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Merges the extra features that are not already set on binding.
 * i.e, if a feature is set already on binding through some other API
 * the corresponding wsdlFeature is not set.
 *
 * @param features          Web Service features that need to be merged with already configured features.
 * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
 *                          policy configuration) conflicts with feature setting in Deployed Service and
 *                          logs warning if there are any conflicts.
 */
public void mergeFeatures(@NotNull Iterable<WebServiceFeature> features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #22
Source File: WebServiceFeatureList.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void mergeFeatures(WebServiceFeature[] features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #23
Source File: WebServiceFeatureList.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Merges the extra features that are not already set on binding.
 * i.e, if a feature is set already on binding through some other API
 * the corresponding wsdlFeature is not set.
 *
 * @param features          Web Service features that need to be merged with already configured features.
 * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
 *                          policy configuration) conflicts with feature setting in Deployed Service and
 *                          logs warning if there are any conflicts.
 */
public void mergeFeatures(@NotNull Iterable<WebServiceFeature> features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #24
Source File: WebServiceFeatureList.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void mergeFeatures(WebServiceFeature[] features, boolean reportConflicts) {
    for (WebServiceFeature wsdlFtr : features) {
        if (get(wsdlFtr.getClass()) == null) {
            add(wsdlFtr);
        } else if (reportConflicts) {
            if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
                LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
                                   get(wsdlFtr.getClass()), wsdlFtr));
            }
        }
    }
}
 
Example #25
Source File: RuntimeModeler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
     * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>.
     * @return the runtime model for the <code>portClass</code>.
     */
    public AbstractSEIModelImpl buildRuntimeModel() {
        model = new SOAPSEIModel(features);
        model.contractClass = config.getContractClass();
        model.endpointClass = config.getEndpointClass();
        model.classLoader = this.classLoader;
        model.wsBinding = wsBinding;
        model.databindingInfo.setWsdlURL(config.getWsdlURL());
        model.databindingInfo.properties().putAll(config.properties());
        if (model.contractClass == null) model.contractClass = portClass;
        if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass;
        Class<?> seiClass = portClass;
        metadataReader.getProperties(model.databindingInfo.properties(), portClass);
        WebService webService = getAnnotation(portClass, WebService.class);
        if (webService == null) {
            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
                portClass.getCanonicalName());
        }
        Class<?> seiFromConfig = configEndpointInterface();
        if (webService.endpointInterface().length() > 0 || seiFromConfig != null) {
                if (seiFromConfig != null) {
                        seiClass = seiFromConfig;
                } else {
                        seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface()));
                }
            model.contractClass = seiClass;
                model.endpointClass = portClass;
            WebService seiService = getAnnotation(seiClass, WebService.class);
            if (seiService == null) {
                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
                    webService.endpointInterface());
            }

            //check if @SOAPBinding is defined on the impl class
            SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class);
            SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class);
            if(sbPortClass != null){
                if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){
                    logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName()));
                }
            }
        }
        if (serviceName == null)
            serviceName = getServiceName(portClass, metadataReader);
        model.setServiceQName(serviceName);

//        String portLocalName  = portClass.getSimpleName()+PORT;
//        if (webService.portName().length() >0) {
//            portLocalName = webService.portName();
//        } else if (webService.name().length() >0) {
//            portLocalName = webService.name()+PORT;
//        }
//
//        if (portName == null)
//            portName = new QName(serviceName.getNamespaceURI(), portLocalName);
//        if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) {
//            throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch",
//                serviceName, portName);
//        }

        if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI());
        model.setPortName(portName);

        // Check if databinding is overridden in annotation.
        com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class);
        if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value());

        processClass(seiClass);
        if (model.getJavaMethods().size() == 0)
            throw new RuntimeModelerException("runtime.modeler.no.operations",
                    portClass.getName());
        model.postProcess();

        // Make the configured databinding mode available to the
        // DatabindingConfig.
        config.properties().put(BindingContext.class.getName(),
                model.bindingContext);

        // TODO: this needs to be fixed properly --
        // when we are building RuntimeModel first before building WSDLModel,
        // we still need to do this correctly
        if(binding!=null)
            model.freeze(binding);
        return model;
    }
 
Example #26
Source File: AbstractSEIModelImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void /*JAXBRIContext*/ createJAXBContext() {
        final List<TypeInfo> types = getAllTypeInfos();
        final List<Class> cls = new ArrayList<Class>(types.size() + additionalClasses.size());

        cls.addAll(additionalClasses);
        for (TypeInfo type : types) {
            cls.add((Class) type.type);
        }

        try {
            //jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false);
            // Need to avoid doPriv block once JAXB is fixed. Afterwards, use the above
            bindingContext = AccessController.doPrivileged(new PrivilegedExceptionAction<BindingContext>() {
                public BindingContext run() throws Exception {
                    if(LOGGER.isLoggable(Level.FINEST)) {
                        LOGGER.log(Level.FINEST, "Creating JAXBContext with classes={0} and types={1}", new Object[]{cls, types});
                    }
                    UsesJAXBContextFeature f = features.get(UsesJAXBContextFeature.class);
                    com.oracle.webservices.internal.api.databinding.DatabindingModeFeature dmf =
                            features.get(com.oracle.webservices.internal.api.databinding.DatabindingModeFeature.class);
                    JAXBContextFactory factory = f!=null ? f.getFactory() : null;
                    if(factory==null)   factory=JAXBContextFactory.DEFAULT;

//                    return factory.createJAXBContext(AbstractSEIModelImpl.this,cls,types);

                    databindingInfo.properties().put(JAXBContextFactory.class.getName(), factory);
                    if (dmf != null) {
                        if (LOGGER.isLoggable(Level.FINE))
                            LOGGER.log(Level.FINE, "DatabindingModeFeature in SEI specifies mode: {0}", dmf.getMode());
                        databindingInfo.setDatabindingMode(dmf
                                .getMode());
                    }

                        if (f!=null) databindingInfo.setDatabindingMode(BindingContextFactory.DefaultDatabindingMode);
                        databindingInfo.setClassLoader(classLoader);
                        databindingInfo.contentClasses().addAll(cls);
                        databindingInfo.typeInfos().addAll(types);
                        databindingInfo.properties().put("c14nSupport", Boolean.FALSE);
                        databindingInfo.setDefaultNamespace(AbstractSEIModelImpl.this.getDefaultSchemaNamespace());
                        BindingContext bc =  BindingContextFactory.create(databindingInfo);
                            if (LOGGER.isLoggable(Level.FINE))
                                LOGGER.log(Level.FINE,
                                        "Created binding context: "
                                                + bc.getClass().getName());
//                      System.out.println("---------------------- databinding " + bc);
                        return bc;
                }
            });
//          createBridgeMap(types);
            createBondMap(types);
        } catch (PrivilegedActionException e) {
            throw new WebServiceException(ModelerMessages.UNABLE_TO_CREATE_JAXB_CONTEXT(), e);
        }
        knownNamespaceURIs = new ArrayList<String>();
        for (String namespace : bindingContext.getKnownNamespaceURIs()) {
            if (namespace.length() > 0) {
                if (!namespace.equals(SOAPNamespaceConstants.XSD) && !namespace.equals(SOAPNamespaceConstants.XMLNS))
                    knownNamespaceURIs.add(namespace);
            }
        }

        marshallers = new Pool.Marshaller(jaxbContext);

        //return getJAXBContext();
    }
 
Example #27
Source File: RuntimeModeler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
     * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>.
     * @return the runtime model for the <code>portClass</code>.
     */
    public AbstractSEIModelImpl buildRuntimeModel() {
        model = new SOAPSEIModel(features);
        model.contractClass = config.getContractClass();
        model.endpointClass = config.getEndpointClass();
        model.classLoader = this.classLoader;
        model.wsBinding = wsBinding;
        model.databindingInfo.setWsdlURL(config.getWsdlURL());
        model.databindingInfo.properties().putAll(config.properties());
        if (model.contractClass == null) model.contractClass = portClass;
        if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass;
        Class<?> seiClass = portClass;
        metadataReader.getProperties(model.databindingInfo.properties(), portClass);
        WebService webService = getAnnotation(portClass, WebService.class);
        if (webService == null) {
            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
                portClass.getCanonicalName());
        }
        Class<?> seiFromConfig = configEndpointInterface();
        if (webService.endpointInterface().length() > 0 || seiFromConfig != null) {
                if (seiFromConfig != null) {
                        seiClass = seiFromConfig;
                } else {
                        seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface()));
                }
            model.contractClass = seiClass;
                model.endpointClass = portClass;
            WebService seiService = getAnnotation(seiClass, WebService.class);
            if (seiService == null) {
                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
                    webService.endpointInterface());
            }

            //check if @SOAPBinding is defined on the impl class
            SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class);
            SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class);
            if(sbPortClass != null){
                if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){
                    logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName()));
                }
            }
        }
        if (serviceName == null)
            serviceName = getServiceName(portClass, metadataReader);
        model.setServiceQName(serviceName);

//        String portLocalName  = portClass.getSimpleName()+PORT;
//        if (webService.portName().length() >0) {
//            portLocalName = webService.portName();
//        } else if (webService.name().length() >0) {
//            portLocalName = webService.name()+PORT;
//        }
//
//        if (portName == null)
//            portName = new QName(serviceName.getNamespaceURI(), portLocalName);
//        if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) {
//            throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch",
//                serviceName, portName);
//        }

        if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI());
        model.setPortName(portName);

        // Check if databinding is overridden in annotation.
        com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class);
        if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value());

        processClass(seiClass);
        if (model.getJavaMethods().size() == 0)
            throw new RuntimeModelerException("runtime.modeler.no.operations",
                    portClass.getName());
        model.postProcess();

        // Make the configured databinding mode available to the
        // DatabindingConfig.
        config.properties().put(BindingContext.class.getName(),
                model.bindingContext);

        // TODO: this needs to be fixed properly --
        // when we are building RuntimeModel first before building WSDLModel,
        // we still need to do this correctly
        if(binding!=null)
            model.freeze(binding);
        return model;
    }
 
Example #28
Source File: RuntimeModeler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
     * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>.
     * @return the runtime model for the <code>portClass</code>.
     */
    public AbstractSEIModelImpl buildRuntimeModel() {
        model = new SOAPSEIModel(features);
        model.contractClass = config.getContractClass();
        model.endpointClass = config.getEndpointClass();
        model.classLoader = this.classLoader;
        model.wsBinding = wsBinding;
        model.databindingInfo.setWsdlURL(config.getWsdlURL());
        model.databindingInfo.properties().putAll(config.properties());
        if (model.contractClass == null) model.contractClass = portClass;
        if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass;
        Class<?> seiClass = portClass;
        metadataReader.getProperties(model.databindingInfo.properties(), portClass);
        WebService webService = getAnnotation(portClass, WebService.class);
        if (webService == null) {
            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
                portClass.getCanonicalName());
        }
        Class<?> seiFromConfig = configEndpointInterface();
        if (webService.endpointInterface().length() > 0 || seiFromConfig != null) {
                if (seiFromConfig != null) {
                        seiClass = seiFromConfig;
                } else {
                        seiClass = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface()));
                }
            model.contractClass = seiClass;
                model.endpointClass = portClass;
            WebService seiService = getAnnotation(seiClass, WebService.class);
            if (seiService == null) {
                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
                    webService.endpointInterface());
            }

            //check if @SOAPBinding is defined on the impl class
            SOAPBinding sbPortClass = getAnnotation(portClass, SOAPBinding.class);
            SOAPBinding sbSei = getAnnotation(seiClass, SOAPBinding.class);
            if(sbPortClass != null){
                if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){
                    logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), seiClass.getName()));
                }
            }
        }
        if (serviceName == null)
            serviceName = getServiceName(portClass, metadataReader);
        model.setServiceQName(serviceName);

//        String portLocalName  = portClass.getSimpleName()+PORT;
//        if (webService.portName().length() >0) {
//            portLocalName = webService.portName();
//        } else if (webService.name().length() >0) {
//            portLocalName = webService.name()+PORT;
//        }
//
//        if (portName == null)
//            portName = new QName(serviceName.getNamespaceURI(), portLocalName);
//        if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) {
//            throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch",
//                serviceName, portName);
//        }

        if (portName == null) portName = getPortName(portClass, metadataReader, serviceName.getNamespaceURI());
        model.setPortName(portName);

        // Check if databinding is overridden in annotation.
        com.oracle.webservices.internal.api.databinding.DatabindingMode dbm2 = getAnnotation(portClass, com.oracle.webservices.internal.api.databinding.DatabindingMode.class);
        if (dbm2 != null) model.databindingInfo.setDatabindingMode(dbm2.value());

        processClass(seiClass);
        if (model.getJavaMethods().size() == 0)
            throw new RuntimeModelerException("runtime.modeler.no.operations",
                    portClass.getName());
        model.postProcess();

        // Make the configured databinding mode available to the
        // DatabindingConfig.
        config.properties().put(BindingContext.class.getName(),
                model.bindingContext);

        // TODO: this needs to be fixed properly --
        // when we are building RuntimeModel first before building WSDLModel,
        // we still need to do this correctly
        if(binding!=null)
            model.freeze(binding);
        return model;
    }
 
Example #29
Source File: AbstractSEIModelImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void /*JAXBRIContext*/ createJAXBContext() {
        final List<TypeInfo> types = getAllTypeInfos();
        final List<Class> cls = new ArrayList<Class>(types.size() + additionalClasses.size());

        cls.addAll(additionalClasses);
        for (TypeInfo type : types) {
            cls.add((Class) type.type);
        }

        try {
            //jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false);
            // Need to avoid doPriv block once JAXB is fixed. Afterwards, use the above
            bindingContext = AccessController.doPrivileged(new PrivilegedExceptionAction<BindingContext>() {
                public BindingContext run() throws Exception {
                    if(LOGGER.isLoggable(Level.FINEST)) {
                        LOGGER.log(Level.FINEST, "Creating JAXBContext with classes={0} and types={1}", new Object[]{cls, types});
                    }
                    UsesJAXBContextFeature f = features.get(UsesJAXBContextFeature.class);
                    com.oracle.webservices.internal.api.databinding.DatabindingModeFeature dmf =
                            features.get(com.oracle.webservices.internal.api.databinding.DatabindingModeFeature.class);
                    JAXBContextFactory factory = f!=null ? f.getFactory() : null;
                    if(factory==null)   factory=JAXBContextFactory.DEFAULT;

//                    return factory.createJAXBContext(AbstractSEIModelImpl.this,cls,types);

                    databindingInfo.properties().put(JAXBContextFactory.class.getName(), factory);
                    if (dmf != null) {
                        if (LOGGER.isLoggable(Level.FINE))
                            LOGGER.log(Level.FINE, "DatabindingModeFeature in SEI specifies mode: {0}", dmf.getMode());
                        databindingInfo.setDatabindingMode(dmf
                                .getMode());
                    }

                        if (f!=null) databindingInfo.setDatabindingMode(BindingContextFactory.DefaultDatabindingMode);
                        databindingInfo.setClassLoader(classLoader);
                        databindingInfo.contentClasses().addAll(cls);
                        databindingInfo.typeInfos().addAll(types);
                        databindingInfo.properties().put("c14nSupport", Boolean.FALSE);
                        databindingInfo.setDefaultNamespace(AbstractSEIModelImpl.this.getDefaultSchemaNamespace());
                        BindingContext bc =  BindingContextFactory.create(databindingInfo);
                            if (LOGGER.isLoggable(Level.FINE))
                                LOGGER.log(Level.FINE,
                                        "Created binding context: "
                                                + bc.getClass().getName());
//                      System.out.println("---------------------- databinding " + bc);
                        return bc;
                }
            });
//          createBridgeMap(types);
            createBondMap(types);
        } catch (PrivilegedActionException e) {
            throw new WebServiceException(ModelerMessages.UNABLE_TO_CREATE_JAXB_CONTEXT(), e);
        }
        knownNamespaceURIs = new ArrayList<String>();
        for (String namespace : bindingContext.getKnownNamespaceURIs()) {
            if (namespace.length() > 0) {
                if (!namespace.equals(SOAPNamespaceConstants.XSD) && !namespace.equals(SOAPNamespaceConstants.XMLNS))
                    knownNamespaceURIs.add(namespace);
            }
        }

        marshallers = new Pool.Marshaller(jaxbContext);

        //return getJAXBContext();
    }
 
Example #30
Source File: AbstractSEIModelImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void /*JAXBRIContext*/ createJAXBContext() {
        final List<TypeInfo> types = getAllTypeInfos();
        final List<Class> cls = new ArrayList<Class>(types.size() + additionalClasses.size());

        cls.addAll(additionalClasses);
        for (TypeInfo type : types) {
            cls.add((Class) type.type);
        }

        try {
            //jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false);
            // Need to avoid doPriv block once JAXB is fixed. Afterwards, use the above
            bindingContext = AccessController.doPrivileged(new PrivilegedExceptionAction<BindingContext>() {
                public BindingContext run() throws Exception {
                    if(LOGGER.isLoggable(Level.FINEST)) {
                        LOGGER.log(Level.FINEST, "Creating JAXBContext with classes={0} and types={1}", new Object[]{cls, types});
                    }
                    UsesJAXBContextFeature f = features.get(UsesJAXBContextFeature.class);
                    com.oracle.webservices.internal.api.databinding.DatabindingModeFeature dmf =
                            features.get(com.oracle.webservices.internal.api.databinding.DatabindingModeFeature.class);
                    JAXBContextFactory factory = f!=null ? f.getFactory() : null;
                    if(factory==null)   factory=JAXBContextFactory.DEFAULT;

//                    return factory.createJAXBContext(AbstractSEIModelImpl.this,cls,types);

                    databindingInfo.properties().put(JAXBContextFactory.class.getName(), factory);
                    if (dmf != null) {
                        if (LOGGER.isLoggable(Level.FINE))
                            LOGGER.log(Level.FINE, "DatabindingModeFeature in SEI specifies mode: {0}", dmf.getMode());
                        databindingInfo.setDatabindingMode(dmf
                                .getMode());
                    }

                        if (f!=null) databindingInfo.setDatabindingMode(BindingContextFactory.DefaultDatabindingMode);
                        databindingInfo.setClassLoader(classLoader);
                        databindingInfo.contentClasses().addAll(cls);
                        databindingInfo.typeInfos().addAll(types);
                        databindingInfo.properties().put("c14nSupport", Boolean.FALSE);
                        databindingInfo.setDefaultNamespace(AbstractSEIModelImpl.this.getDefaultSchemaNamespace());
                        BindingContext bc =  BindingContextFactory.create(databindingInfo);
                            if (LOGGER.isLoggable(Level.FINE))
                                LOGGER.log(Level.FINE,
                                        "Created binding context: "
                                                + bc.getClass().getName());
//                      System.out.println("---------------------- databinding " + bc);
                        return bc;
                }
            });
//          createBridgeMap(types);
            createBondMap(types);
        } catch (PrivilegedActionException e) {
            throw new WebServiceException(ModelerMessages.UNABLE_TO_CREATE_JAXB_CONTEXT(), e);
        }
        knownNamespaceURIs = new ArrayList<String>();
        for (String namespace : bindingContext.getKnownNamespaceURIs()) {
            if (namespace.length() > 0) {
                if (!namespace.equals(SOAPNamespaceConstants.XSD) && !namespace.equals(SOAPNamespaceConstants.XMLNS))
                    knownNamespaceURIs.add(namespace);
            }
        }

        marshallers = new Pool.Marshaller(jaxbContext);

        //return getJAXBContext();
    }