Package org.jboss.ws.metadata.umdm

Examples of org.jboss.ws.metadata.umdm.ServerEndpointMetaData


   private ServerEndpointMetaData getEndpointMetaData(UnifiedMetaData umd, Endpoint ep)
   {
      String epName = ep.getShortName();

      ServerEndpointMetaData epMetaData = null;
      for (ServiceMetaData serviceMetaData : umd.getServices())
      {
         for (EndpointMetaData aux : serviceMetaData.getEndpoints())
         {
            String linkName = ((ServerEndpointMetaData)aux).getLinkName();
View Full Code Here


      // Setup the ServerEndpointMetaData
      QName portQName = new QName(targetNS, portName);
      QName portTypeQName = new QName(targetNS, name);
     
      Endpoint ep = dep.getService().getEndpointByName(linkName);
      ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, ep, portQName, portTypeQName, Type.JAXWS);
      sepMetaData.setLinkName(linkName);

      sepMetaData.setStyle(Style.DOCUMENT);
      sepMetaData.setParameterStyle(ParameterStyle.BARE);

      sepMetaData.setServiceEndpointImplName(sepClass.getName());
      sepMetaData.setServiceEndpointInterfaceName(sepClass.getName());

      ServiceMode anServiceMode = sepClass.getAnnotation(ServiceMode.class);
      sepMetaData.setServiceMode(anServiceMode != null ? anServiceMode.value() : Mode.PAYLOAD);

      serviceMetaData.addEndpoint(sepMetaData);

      // Process invoke method
      processInvokeMethod(sepMetaData);

      // Process WSDL
      String wsdlLocation = anWebServiceProvider.wsdlLocation();
      if (wsdlLocation.length() > 0)
      {
         URL wsdlURL = dep.getMetaDataFileURL(wsdlLocation);
         serviceMetaData.setWsdlLocation(wsdlURL);
      }

      // process binding type
      processBindingType(sepMetaData, sepClass);

      // process handler chain
      processHandlerChain(sepMetaData, sepClass);

      // process config
      processEndpointConfig(dep, sepMetaData, sepClass, linkName);

      // Set the endpoint address
      processWebContext(dep, sepClass, linkName, sepMetaData);

      // Init the endpoint address
      initEndpointAddress(dep, sepMetaData);

      // A provider may not have a WSDL file
      if (sepMetaData.getServiceMetaData().getWsdlLocation() != null)
         MetaDataBuilder.replaceAddressLocation(sepMetaData);

      // init service endpoint id
      ObjectName sepID = MetaDataBuilder.createServiceEndpointID(dep, sepMetaData);
      sepMetaData.setServiceEndpointID(sepID);

      return sepMetaData;
   }
View Full Code Here

         if(null == runtimeClassLoader)
            throw new IllegalArgumentException("Runtime loader cannot be null");
        
         resetMetaDataBuilder(runtimeClassLoader);

         ServerEndpointMetaData sepMetaData = result.sepMetaData;
         ServiceMetaData serviceMetaData = result.serviceMetaData;
         serviceMetaData.setWsdlLocation(result.wsdlLocation);
         Class<?> seiClass = result.epClass;

         sepMetaData.setLinkName(linkName);
         sepMetaData.setServiceEndpointImplName(sepClass.getName());
         sepMetaData.setServiceEndpointInterfaceName(seiClass.getName());

         // Assign the WS-Security configuration,
         WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
         WSSecurityConfiguration securityConfiguration = wsseConfFactory.createConfiguration(wsMetaData.getRootFile(), WSSecurityOMFactory.SERVER_RESOURCE_NAME);
         serviceMetaData.setSecurityConfiguration(securityConfiguration);

         // Process an optional @SOAPBinding annotation
         processSOAPBinding(sepMetaData, seiClass);

         // Process an optional @BindingType annotation
         processBindingType(sepMetaData, sepClass);

         // process config
         processEndpointConfig(dep, sepMetaData, sepClass, linkName);

         // process web service features
         EndpointFeatureProcessor epFeatureProcessor = new EndpointFeatureProcessor();
         epFeatureProcessor.processEndpointFeatures(dep, sepMetaData, sepClass);

         // Process endpoint documentation
         if (seiClass.isAnnotationPresent(Documentation.class))
            sepMetaData.setDocumentation(seiClass.getAnnotation(Documentation.class).content());
        
         // Process web methods
         processWebMethods(sepMetaData, seiClass);

         // Init the transport guarantee
         initTransportGuaranteeJSE(dep, sepMetaData, linkName);

         // Initialize types
         createJAXBContext(sepMetaData);
         populateXmlTypes(sepMetaData);

         //Process an optional @PolicyAttachment annotation
         if (sepClass.isAnnotationPresent(PolicyAttachment.class))
         {
            PolicyMetaDataBuilder policyBuilder = PolicyMetaDataBuilder.getServerSidePolicyMetaDataBuilder(toolMode);
            policyBuilder.processPolicyAnnotations(sepMetaData, sepClass);
         }

         // The server must always generate WSDL
         if (generateWsdl || !toolMode)
            processOrGenerateWSDL(seiClass, serviceMetaData, result.wsdlLocation, sepMetaData);

         // No need to process endpoint items if we are in tool mode
         if (toolMode)
            return sepMetaData;

         // Sanity check: read the generated WSDL and initialize the schema model
         // Note, this should no longer be needed, look into removing it
         WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
         JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
         serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);

         // Note, that @WebContext needs to be defined on the endpoint not the SEI
         processWebContext(dep, sepClass, linkName, sepMetaData);

         // setup handler chain from config
         sepMetaData.initEndpointConfig();

         // Process an optional @HandlerChain annotation
         if (sepClass.isAnnotationPresent(HandlerChain.class))
            processHandlerChain(sepMetaData, sepClass);
         else if (seiClass.isAnnotationPresent(HandlerChain.class))
            processHandlerChain(sepMetaData, seiClass);
        
         //setup web service feature contributions
         epFeatureProcessor.setupEndpointFeatures(sepMetaData);

         // process webservices.xml contributions
         processWSDDContribution(sepMetaData);

         // Init the endpoint address
         initEndpointAddress(dep, sepMetaData);

         // Process an optional @SOAPMessageHandlers annotation
         if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) || seiClass.isAnnotationPresent(SOAPMessageHandlers.class))
            log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no replacement.");

         MetaDataBuilder.replaceAddressLocation(sepMetaData);
         processEndpointMetaDataExtensions(sepMetaData, wsdlDefinitions);

         // init service endpoint id
         ObjectName sepID = MetaDataBuilder.createServiceEndpointID(dep, sepMetaData);
         sepMetaData.setServiceEndpointID(sepID);

         return sepMetaData;
      }
      catch (RuntimeException rte)
      {
View Full Code Here

      QName portQName = new QName(serviceNS, portName);
      QName portTypeQName = new QName(interfaceNS, name);

      EndpointResult result = new EndpointResult();
      result.serviceMetaData = new ServiceMetaData(wsMetaData, new QName(serviceNS, serviceName));
      result.sepMetaData = new ServerEndpointMetaData(result.serviceMetaData, ep, portQName, portTypeQName, EndpointMetaData.Type.JAXWS);
      result.epClass = (seiClass != null ? seiClass : sepClass);
      result.serviceMetaData.addEndpoint(result.sepMetaData);
      wsMetaData.addService(result.serviceMetaData);

      if (dep instanceof ArchiveDeployment)
View Full Code Here

   @Override
   public final void start(Deployment dep)
   {
      for (Endpoint ep : dep.getService().getEndpoints())
      {
         ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
         if (sepMetaData == null)
            throw new IllegalStateException("Cannot obtain endpoint meta data");
        
         if (sepMetaData.getConfig().getRMMetaData() != null)
         {
            InvocationHandler origInvHandler = ep.getInvocationHandler();
            InvocationHandler wsrmInvHandler = new RMInvocationHandler(origInvHandler, (ArchiveDeployment)dep);
            ep.setInvocationHandler(wsrmInvHandler);
            RMHelper.setupRMOperations(sepMetaData);
View Full Code Here

      ServletContext ctx = getServletContext();
      String configName = ctx.getInitParameter("jbossws-config-name");
      String configFile = ctx.getInitParameter("jbossws-config-file");
      if (configName != null || configFile != null)
      {
         ServerEndpointMetaData epMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
         if (epMetaData == null)
            throw new IllegalStateException("Cannot obtain endpoint meta data");

         log.debug("Updating service endpoint config\n  config-name: " + configName + "\n  config-file: " + configFile);
         epMetaData.setConfigName(configName, configFile);
      }
   }
View Full Code Here

   public void handleRequest(Endpoint endpoint, InputStream inStream, OutputStream outStream, InvocationContext invContext)
   {
      log.debug("handleRequest: " + endpoint.getName());

      ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
      if (sepMetaData == null)
         throw new IllegalStateException("Cannot obtain endpoint meta data");

      Type type = sepMetaData.getType();
     
      // Build the message context
      CommonMessageContext msgContext;
      if (type == EndpointMetaData.Type.JAXRPC)
      {
View Full Code Here

   private MessageAbstraction processRequest(Endpoint ep, MimeHeaderSource headerSource, InvocationContext reqContext, InputStream inputStream)
         throws BindingException
   {
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();

      ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
      if (sepMetaData == null)
         throw new IllegalStateException("Cannot obtain endpoint meta data");

      long beginProcessing = 0;
      ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
      try
      {
         EndpointState state = ep.getState();
         if (state != EndpointState.STARTED)
         {
            QName faultCode = Constants.SOAP11_FAULT_CODE_SERVER;
            String faultString = "Endpoint cannot handle requests in state: " + state;
            throw new CommonSOAPFaultException(faultCode, faultString);
         }

         log.debug("BEGIN handleRequest: " + ep.getName());
         beginProcessing = initRequestMetrics(ep);

         MimeHeaders headers = (headerSource != null ? headerSource.getMimeHeaders() : null);

         MessageAbstraction reqMessage;

         String bindingID = sepMetaData.getBindingId();
         if (HTTPBinding.HTTP_BINDING.equals(bindingID))
         {
            reqMessage = new HTTPMessageImpl(headers, inputStream);
         }
         else if (sepMetaData.isFeatureEnabled(JsonEncodingFeature.class))
         {
            MessageFactoryImpl factory = new MessageFactoryImpl();
            SOAPMessageImpl soapMsg = (SOAPMessageImpl)factory.createMessage();
            Document doc = new BadgerFishDOMDocumentParser().parse(inputStream);
            soapMsg.getSOAPBody().addDocument(doc);
            reqMessage = soapMsg;
         }
         else
         {
            msgFactory.setServiceMode(sepMetaData.getServiceMode());
            msgFactory.setStyle(sepMetaData.getStyle());
            msgFactory.setFeatures(sepMetaData.getFeatures());

            reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers, inputStream);
         }

         // Associate current message with message context
         msgContext.setMessageAbstraction(reqMessage);

         // debug the incomming message
         MessageTrace.traceMessage("Incoming Request Message", reqMessage);

         // Set the thread context class loader
         ClassLoader classLoader = sepMetaData.getClassLoader();
         Thread.currentThread().setContextClassLoader(classLoader);

         // Get the Invoker
         ServiceEndpointInvoker epInvoker = ep.getAttachment(ServiceEndpointInvoker.class);
         if (epInvoker == null)
View Full Code Here

   /** Initialize the service endpoint */
   public void init(Endpoint endpoint)
   {
      this.endpoint = endpoint;

      ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
      if (sepMetaData == null)
         throw new IllegalStateException("Cannot obtain endpoint meta data");

      if (sepMetaData.getType() == EndpointMetaData.Type.JAXRPC)
      {
         bindingProvider = new CommonBindingProvider(sepMetaData);
         delegate = new HandlerDelegateJAXRPC(sepMetaData);
      }
      else
View Full Code Here

   /** Invoke the the service endpoint */
   public void invoke(InvocationContext invContext) throws Exception
   {
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)msgContext.getEndpointMetaData();
      MessageAbstraction reqMessage = msgContext.getMessageAbstraction();

      // The direction of the message
      DirectionHolder direction = new DirectionHolder(Direction.InBound);

View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.umdm.ServerEndpointMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.