本文整理汇总了Java中com.sun.xml.internal.ws.resources.ModelerMessages类的典型用法代码示例。如果您正苦于以下问题:Java ModelerMessages类的具体用法?Java ModelerMessages怎么用?Java ModelerMessages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelerMessages类属于com.sun.xml.internal.ws.resources包,在下文中一共展示了ModelerMessages类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parseAnnotations
import com.sun.xml.internal.ws.resources.ModelerMessages; //导入依赖的package包/类
/**
*
* @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);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:WebServiceFeatureList.java
示例2: parseAnnotations
import com.sun.xml.internal.ws.resources.ModelerMessages; //导入依赖的package包/类
/**
* Reads {@link WebServiceFeatureAnnotation feature annotations} on a class
* and adds them to the list.
*
* @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);
}
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:24,代码来源:WebServiceFeatureList.java
示例3: mergeFeatures
import com.sun.xml.internal.ws.resources.ModelerMessages; //导入依赖的package包/类
/**
* 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));
}
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:WebServiceFeatureList.java
示例4: mergeFeatures
import com.sun.xml.internal.ws.resources.ModelerMessages; //导入依赖的package包/类
/**
* Merges the extra features that are not already set on binding.
* i.e, if a feature is set already on binding through someother API
* the coresponding 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) colflicts 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));
}
}
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:23,代码来源:WebServiceFeatureList.java
示例5: createJAXBContext
import com.sun.xml.internal.ws.resources.ModelerMessages; //导入依赖的package包/类
private JAXBRIContext createJAXBContext() {
final List<TypeReference> types = getAllTypeReferences();
final List<Class> cls = new ArrayList<Class>(types.size() + additionalClasses.size());
cls.addAll(additionalClasses);
for (TypeReference 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
jaxbContext = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBRIContext>() {
public JAXBRIContext run() throws Exception {
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,"Creating JAXBContext with classes="+cls+" and types="+types);
}
UsesJAXBContextFeature f = WebServiceFeatureList.getFeature(features, UsesJAXBContextFeature.class);
JAXBContextFactory factory = f!=null ? f.getFactory() : null;
if(factory==null) factory=JAXBContextFactory.DEFAULT;
return factory.createJAXBContext(AbstractSEIModelImpl.this,cls,types);
}
});
createBridgeMap(types);
} catch (PrivilegedActionException e) {
throw new WebServiceException(ModelerMessages.UNABLE_TO_CREATE_JAXB_CONTEXT(), e);
}
knownNamespaceURIs = new ArrayList<String>();
for (String namespace : jaxbContext.getKnownNamespaceURIs()) {
if (namespace.length() > 0) {
if (!namespace.equals(SOAPNamespaceConstants.XSD) && !namespace.equals(SOAPNamespaceConstants.XMLNS))
knownNamespaceURIs.add(namespace);
}
}
marshallers = new Pool.Marshaller(jaxbContext);
return jaxbContext;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:39,代码来源:AbstractSEIModelImpl.java
示例6: createJAXBContext
import com.sun.xml.internal.ws.resources.ModelerMessages; //导入依赖的package包/类
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();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:66,代码来源:AbstractSEIModelImpl.java
示例7: buildRuntimeModel
import com.sun.xml.internal.ws.resources.ModelerMessages; //导入依赖的package包/类
/**
* 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);
Class clazz = portClass;
WebService webService = getPrivClassAnnotation(portClass, WebService.class);
if (webService == null) {
throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
portClass.getCanonicalName());
}
if (webService.endpointInterface().length() > 0) {
clazz = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface()));
WebService seiService = getPrivClassAnnotation(clazz, 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 = getPrivClassAnnotation(portClass, SOAPBinding.class);
SOAPBinding sbSei = getPrivClassAnnotation(clazz, 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(), clazz.getName()));
}
}
}
if (serviceName == null)
serviceName = getServiceName(portClass);
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);
}
model.setPortName(portName);
processClass(clazz);
if (model.getJavaMethods().size() == 0)
throw new RuntimeModelerException("runtime.modeler.no.operations",
portClass.getName());
model.postProcess();
// TODO: this needs to be fixed properly --
// when we are building RuntimeModel first before building WSDLModel,
// we still need to do this correctyl
if(binding!=null)
model.freeze(binding);
return model;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:63,代码来源:RuntimeModeler.java
注:本文中的com.sun.xml.internal.ws.resources.ModelerMessages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论