當前位置: 首頁>>代碼示例>>Java>>正文


Java WebService.endpointInterface方法代碼示例

本文整理匯總了Java中javax.jws.WebService.endpointInterface方法的典型用法代碼示例。如果您正苦於以下問題:Java WebService.endpointInterface方法的具體用法?Java WebService.endpointInterface怎麽用?Java WebService.endpointInterface使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.jws.WebService的用法示例。


在下文中一共展示了WebService.endpointInterface方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: attachWebServiceAnnotation

import javax.jws.WebService; //導入方法依賴的package包/類
/**
 * This method will be used to attach @WebService annotation data to the
 * <code>DescriptionBuildercomposite</code>
 *
 * @param composite - <code>DescriptionBuilderComposite</code>
 */
private void attachWebServiceAnnotation(DescriptionBuilderComposite composite) {
    WebService webService = (WebService)ConverterUtils.getAnnotation(
            WebService.class, serviceClass);
    if (webService != null) {
        // Attach @WebService annotated data
        WebServiceAnnot wsAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
        wsAnnot.setEndpointInterface(webService.endpointInterface());
        // check for SEI and save name if necessary
        seiClassName = webService.endpointInterface();
        wsAnnot.setName(webService.name());
        wsAnnot.setPortName(webService.portName());
        wsAnnot.setServiceName(webService.serviceName());
        wsAnnot.setTargetNamespace(webService.targetNamespace());
        wsAnnot.setWsdlLocation(webService.wsdlLocation());
        composite.setWebServiceAnnot(wsAnnot);
    }
}
 
開發者ID:wso2,項目名稱:wso2-axis2,代碼行數:24,代碼來源:JavaClassToDBCConverter.java

示例2: getName

import javax.jws.WebService; //導入方法依賴的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: getSEI

import javax.jws.WebService; //導入方法依賴的package包/類
static Class getSEI(Class<?> clazz) {
    if (Provider.class.isAssignableFrom(clazz) || AsyncProvider.class.isAssignableFrom(clazz)) {
        //No SEI for Provider Implementation
        return null;
    }
    if (Service.class.isAssignableFrom(clazz)) {
        //No SEI for Service class
        return null;
    }
    if (!clazz.isAnnotationPresent(WebService.class)) {
        throw new UtilException("util.handler.no.webservice.annotation",
            clazz.getCanonicalName());
    }

    WebService webService = clazz.getAnnotation(WebService.class);

    String ei = webService.endpointInterface();
    if (ei.length() > 0) {
        clazz = getClass(webService.endpointInterface());
        if (!clazz.isAnnotationPresent(WebService.class)) {
            throw new UtilException("util.handler.endpoint.interface.no.webservice",
                webService.endpointInterface());
        }
        return clazz;
    }
    return null;
}
 
開發者ID:alexkasko,項目名稱:openjdk-icedtea7,代碼行數:28,代碼來源:HandlerAnnotationProcessor.java

示例4: getServiceInterface

import javax.jws.WebService; //導入方法依賴的package包/類
public static String getServiceInterface(final Class<?> clazz) {
    WebService webService = clazz.getAnnotation(WebService.class);
    String endpointInterface = null;
    if (webService != null && webService.endpointInterface() != null) {
        endpointInterface = webService.endpointInterface().trim();
        if (endpointInterface.length() == 0) {
            endpointInterface = null;

        } else {
            return endpointInterface;
        }
    }

    // if the bean implements only one WebService class, that is the SEI
    for (final Class<?> intf : clazz.getInterfaces()) {
        // interface MUST also have a @WebService
        webService = intf.getAnnotation(WebService.class);
        if (webService != null) {
            if (endpointInterface == null) {
                endpointInterface = intf.getName();
            } else {
                // multiple endpoint interfaces
                endpointInterface = null;
                break;
            }
        }
    }

    return endpointInterface;
}
 
開發者ID:apache,項目名稱:tomee,代碼行數:31,代碼來源:JaxWsUtils.java

示例5: createDDEndpoint

import javax.jws.WebService; //導入方法依賴的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

示例6: getPackagesFromAnnotations

import javax.jws.WebService; //導入方法依賴的package包/類
/**
 * @param endpointInterfaceDescription EndpointInterfaceDescription
 * @param Set of Packages
 * @param msrd
 */
private static void getPackagesFromAnnotations(
        EndpointDescription ed,
        EndpointInterfaceDescription endpointInterfaceDesc,
        TreeSet<String> set,
        MarshalServiceRuntimeDescription msrd) {
    
	if (log.isDebugEnabled()) {
		log.debug("start getPackagesFromAnnotations for EndpointInterfaceDescription " + 
					endpointInterfaceDesc.getPortType());
	}
    OperationDescription[] opDescs = endpointInterfaceDesc.getDispatchableOperations();

    // Inspect the @XmlSeeAlso classes on the interface.
    // A) The SEI class is accessible via the getSEIClass method -OR-
    // B) The endpoint directly implements the sei class
    //    (The @XmlSeeAlso annotations were picked up when the endpoint is examined) -OR-
    // C) Find the SEI class using the @WebService annotation
    Class seicls = endpointInterfaceDesc.getSEIClass();
    if (log.isDebugEnabled()) {
    	log.debug("SEI Class is " + seicls);
    }
    if (seicls == null) {
    	String implClassName = getServiceImplClassName(ed);
        if (implClassName != null) {
        	if (log.isDebugEnabled()) {
        		log.debug("EndpointDescription implClassName = " + implClassName);
        	}
            Class clz = loadClass(implClassName);
            if(clz == null){
                clz = loadClass(implClassName, ed.getAxisService().getClassLoader());
            }
            if (clz != null) {
            	WebService ws = (WebService) getAnnotation(clz, WebService.class);
            	if (ws != null) {
            		String intClassName = ws.endpointInterface();
            		if (log.isDebugEnabled()) {
                		log.debug("WebService endpointinterface = " + intClassName);
                	}
                    seicls = loadClass(intClassName);
                    if (seicls== null){
                        seicls = loadClass(intClassName, ed.getAxisService().getClassLoader());
                    }
            	}
            }
        }
    }
    addXmlSeeAlsoPackages(seicls, msrd, set);
    
    
    // Build a set of packages from all of the operations
    if (opDescs != null) {
        for (int i = 0; i < opDescs.length; i++) {
            getPackagesFromAnnotations(ed, opDescs[i], set, msrd);
        }
    }
    if (log.isDebugEnabled()) {
		log.debug("end getPackagesFromAnnotations for EndpointInterfaceDescription " + 
					endpointInterfaceDesc.getPortType());
	}
    return;
}
 
開發者ID:wso2,項目名稱:wso2-axis2,代碼行數:67,代碼來源:PackageSetBuilder.java

示例7: buildRuntimeModel

import javax.jws.WebService; //導入方法依賴的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


注:本文中的javax.jws.WebService.endpointInterface方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。