Package org.jboss.ws.metadata.umdm

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


    }

    @Override
    public String getWsdlLocation(final Endpoint endpoint, final String endpointName)
    {
        final ServerEndpointMetaData serverEndpointMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
        if (serverEndpointMetaData != null)
        {
            return serverEndpointMetaData.getServiceMetaData().getWsdlLocation().toExternalForm() ;
        }
        else
        {
            return null ;
        }
View Full Code Here


               // set service name
               serviceMetaData.setServiceName(wsdlEndpoint.getWsdlService().getName());
               QName interfaceQName = wsdlEndpoint.getInterface().getName();

               Endpoint ep = dep.getService().getEndpointByName(linkName);
               ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, ep, portName, interfaceQName, Type.JAXRPC);
               sepMetaData.setPortComponentName(pcMetaData.getPortComponentName());
               sepMetaData.setLinkName(linkName);
               serviceMetaData.addEndpoint(sepMetaData);

               initEndpointEncodingStyle(sepMetaData);

               initEndpointAddress(dep, sepMetaData);
               initEndpointBinding(wsdlEndpoint, sepMetaData);

               EJBArchiveMetaData apMetaData = dep.getAttachment(EJBArchiveMetaData.class);
               JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
               if (apMetaData != null)
               {
                  wsMetaData.setSecurityDomain(apMetaData.getSecurityDomain());

                  // Copy the wsdl publish location from jboss.xml
                  String wsdName = serviceMetaData.getWebserviceDescriptionName();
                  String wsdlPublishLocation = apMetaData.getWsdlPublishLocationByName(wsdName);
                  serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);

                  // Copy <port-component> meta data
                  EJBMetaData bmd = apMetaData.getBeanByEjbName(linkName);
                  if (bmd == null)
                     throw new WSException("Cannot obtain UnifiedBeanMetaData for: " + linkName);

                  String configName = apMetaData.getConfigName();
                  String configFile = apMetaData.getConfigFile();
                  if (configName != null || configFile != null)
                     sepMetaData.setConfigName(configName, configFile);

                  EJBSecurityMetaData smd = bmd.getSecurityMetaData();
                  if (smd != null)
                  {
                     String authMethod = smd.getAuthMethod();
                     sepMetaData.setAuthMethod(authMethod);
                     String transportGuarantee = smd.getTransportGuarantee();
                     sepMetaData.setTransportGuarantee(transportGuarantee);
                     Boolean secureWSDLAccess = smd.getSecureWSDLAccess();
                     sepMetaData.setSecureWSDLAccess(secureWSDLAccess);
                  }
               }
               else if (webMetaData != null)
               {
                  wsMetaData.setSecurityDomain(webMetaData.getSecurityDomain());

                  String targetBean = webMetaData.getServletClassNames().get(linkName);
                  sepMetaData.setServiceEndpointImplName(targetBean);

                  // Copy the wsdl publish location from jboss-web.xml
                  String wsdName = serviceMetaData.getWebserviceDescriptionName();
                  String wsdlPublishLocation = webMetaData.getWsdlPublishLocationByName(wsdName);
                  serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);

                  String configName = webMetaData.getConfigName();
                  String configFile = webMetaData.getConfigFile();
                  if (configName != null || configFile != null)
                     sepMetaData.setConfigName(configName, configFile);

                  initTransportGuaranteeJSE(dep, sepMetaData, linkName);
               }

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

               replaceAddressLocation(sepMetaData);

               String seiName = pcMetaData.getServiceEndpointInterface();
               sepMetaData.setServiceEndpointInterfaceName(seiName);

               ServiceEndpointInterfaceMapping seiMapping = javaWsdlMapping.getServiceEndpointInterfaceMapping(seiName);
               if (seiMapping == null)
                  log.warn("Cannot obtain SEI mapping for: " + seiName);

               // process endpoint meta extension
               processEndpointMetaDataExtensions(sepMetaData, wsdlDefinitions);

               // Setup the endpoint operations
               setupOperationsFromWSDL(sepMetaData, wsdlEndpoint, seiMapping);

               // Setup the endpoint handlers
               for (UnifiedHandlerMetaData uhmd : pcMetaData.getHandlers())
               {
                  Set<String> portNames = uhmd.getPortNames();
                  if (portNames.size() == 0 || portNames.contains(portName.getLocalPart()))
                  {
                     HandlerMetaDataJAXRPC hmd = HandlerMetaDataJAXRPC.newInstance(uhmd, HandlerType.ENDPOINT);
                     sepMetaData.addHandler(hmd);
                  }
               }
            }
         }
View Full Code Here

         ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
         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(sepClass, linkName, sepMetaData);

         // 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);

         // 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

   /** 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

         throw new WSException("Cannot resolve request parameter 'pcLink'");

      res.setContentType("text/plain");
      PrintWriter out = res.getWriter();

      ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
      String endpointAddress = sepMetaData.getEndpointAddress();
      out.println(endpointAddress);

      log.debug("Resolved " + pcLink + " to: " + endpointAddress);
      out.close();
   }
View Full Code Here

      for (WSDLInterface wsdlInterface : wsdlDefinitions.getInterfaces())
      {
         WSDLProperty eventSourceProp = wsdlInterface.getProperty(Constants.WSDL_PROPERTY_EVENTSOURCE);
         if (eventSourceProp != null && epMetaData instanceof ServerEndpointMetaData)
         {
            ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData;
            String eventSourceNS = wsdlInterface.getName().getNamespaceURI() + "/" + wsdlInterface.getName().getLocalPart();

            // extract the schema model
            JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
            String[] notificationSchema = EventingUtils.extractNotificationSchema(schemaModel);

            // extract the root element NS
            String notificationRootElementNS = null;
            WSDLInterfaceOperation wsdlInterfaceOperation = wsdlInterface.getOperations()[0];
            if (wsdlInterfaceOperation.getOutputs().length > 0)
            {
               WSDLInterfaceOperationOutput wsdlInterfaceOperationOutput = wsdlInterfaceOperation.getOutputs()[0];
               notificationRootElementNS = wsdlInterfaceOperationOutput.getElement().getNamespaceURI();
            }
            else
            {
               // WSDL operation of an WSDL interface that is marked as an event source
               // requires to carry an output message.
               throw new WSException("Unable to resolve eventing root element NS. No operation output found at " + wsdlInterfaceOperation.getName());
            }

            EventingEpMetaExt ext = new EventingEpMetaExt(EventingConstants.NS_EVENTING);
            ext.setEventSourceNS(eventSourceNS);
            ext.setNotificationSchema(notificationSchema);
            ext.setNotificationRootElementNS(notificationRootElementNS);
            sepMetaData.addExtension(ext);
         }
      }
   }
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
         {

            msgFactory.setServiceMode(sepMetaData.getServiceMode());
            msgFactory.setStyle(sepMetaData.getStyle());

            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

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.