本文整理汇总了Java中javax.xml.ws.WebServiceProvider类的典型用法代码示例。如果您正苦于以下问题:Java WebServiceProvider类的具体用法?Java WebServiceProvider怎么用?Java WebServiceProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebServiceProvider类属于javax.xml.ws包,在下文中一共展示了WebServiceProvider类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: verifyImplementorClass
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
/**
* Verifies if the endpoint implementor class has @WebService or @WebServiceProvider
* annotation
*
* @return
* true if it is a Provider or AsyncProvider endpoint
* false otherwise
* @throws java.lang.IllegalArgumentException
* If it doesn't have any one of @WebService or @WebServiceProvider
* If it has both @WebService and @WebServiceProvider annotations
*/
public static boolean verifyImplementorClass(Class<?> clz) {
WebServiceProvider wsProvider = clz.getAnnotation(WebServiceProvider.class);
WebService ws = clz.getAnnotation(WebService.class);
if (wsProvider == null && ws == null) {
throw new IllegalArgumentException(clz +" has neither @WebService nor @WebServiceProvider annotation");
}
if (wsProvider != null && ws != null) {
throw new IllegalArgumentException(clz +" has both @WebService and @WebServiceProvider annotations");
}
if (wsProvider != null) {
if (Provider.class.isAssignableFrom(clz) || AsyncProvider.class.isAssignableFrom(clz)) {
return true;
}
throw new IllegalArgumentException(clz +" doesn't implement Provider or AsyncProvider interface");
}
return false;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:29,代码来源:EndpointFactory.java
示例2: getName
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
public static String getName(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
final String sei = webService.endpointInterface();
if (sei != null && sei.trim().length() != 0) {
try {
final Class seiClass = clazz.getClassLoader().loadClass(sei.trim());
return getNameFromInterface(seiClass);
} catch (final ClassNotFoundException e) {
throw new OpenEJBRuntimeException("Unable to load SEI class: " + sei, e);
}
}
return getName(clazz, webService.name());
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
return clazz.getName();
}
throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
开发者ID:apache,项目名称:tomee,代码行数:23,代码来源:JaxWsUtils.java
示例3: publishEndpoints
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
/**
* Publish all {@link javax.jws.WebService} annotated beans in the
* containing BeanFactory.
* @see #publishEndpoint
*/
public void publishEndpoints() {
Set<String> beanNames = new LinkedHashSet<String>(this.beanFactory.getBeanDefinitionCount());
beanNames.addAll(Arrays.asList(this.beanFactory.getBeanDefinitionNames()));
if (this.beanFactory instanceof ConfigurableBeanFactory) {
beanNames.addAll(Arrays.asList(((ConfigurableBeanFactory) this.beanFactory).getSingletonNames()));
}
for (String beanName : beanNames) {
try {
Class<?> type = this.beanFactory.getType(beanName);
if (type != null && !type.isInterface()) {
WebService wsAnnotation = type.getAnnotation(WebService.class);
WebServiceProvider wsProviderAnnotation = type.getAnnotation(WebServiceProvider.class);
if (wsAnnotation != null || wsProviderAnnotation != null) {
Endpoint endpoint = createEndpoint(this.beanFactory.getBean(beanName));
if (this.endpointProperties != null) {
endpoint.setProperties(this.endpointProperties);
}
if (this.executor != null) {
endpoint.setExecutor(this.executor);
}
if (wsAnnotation != null) {
publishEndpoint(endpoint, wsAnnotation);
}
else {
publishEndpoint(endpoint, wsProviderAnnotation);
}
this.publishedEndpoints.add(endpoint);
}
}
}
catch (CannotLoadBeanClassException ex) {
// ignore beans where the class is not resolvable
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:41,代码来源:AbstractJaxWsServiceExporter.java
示例4: process
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
if (context.getRound() != 1) {
return true;
}
context.incrementRound();
WebService webService;
WebServiceProvider webServiceProvider;
WebServiceVisitor webServiceVisitor = new WebServiceWrapperGenerator(this, context);
boolean processedEndpoint = false;
Collection<TypeElement> classes = new ArrayList<TypeElement>();
filterClasses(classes, roundEnv.getRootElements());
for (TypeElement element : classes) {
webServiceProvider = element.getAnnotation(WebServiceProvider.class);
webService = element.getAnnotation(WebService.class);
if (webServiceProvider != null) {
if (webService != null) {
processError(WebserviceapMessages.WEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(element.getQualifiedName()));
}
processedEndpoint = true;
}
if (webService == null) {
continue;
}
element.accept(webServiceVisitor, null);
processedEndpoint = true;
}
if (!processedEndpoint) {
if (isCommandLineInvocation) {
if (!ignoreNoWebServiceFoundWarning) {
processWarning(WebserviceapMessages.WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
}
} else {
processError(WebserviceapMessages.WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
}
}
return true;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:WebServiceAp.java
示例5: attachWebServiceProviderAnnotation
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
/**
* This method will be used to attach @WebServiceProvider annotation data to the
* <code>DescriptionBuilderComposite</code>
*
* @param composite - <code>DescriptionBuildercomposite</code>
*/
private void attachWebServiceProviderAnnotation(DescriptionBuilderComposite composite) {
WebServiceProvider webServiceProvider = (WebServiceProvider)ConverterUtils.
getAnnotation(WebServiceProvider.class, serviceClass);
if (webServiceProvider != null) {
// Attach @WebServiceProvider annotation data
WebServiceProviderAnnot wspAnnot = WebServiceProviderAnnot.
createWebServiceAnnotImpl();
wspAnnot.setPortName(webServiceProvider.portName());
wspAnnot.setServiceName(webServiceProvider.serviceName());
wspAnnot.setTargetNamespace(webServiceProvider.targetNamespace());
wspAnnot.setWsdlLocation(webServiceProvider.wsdlLocation());
composite.setWebServiceProviderAnnot(wspAnnot);
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:JavaClassToDBCConverter.java
示例6: buildModel
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
private void buildModel() {
WebService webService;
WebServiceProvider webServiceProvider;
WebServiceVisitor wrapperGenerator = createWrapperGenerator();
boolean processedEndpoint = false;
for (TypeDeclaration typedecl: apEnv.getTypeDeclarations()) {
if (!(typedecl instanceof ClassDeclaration))
continue;
webServiceProvider = typedecl.getAnnotation(WebServiceProvider.class);
webService = typedecl.getAnnotation(WebService.class);
if (webServiceProvider != null) {
if (webService != null) {
onError(WebserviceapMessages.WEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(typedecl.getQualifiedName()));
}
processedEndpoint = true;
}
if (!shouldProcessWebService(webService))
continue;
typedecl.accept(wrapperGenerator);
processedEndpoint = true;
}
if (!processedEndpoint) {
if (isAPTInvocation)
onWarning(WebserviceapMessages.WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
else
onError(WebserviceapMessages.WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:29,代码来源:WebServiceAP.java
示例7: getServiceQName
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
public static QName getServiceQName(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
return getServiceQName(clazz, webService.targetNamespace(), webService.serviceName());
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
return getServiceQName(clazz, webServiceProvider.targetNamespace(), webServiceProvider.serviceName());
}
final WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class);
if (webServiceClient != null) {
return getServiceQName(clazz, webServiceClient.targetNamespace(), webServiceClient.name());
}
throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
开发者ID:apache,项目名称:tomee,代码行数:16,代码来源:JaxWsUtils.java
示例8: getPortQName
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
public static QName getPortQName(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
return getPortQName(clazz, webServiceProvider.targetNamespace(), null, webServiceProvider.portName());
}
throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
开发者ID:apache,项目名称:tomee,代码行数:14,代码来源:JaxWsUtils.java
示例9: publishEndpoint
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
@Override
protected void publishEndpoint(Endpoint endpoint, WebServiceProvider annotation) {
endpoint.publish(buildHttpContext(endpoint, annotation.serviceName()));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SimpleHttpServerJaxWsServiceExporter.java
示例10: publishEndpoint
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
@Override
protected void publishEndpoint(Endpoint endpoint, WebServiceProvider annotation) {
endpoint.publish(calculateEndpointAddress(endpoint, annotation.serviceName()));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SimpleJaxWsServiceExporter.java
示例11: isUseProviderTube
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
protected boolean isUseProviderTube(Class<?> implType, boolean isStandard) {
return !isStandard || implType.getAnnotation(WebServiceProvider.class)!=null;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:EndpointFactory.java
示例12: hasWebServiceAnnotation
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
public static boolean hasWebServiceAnnotation(Class<?> cls) {
return hasAnnotation(cls, WebService.class) || hasAnnotation(cls, WebServiceProvider.class);
}
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:CxfEndpointUtils.java
示例13: createDDEndpoint
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
protected DDEndpoint createDDEndpoint(Class<?> sepClass, ArchiveDeployment dep, Endpoint ep)
{
WebService anWebService = sepClass.getAnnotation(WebService.class);
WebServiceProvider anWebServiceProvider = sepClass.getAnnotation(WebServiceProvider.class);
Class<?> seiClass = null;
String seiName;
String name = (anWebService != null) ? anWebService.name() : "";
if (name.length() == 0)
name = JavaUtils.getJustClassName(sepClass);
String serviceName = (anWebService != null) ? anWebService.serviceName() : anWebServiceProvider.serviceName();
if (serviceName.length() == 0) {
serviceName = JavaUtils.getJustClassName(sepClass) + "Service";
}
String serviceNS = (anWebService != null) ? anWebService.targetNamespace() : anWebServiceProvider.targetNamespace();
if (serviceNS.length() == 0)
serviceNS = getTypeNamespace(JavaUtils.getPackageName(sepClass));
String portName = (anWebService != null) ? anWebService.portName() : anWebServiceProvider.portName();
if (portName.length() == 0) {
portName = name + "Port";
}
String annWsdlLocation;
if (anWebService != null && anWebService.endpointInterface().length() > 0)
{
seiName = anWebService.endpointInterface();
ClassLoader runtimeClassLoader = dep.getClassLoader();
if(null == runtimeClassLoader)
throw MESSAGES.runtimeLoaderCannotBeNull(dep);
try
{
seiClass = runtimeClassLoader.loadClass(seiName);
}
catch (ClassNotFoundException cnfe)
{
throw new RuntimeException(cnfe);
}
WebService seiAnnotation = seiClass.getAnnotation(WebService.class);
if (seiAnnotation == null)
throw MESSAGES.webserviceAnnotationNotFound(seiName);
if (seiAnnotation.portName().length() > 0 || seiAnnotation.serviceName().length() > 0 || seiAnnotation.endpointInterface().length() > 0)
throw MESSAGES.webserviceAnnotationSEIAttributes(seiName);
annWsdlLocation = !"".equals(anWebService.wsdlLocation()) ? anWebService.wsdlLocation() : seiAnnotation.wsdlLocation();
}
else
{
annWsdlLocation = (anWebService != null) ? anWebService.wsdlLocation() : anWebServiceProvider.wsdlLocation();
}
DDEndpoint result = new DDEndpoint();
result.setId(ep.getShortName());
result.setAddress(SysPropUtils.expandSystemProperty(ep.getAddress()));
result.setImplementor(ep.getTargetBeanName());
result.setMtomEnabled(isMtomEnabled(ep.getTargetBeanClass()));
result.setEpClass(seiClass != null ? seiClass : sepClass);
result.setPortName(new QName(serviceNS, portName));
result.setServiceName(new QName(serviceNS, serviceName));
if (annWsdlLocation.length() > 0) {
result.setAnnotationWsdlLocation(annWsdlLocation);
}
return result;
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:72,代码来源:MetadataBuilder.java
示例14: isJAXWSClass
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
/**
* @param cls
* @return true if this is a JAX-WS or JAX-WS generated class
*/
public static final boolean isJAXWSClass(Class cls) {
// TODO Processing all of these annotations is very expensive. We need to cache the
// result in a static WeakHashMap<Class, Boolean>
// Kinds of generated classes: Service, Provider, Impl, Exception, Holder
// Or the class is in the jaxws.xml.ws package
// Check for Impl
WebService wsAnn = (WebService)getAnnotation(cls,WebService.class);
if (wsAnn != null) {
return true;
}
// Check for service
WebServiceClient wscAnn = (WebServiceClient)getAnnotation(cls,WebServiceClient.class);
if (wscAnn != null) {
return true;
}
// Check for provider
WebServiceProvider wspAnn = (WebServiceProvider)
getAnnotation(cls,WebServiceProvider.class);
if (wspAnn != null) {
return true;
}
// Check for Exception
WebFault wfAnn = (WebFault)getAnnotation(cls,WebFault.class);
if (wfAnn != null) {
return true;
}
// Check for Holder
if (Holder.class.isAssignableFrom(cls)) {
return true;
}
// Check for a javax.xml.ws.Service class instance
if (Service.class.isAssignableFrom(cls)) {
return true;
}
String className = cls.getPackage() == null ? null : cls.getPackage().getName();
if (className != null && className.startsWith("javax.xml.ws") && !className.startsWith("javax.xml.ws.wsaddressing")) {
return true;
}
return false;
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:54,代码来源:ClassUtils.java
示例15: getAnnoWebServiceProvider
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
public WebServiceProvider getAnnoWebServiceProvider() {
return webServiceProviderAnnotation;
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:4,代码来源:EndpointDescriptionImpl.java
示例16: isWebService
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
boolean isWebService(Object bean) {
Class<?> beanClass = bean.getClass();
return beanClass.getAnnotation(WebService.class) != null
|| beanClass.getAnnotation(WebServiceProvider.class) != null;
}
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:6,代码来源:JaxWsBeanPostProcessor.java
示例17: isWebService
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
public static boolean isWebService(final Class clazz) {
return (clazz.isAnnotationPresent(WebService.class) || clazz.isAnnotationPresent(WebServiceProvider.class)) && isProperWebService(clazz);
}
开发者ID:apache,项目名称:tomee,代码行数:4,代码来源:JaxWsUtils.java
示例18: publishEndpoint
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
/**
* Actually publish the given provider endpoint. To be implemented by subclasses.
* @param endpoint the JAX-WS Provider Endpoint object
* @param annotation the service bean's WebServiceProvider annotation
*/
protected abstract void publishEndpoint(Endpoint endpoint, WebServiceProvider annotation);
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:AbstractJaxWsServiceExporter.java
示例19: getAnnoWebServiceProvider
import javax.xml.ws.WebServiceProvider; //导入依赖的package包/类
public WebServiceProvider getAnnoWebServiceProvider();
开发者ID:wso2,项目名称:wso2-axis2,代码行数:2,代码来源:EndpointDescriptionJava.java
注:本文中的javax.xml.ws.WebServiceProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论