Package org.jboss.soa.esb.listeners.config.xbeanmodel110.FtpBusDocument

Examples of org.jboss.soa.esb.listeners.config.xbeanmodel110.FtpBusDocument.FtpBus


      provider = (FsProvider) model.getProvider(bus);
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <fs-provider> instance.  Unexpected exception - this should have caused a validation error!");
    }
   
    FsMessageFilter messageFilter = listener.getFsMessageFilter();
    if(messageFilter == null) {
      messageFilter = bus.getFsMessageFilter();
      if(messageFilter == null) {
        throw new ConfigurationException("No <fs-detination> defined on either <fs-listener> [" + listener.getName() + "] or <fs-bus> [" + bus.getBusid() + "].");
      }
View Full Code Here


   * @throws ConfigurationException Invalid listener configuration.
   */
  public static Element map(Element root, FsListener listener, XMLBeansModel model) throws ConfigurationException {
    Element listenerNode = YADOMUtil.addElement(root, "listener");
    FsBus bus;
    FsProvider provider;

        listenerNode.setAttribute("name", listener.getName());

        try {
      bus = (FsBus) model.getBus(listener.getBusidref());
View Full Code Here

   * @return The ConfigTree listener configuration node.
   * @throws ConfigurationException Invalid listener configuration.
   */
  public static Element map(Element root, FtpListener listener, XMLBeansModel model) throws ConfigurationException {
    Element listenerNode = YADOMUtil.addElement(root, "listener");
    FtpBus bus;
    FtpProvider provider;

        listenerNode.setAttribute("name", listener.getName());
   
    try {
      bus = (FtpBus) model.getBus(listener.getBusidref());
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <ftp-listener> must reference a <ftp-bus>.");
    }
    try {
      provider = (FtpProvider) model.getProvider(bus);
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <ftp-provider> instance.  Unexpected exception - this should have caused a validation error!");
    }
   
    FtpMessageFilter messageFilter = listener.getFtpMessageFilter();
    if(messageFilter == null) {
      messageFilter = bus.getFtpMessageFilter();
      if(messageFilter == null) {
        throw new ConfigurationException("No <ftp-detination> defined on either <ftp-listener> [" + listener.getName() + "] or <ftp-bus> [" + bus.getBusid() + "].");
      }
    }
    // Map the standard listener attributes - common across all listener types...
    MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
    // Map the <property> elements targeted at the listener - from the listener itself.
View Full Code Here

      provider = (FtpProvider) model.getProvider(bus);
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <ftp-provider> instance.  Unexpected exception - this should have caused a validation error!");
    }
   
    FtpMessageFilter messageFilter = listener.getFtpMessageFilter();
    if(messageFilter == null) {
      messageFilter = bus.getFtpMessageFilter();
      if(messageFilter == null) {
        throw new ConfigurationException("No <ftp-detination> defined on either <ftp-listener> [" + listener.getName() + "] or <ftp-bus> [" + bus.getBusid() + "].");
      }
    }
    // Map the standard listener attributes - common across all listener types...
    MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
    // Map the <property> elements targeted at the listener - from the listener itself.
    MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);     
    if(listener.getIsGateway()) {
      if ( messageFilter.getReadOnly() )
        listenerNode.setAttribute("gatewayClass", ReadOnlyRemoteGatewayListener.class.getName());
      else
        listenerNode.setAttribute("gatewayClass", RemoteGatewayListener.class.getName());
      // Map EPR related attributes onto the listener - from the bus and provider and listener.
      // Note: This will change - the Gateways will also support the EPR element...
View Full Code Here

   * @throws ConfigurationException Invalid listener configuration.
   */
  public static Element map(Element root, FtpListener listener, XMLBeansModel model) throws ConfigurationException {
    Element listenerNode = YADOMUtil.addElement(root, "listener");
    FtpBus bus;
    FtpProvider provider;

        listenerNode.setAttribute("name", listener.getName());
   
    try {
      bus = (FtpBus) model.getBus(listener.getBusidref());
View Full Code Here

   * @return The ConfigTree listener configuration node.
   * @throws ConfigurationException Invalid listener configuration.
   */
  public static Element map(Element root, HibernateListener listener, XMLBeansModel model) throws ConfigurationException {
    Element listenerNode = YADOMUtil.addElement(root, "listener");
    HibernateBus bus;
    HibernateProvider provider;

        listenerNode.setAttribute("name", listener.getName());

    try {
      bus = (HibernateBus) model.getBus(listener.getBusidref());
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <hibernate-listener> must reference a <hibernate-bus>.");
    }
    try {
      provider = (HibernateProvider) model.getProvider(bus);
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <hibernate-provider> instance.  Unexpected exception - this should have caused a validation error!");
    }
   
    List<HibernateMessageFilter> messageFilters = null;
    messageFilters = listener.getHibernateMessageFilterList();
   
    if(messageFilters.size() == 0) {
      messageFilters = bus.getHibernateMessageFilterList();
      if(messageFilters == null) {
        throw new ConfigurationException("No <hibernate-message-filter> defined on either <hibernate-listener> [" + listener.getName() + "] or <hibernate-bus> [" + bus.getBusid() + "].");
      }
    }
    // Map the standard listener attributes - common across all listener types...
    MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
    // Map the <property> elements targeted at the listener - from the listener itself.
View Full Code Here

   * @throws ConfigurationException Invalid listener configuration.
   */
  public static Element map(Element root, HibernateListener listener, XMLBeansModel model) throws ConfigurationException {
    Element listenerNode = YADOMUtil.addElement(root, "listener");
    HibernateBus bus;
    HibernateProvider provider;

        listenerNode.setAttribute("name", listener.getName());

    try {
      bus = (HibernateBus) model.getBus(listener.getBusidref());
View Full Code Here

     * @return The ConfigTree listener configuration node.
     * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
     */
    public static Element map(Element root, HttpListener listener, XMLBeansModel model) throws ConfigurationException {
        Element listenerNode = YADOMUtil.addElement(root, "listener");
        HttpBus bus;
        HttpProvider provider;
       
        listenerNode.setAttribute("name", listener.getName());

        try {
            bus = (HttpBus) model.getBus(listener.getBusidref());
        } catch (ClassCastException e) {
            throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <http-listener> must reference a <http-bus>.");
        }
        try {
            provider = (HttpProvider) model.getProvider(bus);
           
        } catch (ClassCastException e) {
            throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <http-provider> instance.  Unexpected exception - this should have caused a validation error!");
        }

        // Map the standard listener attributes - common across all listener types...
        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
        // Map the <property> elements targeted at the listener - from the listener itself.
        //MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
        for(Property property : provider.getPropertyList()) {
            Element propertyElement = listenerNode.getOwnerDocument().createElement("property");
            MapperUtil.serialize(property, propertyElement);
            listenerNode.appendChild(propertyElement);          
         }
       
       
       
       
        MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);

        if(listener.getIsGateway()) {
            String host = provider.getHost();
            int port = provider.getPort();
           
            listenerNode.setAttribute("gatewayClass", HttpGatewayListener.class.getName());
      listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));

            if(host != null) {
                listenerNode.setAttribute(HttpGatewayListener.SERVER_HOST_TAG, host);
            }
            listenerNode.setAttribute(HttpGatewayListener.REQUEST_CONTEXT_TAG, bus.getContext());
            listenerNode.setAttribute(HttpGatewayListener.SERVER_PORT_TAG, Integer.toString(port));
        } else {
      throw new ConfigurationException("Invalid <http-listener> config [" + listener.getName() +"]. <http-listener> is currently only supported as a gateway listener.");
        }

View Full Code Here

     * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
     */
    public static Element map(Element root, HttpListener listener, XMLBeansModel model) throws ConfigurationException {
        Element listenerNode = YADOMUtil.addElement(root, "listener");
        HttpBus bus;
        HttpProvider provider;
       
        listenerNode.setAttribute("name", listener.getName());

        try {
            bus = (HttpBus) model.getBus(listener.getBusidref());
        } catch (ClassCastException e) {
            throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <http-listener> must reference a <http-bus>.");
        }
        try {
            provider = (HttpProvider) model.getProvider(bus);
           
        } catch (ClassCastException e) {
            throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <http-provider> instance.  Unexpected exception - this should have caused a validation error!");
        }

        // Map the standard listener attributes - common across all listener types...
        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
        // Map the <property> elements targeted at the listener - from the listener itself.
        //MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
        for(Property property : provider.getPropertyList()) {
            Element propertyElement = listenerNode.getOwnerDocument().createElement("property");
            MapperUtil.serialize(property, propertyElement);
            listenerNode.appendChild(propertyElement);          
         }
       
       
       
       
        MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);

        if(listener.getIsGateway()) {
            String host = provider.getHost();
            int port = provider.getPort();
           
            listenerNode.setAttribute("gatewayClass", HttpGatewayListener.class.getName());
      listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));

            if(host != null) {
View Full Code Here

     * @return The ConfigTree listener configuration node.
     * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
     */
    public static Element map(Element root, JbrListener listener, XMLBeansModel model) throws ConfigurationException {
        Element listenerNode = YADOMUtil.addElement(root, "listener");
        JbrBus bus;
        JbrProvider provider;

        listenerNode.setAttribute("name", listener.getName());

        try {
            bus = (JbrBus) model.getBus(listener.getBusidref());
        } catch (ClassCastException e) {
            throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <jbr-listener> must reference a <jbr-bus>.");
        }
        try {
            provider = (JbrProvider) model.getProvider(bus);
        } catch (ClassCastException e) {
            throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <jbr-provider> instance.  Unexpected exception - this should have caused a validation error!");
        }

        // Map the standard listener attributes - common across all listener types...
        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
        // Map the <property> elements targeted at the listener - from the listener itself.
        MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
        MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);

        if(listener.getIsGateway()) {
            String host = provider.getHost();

            listenerNode.setAttribute("gatewayClass", JBossRemotingGatewayListener.class.getName());
      listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));

            if(host != null) {
                listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_HOST, host);
            }
            listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PROTOCOL, provider.getProtocol().toString());
            listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PORT, Integer.toString(bus.getPort()));
        } else {
            throw new ConfigurationException("Invalid <jbr-listener> config [" + listener.getName() + "].  <jbr-listener> is currently only supported as a gateway listener.");
        }

        return listenerNode;
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.listeners.config.xbeanmodel110.FtpBusDocument.FtpBus

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.