Examples of BindingCustomization


Examples of org.jboss.wsf.spi.binding.BindingCustomization

      jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP, "http://org.jboss.bindingCustomization");
      endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
      endpoint.setState(EndpointState.STARTED);

      // read a single customization
      BindingCustomization knownCustomization = endpoint.getAttachment(BindingCustomization.class);
      assertNotNull(knownCustomization);

      // however the iteratoion should be unmodifiable
      try
      {
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

         JAXBContextFactory factory = JAXBContextFactory.newInstance();

         // JAXBIntros may mofiy the WSDL being generated
         // only true for server side invocation, tooling (WSProvide) doesnt support this
         BindingCustomization bindingCustomization = null;
         if (epMetaData instanceof ServerEndpointMetaData)
         {
            Endpoint endpoint = ((ServerEndpointMetaData)epMetaData).getEndpoint();
            bindingCustomization = endpoint != null ? endpoint.getAttachment(BindingCustomization.class) : null;
         }
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

      if(null == context)
      { 
         CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
         EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
         String defaultNS = epMetaData.getPortTypeName().getNamespaceURI();
         BindingCustomization bindingCustomization = getBindingCustomization();
         for (Class<?> clz : types)
         {
            if (clz.getName().endsWith("ObjectFactory"))
            {
               for (Method meth : clz.getMethods())
               {
                  XmlElementDecl elementDecl = meth.getAnnotation(XmlElementDecl.class);
                  if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
                        && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
                  {
                     defaultNS = null;
                  }
               }
            }
         }
         if (defaultNS != null)
         {
            if (bindingCustomization == null)
               bindingCustomization = new JAXBBindingCustomization();
            bindingCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNS);
         }
         context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
         cache.add(types, context);
      }
      return context;
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

      if(null==context)
      {
         CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
         EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
         String defaultNS = epMetaData.getPortTypeName().getNamespaceURI();
         BindingCustomization bindingCustomization = getBindingCustomization();
         for (Class<?> clz : types)
         {
            if (clz.getName().endsWith("ObjectFactory"))
            {
               for (Method meth : clz.getMethods())
               {
                  XmlElementDecl elementDecl = meth.getAnnotation(XmlElementDecl.class);
                  if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
                        && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
                  {
                     defaultNS = null;
                  }
               }
            }
         }
         if (defaultNS != null)
         {
            if (bindingCustomization == null)
               bindingCustomization = new JAXBBindingCustomization();
            bindingCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNS);
         }
         context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
         cache.add(types, context);
      }
      return context;
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

   public JAXBContext createContext(Class[] clazzes) throws WSException
   {
      try
      {
         BindingCustomization bcust = getCustomization();

         JAXBContext jaxbCtx;
         if (null == bcust)
            jaxbCtx = JAXBContext.newInstance(clazzes);
         else
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

   {
      //initialize jaxb context cache
      if ("true".equalsIgnoreCase(System.getProperty(Constants.EAGER_INITIALIZE_JAXB_CONTEXT_CACHE)))
      {
         log.debug("Initializing JAXBContext cache...");
         BindingCustomization bindingCustomization = null;
         if (this instanceof ServerEndpointMetaData)
         {
            bindingCustomization = ((ServerEndpointMetaData)this).getEndpoint().getAttachment(BindingCustomization.class);
         }
         try
         {
            Class[] classes = getRegisteredTypes().toArray(new Class[0]);
            String defaultNS = portTypeName.getNamespaceURI();
            for (Class<?> clz : classes)
            {
               if (clz.getName().endsWith("ObjectFactory"))
               {
                  for (Method method : clz.getMethods())
                  {
                     XmlElementDecl elementDecl = method.getAnnotation(XmlElementDecl.class);
                     if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
                           && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
                     {
                        defaultNS = null;
                     }
                  }
               }
            }
            if (defaultNS != null)
            {
               if (bindingCustomization == null)
                  bindingCustomization = new JAXBBindingCustomization();
               bindingCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP, defaultNS);
            }
            JAXBContext context = JAXBContextFactory.newInstance().createContext(classes, bindingCustomization);
            jaxbCache.add(classes, context);
         }
         catch (Exception e)
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

         if(introsConfigStream != null)
         {
            JaxbIntros jaxbIntros = IntroductionsConfigParser.parseConfig(introsConfigStream);
            IntroductionsAnnotationReader annotationReader = new IntroductionsAnnotationReader(jaxbIntros);
            String defaultNamespace = jaxbIntros.getDefaultNamespace();
            BindingCustomization jaxbCustomizations = new JAXBBindingCustomization();

            jaxbCustomizations.put(JAXBRIContext.ANNOTATION_READER, annotationReader);
            if(defaultNamespace != null) {
               jaxbCustomizations.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespace);
            }

            // ServerEndpointMetaData#getBindingCustomization becomes the consumer later on
            for(Endpoint endpoint : deployment.getService().getEndpoints())
            {
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

         JAXBContextFactory factory = JAXBContextFactory.newInstance();

         // JAXBIntros may mofiy the WSDL being generated
         // only true for server side invocation, tooling (WSProvide) doesnt support this
         BindingCustomization bindingCustomization = null;
         if (epMetaData instanceof ServerEndpointMetaData)
         {
            Endpoint endpoint = ((ServerEndpointMetaData)epMetaData).getEndpoint();
            bindingCustomization = endpoint != null ? endpoint.getAttachment(BindingCustomization.class) : null;
         }
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

      JAXBContextCache cache = JAXBContextCache.getContextCache();
      JAXBContext context = cache.get(types);
      if(null==context)
      {
         BindingCustomization bindingCustomization = getBindingCustomization();
         context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
         cache.add(types, context);
      }
      return context;
   }
View Full Code Here

Examples of org.jboss.wsf.spi.binding.BindingCustomization

   public JAXBContext createContext(Class[] clazzes) throws WSException
   {
      try
      {
         BindingCustomization bcust = getCustomization();

         JAXBContext jaxbCtx;
         if (null == bcust)
            jaxbCtx = JAXBContext.newInstance(clazzes);
         else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.