Examples of ElementHandler


Examples of nexj.core.util.XMLUtil.ElementHandler

                 
                  if ("binding".equals(localName))
                  {
                     final boolean retVal[] = new boolean[] {false};
                    
                     XMLUtil.forEachChildElement(element, null, new ElementHandler()
                     {
                        public void handleElement(Element element)
                        {
                           if ("binding".equals(element.getLocalName()) && NAMESPACE_SOAP.equals(element.getNamespaceURI()))
                           {
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

      {
         final Message fRetValue[] = new Message[2];

         if (m_messageMap != null)
         {
            XMLUtil.forEachElementRecur(portType, null, new ElementHandler()
            {              
               public void handleElement(Element element)
               {
                  if ("input".equals(element.getLocalName()))
                  {
                     if (parentName(element).equals(fOperationName))
                     {
                        fRetValue[0] = parseMessage(element);
                     }
                  }
                  else if ("output".equals(element.getLocalName()))
                  {
                     if (parentName(element).equals(fOperationName))
                     {
                        fRetValue[1] = parseMessage(element);
                     }
                  }
               }
              
               private Message parseMessage(Element element)
               {
                  Element wsdlMessage = (Element)m_messageMap.get(stripNamespacePrefix(element.getAttribute("message")));
                 
                  if (wsdlMessage != null)
                  {
                     final Message fRetVal[] = new Message[1];
                    
                     XMLUtil.forEachChildElement(wsdlMessage, null, new ElementHandler()
                     {
                        public void handleElement(Element element)
                        {
                           if ("part".equals(element.getLocalName()))
                           {
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

     
      public Iterator operationIterator(Element parent)
      {
         final List fList = new ArrayList();
        
         XMLUtil.forEachChildElement(parent, null, new ElementHandler()
         {
            public void handleElement(Element element)
            {
               if ("operation".equals(element.getLocalName()))
               {
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

      if (element != null)
      {
         loadFragment(element, defaultFragment, loader);

         XMLUtil.withFirstChildElement(element, "Fragments", false, new ElementHandler()
         {
            public void handleElement(Element fragmentsElement)
            {
               XMLUtil.forEachChildElement(fragmentsElement, "Fragment", loader.getHelper().new ElementHandler("fragment")
               {
                  protected void handleElement(Element fragmentElement, String sName)
                  {
                     VirtualDataSourceFragment fragment = (VirtualDataSourceFragment)defaultFragment.clone(false);
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

   protected void loadDataSourceTypes(Element dstElement)
   {
      XMLMetadataHelper.verifyRootElement(dstElement, "DataSourceTypes");

      XMLUtil.forEachChildElement(dstElement, "DataSourceType",
         m_helper.new ElementHandler("dataSourceType")
      {
         public void handleElement(Element element, String sName)
         {
            loadDataSourceType(element, sName);
         }
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

      String sElement = XMLUtil.getReqStringAttr(dstElement, "element");

      XMLMetadataHelper.validateName(sElement);
      m_metadata.addDataSourceTypeElement(sElement, type);

      XMLUtil.withFirstChildElement(dstElement, "Adapters", false, new ElementHandler()
      {
         public void handleElement(Element adaptersElement)
         {
            XMLUtil.forEachChildElement(adaptersElement, "Adapter",
               m_helper.new ElementHandler("adapter")
            {
               public void handleElement(Element adapterElement, String sAdapterName)
               {
                  DataSourceAdapter adapter = new DataSourceAdapter(sAdapterName);
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

      dataSource.setDeletable(XMLUtil.getBooleanAttr(element, "delete", true));
      dataSource.setExecutable(XMLUtil.getBooleanAttr(element, "execute", true));
      dataSource.setJoinable(XMLUtil.getBooleanAttr(element, "join", true));
      dataSource.setReadLimit(XMLUtil.getIntAttr(element, "readLimit", dataSource.getReadLimit()));

      XMLUtil.withFirstChildElement(element, "Properties", false, new ElementHandler()
      {
         public void handleElement(final Element propertiesElement)
         {
            addIOFixup(new ContextFixup(m_helper)
            {
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

   protected void loadChannelTypes(Element chtElement)
   {
      XMLMetadataHelper.verifyRootElement(chtElement, "ChannelTypes");

      XMLUtil.forEachChildElement(chtElement, "ChannelType",
         m_helper.new ElementHandler("channelType")
      {
         public void handleElement(Element element, String sName)
         {
            loadChannelType(element, sName);
         }
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

      {
         throw new MetadataException("err.meta.integration.combine",
            new Object[]{sCombine, channel.getName()});
      }

      XMLUtil.withFirstChildElement(element, "SenderProperties", false, new ElementHandler()
      {
         public void handleElement(final Element propertiesElement)
         {
            addIOFixup(new ContextFixup(m_helper)
            {
               public void fixup()
               {
                  if (channel.getSender() != null)
                  {
                     loadComponentProperties(propertiesElement, channel.getSender());
                  }
               }
            });
         }
      });

      XMLUtil.withFirstChildElement(element, "ReceiverProperties", false, new ElementHandler()
      {
         public void handleElement(final Element propertiesElement)
         {
            addIOFixup(new ContextFixup(m_helper)
            {
               public void fixup()
               {
                  if (channel.getReceiver() != null)
                  {
                     loadComponentProperties(propertiesElement, channel.getReceiver());
                  }
               }
            });
         }
      });

      if (!m_bIntegrationExcluded)
      {
         XMLUtil.withFirstChildElement(element, "ServiceBindings", false, new ElementHandler()
         {
            public void handleElement(final Element bindingsElement)
            {
               addPersistenceMappingFixup(new ContextFixup(m_helper)
               {
                  public void fixup()
                  {
                     XMLUtil.forEachChildElement(bindingsElement, "ServiceBinding", m_helper.new ElementHandler("service")
                     {
                        protected String getName(Element element)
                        {
                           return XMLUtil.getReqStringAttr(element, "service");
                        }

                        public void handleElement(Element bindingElement, String sService)
                        {
                           final Binding binding = new Binding(m_metadata.getService(sService), channel);
                           String sOutput = XMLUtil.getStringAttr(bindingElement, "output");

                           if (sOutput != null)
                           {
                              binding.setOutput(m_metadata.getChannel(sOutput));
                           }

                           XMLUtil.withFirstChildElement(bindingElement, "Arguments", false, new ElementHandler()
                           {
                              public void handleElement(Element argumentsElement)
                              {
                                 XMLUtil.forEachChildElement(argumentsElement, "Argument", m_helper.new ElementHandler("argument")
                                 {
                                    public void handleElement(Element argumentElement, String sArgument)
                                    {
                                       String sChannel = XMLUtil.getStringAttr(argumentElement, "channel");
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

   {
      final Set connectionSet = new HashHolder();

      if (connectionsElement != null)
      {
         XMLUtil.withFirstChildElement(connectionsElement, "DataSourceConnections", false, new ElementHandler()
         {
            public void handleElement(Element connectionsElement)
            {
               XMLUtil.forEachChildElement(connectionsElement, null,
                  m_helper.new ElementHandler("dataSource")
               {
                  protected String getName(Element element)
                  {
                     return XMLUtil.getReqStringAttr(element, "dataSource");
                  }

                  public void handleElement(Element connectionElement, String sDataSource)
                  {
                     DataSource source = m_metadata.getDataSource(sDataSource);
                     String sExpectedElement = m_metadata.getDataSourceTypeElement(source.getType()) + "Connection";

                     if (!sExpectedElement.equals(connectionElement.getNodeName()))
                     {
                        throw new MetadataException("err.meta.dataSourceConnectionElement",
                           new Object[]{connectionElement.getNodeName(), source.getName(),
                           sConnectionsName, sExpectedElement});
                     }

                     if (!connectionSet.add(source))
                     {
                        throw new MetadataException("err.meta.dupDataSourceConnection", new Object[]{sDataSource});
                     }

                     String sAdapter = XMLUtil.getStringAttr(connectionElement, "adapter");

                     if (sAdapter != null)
                     {
                        source.setAdapter(source.getType().getAdapter(sAdapter));
                     }

                     source.setReadLimit(XMLUtil.getIntAttr(connectionElement, "readLimit", source.getReadLimit()));

                     //Load DataSource-specific attributes.
                     ((XMLPersistenceMetadataLoader)m_helper.getClassInstance(source.getType().getLoader()))
                        .loadConnection(connectionElement, source, XMLMetadataLoader.this);
                  }
               });
            }
         });
      }

      //Call loadConnection to initialize DataSources with no entry in the .connections file.
      for (Iterator itr = m_metadata.getDataSourceIterator(); itr.hasNext();)
      {
         DataSource source = (DataSource)itr.next();

         if (!connectionSet.contains(source))
         {
            int nCookie = getHelper().pushMarker(MetadataValidationException.TYPE_NAME, "DataSourceConnection");
            getHelper().pushMarker("dataSourceConnection", source.getName());

            try
            {
               ((XMLPersistenceMetadataLoader)m_helper.getClassInstance(source.getType().getLoader()))
                  .loadConnection(null, source, XMLMetadataLoader.this);
            }
            catch (MetadataException e)
            {
               m_helper.addException(e);
            }
            finally
            {
               m_helper.restoreMarker(nCookie);
            }
         }
      }

      if (connectionsElement != null && !m_bIntegrationExcluded)
      {
         XMLUtil.withFirstChildElement(connectionsElement, "ChannelConnections", false, new ElementHandler()
         {
            public void handleElement(Element connectionsElement)
            {
               XMLUtil.forEachChildElement(connectionsElement, null,
                  m_helper.new ElementHandler("channel")
               {
                  protected String getName(Element element)
                  {
                     return XMLUtil.getReqStringAttr(element, "channel");
                  }
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.