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

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


   * @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, 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

     * @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.");
        }

View Full Code Here

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

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

    try {
      bus = (JmsBus) model.getBus(listener.getBusidref());
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <jms-listener> must reference a <jms-bus>.");
    }
    try {
      provider = (JmsProviderType) model.getProvider(bus);
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <jms-provider> instance.  Unexpected exception - this should have caused a validation error!");
    }
   
    JmsMessageFilter messageFilter = listener.getJmsMessageFilter();
    if(messageFilter == null) {
      messageFilter = bus.getJmsMessageFilter();
      if(messageFilter == null) {
        throw new ConfigurationException("No <jms-detination> defined on either <jms-listener> [" + listener.getName() + "] or <jms-bus> [" + bus.getBusid() + "].");
      }
    }
   
    final Class<?> gatewayClass ;
    if (provider instanceof JmsJcaProvider) {
View Full Code Here

  public void test_model() throws Exception {
    final InputStream is = getClass().getResourceAsStream("jbossesb_config_01.xml");
    final Reader reader = new InputStreamReader(is) ;
    XMLBeansModel model = new XMLBeansModel(Factory.parse(reader).getJbossesb());

    JmsBus bus = (JmsBus)model.getBus("server1-jms");
    JmsProviderType provider = (JmsProviderType) model.getProvider(bus);
    assertEquals("server1-jms", bus.getBusid());
    assertEquals("com.xyz.provider.XYZConnectionFactory", provider.getConnectionFactory());
    assertEquals("com.xyz.provider.NamingContextFactory", provider.getJndiContextFactory());
    assertEquals("xyz://server1:9876", provider.getJndiURL());
    assertEquals("com.xyz", provider.getJndiPkgPrefix());
    JmsMessageFilter busDestination = bus.getJmsMessageFilter();
    assertEquals("queue/A", busDestination.getDestName());
    assertEquals(JmsMessageFilter.DestType.QUEUE, busDestination.getDestType());
    assertEquals("service='Reconciliation'", busDestination.getSelector());

    List<Listener> gateways = model.getGatewayListeners();
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.listeners.config.xbeanmodel101.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.