Package org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsMessageFilterDocument

Examples of org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsMessageFilterDocument.JmsMessageFilter


        if ( activationConfig != null )
        {
            List<Property> propertyList = activationConfig.getPropertyList();
            for (Iterator<Property> iterator = propertyList.iterator(); iterator.hasNext();)
        {
          Property prop = iterator.next();
          if ( defaultPropertyNames.contains( prop.getName() ))
              throw new ConfigurationException( "activation-config already contains [" + prop.getName() + "], which cannot be overridden");

                addPropertyElement(activationConfigElement, prop.getName(), prop.getValue()) ;
        }
        }
    }
View Full Code Here


  private Property createActivationProperty(
      final ActivationConfig activationConfig,
      final String name,
      final String value )
  {
    Property property = activationConfig.addNewProperty();
    property.setName( name );
    property.setValue( value );
    return property;
  }
View Full Code Here

    }
    Bus bus = model.getBus(listener.getBusidref());
    if(bus.getClass() != BusImpl.class) {
      throw new ConfigurationException("The base Listener config [" + listener.getName() + "] must reference a base Bus config type (<bus>).");
    }
    Provider provider = model.getProvider(bus);
    if(provider.getClass().isAssignableFrom(BusProviderImpl.class)) {
      throw new ConfigurationException("A base Bus config type (<bus>) must be contained within a base Provider type (<bus-provider>).");
    }
  }
View Full Code Here

                else if (listener instanceof JmsListener) {
                    final Bus bus = model.getBus(listener.getBusidref()) ;
                    if (!(bus instanceof JmsBus))
                        continue ;

                    final Provider provider = model.getProvider(bus) ;
                    if (provider instanceof JmsJcaProvider) {
                        // Jms JCA provider defaults to true
                        final JmsJcaProvider jmsJcaProvider = (JmsJcaProvider)provider ;
                        if (!jmsJcaProvider.isSetTransacted() || jmsJcaProvider.getTransacted())
                            return true ;
                    } else if (provider instanceof JmsProviderType) {
                        JmsMessageFilter filter = ((JmsListener)listener).getJmsMessageFilter() ;
                        if (filter == null)
                            filter = ((JmsBus)bus).getJmsMessageFilter() ;
                        if ((filter != null) && filter.getTransacted())
                            return true ;
                    }
                } else if (listener instanceof SqlListener) {
                    final Bus bus = model.getBus(listener.getBusidref()) ;
                    if (!(bus instanceof SqlBus))
                        continue ;

                    final Provider provider = model.getProvider(bus) ;
                    if ((provider instanceof SqlProvider) && ((SqlProvider)provider).getTransacted())
                        return true ;
                }
            }
        }
View Full Code Here

    JmsListenerDocument.JmsListener jmsListener = (JmsListener) listeners.get(0);
    assertEquals ( false, jmsListener.getIsGateway() );
   
    JmsBusDocument.JmsBus jmsBus = (JmsBusDocument.JmsBus) model.getBus( jmsListener.getBusidref() );
    assertNotNull( "JmsBus element should exist", jmsBus );
    Provider provider = model.getProvider( jmsBus );
    assertTrue( provider instanceof JmsJcaProvider );
    return (JmsJcaProvider) provider;
  }
View Full Code Here

     * Get the &lt;bus&gt; configuration matching the supplied busid reference value.
     * @param busid The required &lt;bus&gt; configuration reference value.
     * @return The Bus configuration instance.
     */
    public Bus getOptionalBus(String busid) {
        Providers providers = jbossesb.getProviders();

        if(providers != null) {
            List<Provider> providerList = providers.getProviderList();

            for(Provider provider : providerList) {
                if(provider instanceof BusProvider) {
                    List<Bus> buses = ((BusProvider)provider).getBusList();

View Full Code Here

     * Get the &lt;provider&gt; configuration containing the supplied Bus configuration instance.
     * @param bus The Bus config instance whose Provider is being sought.
     * @return The Provider configuration instance.
     */
    public Provider getProvider(Bus bus) {
        Providers providers = jbossesb.getProviders();

        if(providers != null) {
            List<Provider> providerList = providers.getProviderList();

            for(Provider provider : providerList) {
                if(provider instanceof BusProvider) {
                    List<Bus> buses = ((BusProvider)provider).getBusList();

View Full Code Here

     * Get the &lt;provider&gt; configuration containing the supplied Bus configuration instance.
     * @param providerType The Bus Provider type is being sought.
     * @return The Provider configuration instance.
     */
    public Provider getProvider(Class<? extends BusProvider> providerType) {
        Providers providers = jbossesb.getProviders();

        if(providers != null) {
            List<Provider> providerList = providers.getProviderList();

            for(Provider provider : providerList) {
                if(providerType.isAssignableFrom(provider.getClass())) {
                    return provider;
                }
View Full Code Here

     * Verify the schedule provider configuration.
     * @throws org.jboss.soa.esb.ConfigurationException
     */
    public void verifyScheduleProviderConfig()
        throws ConfigurationException {
        Providers providersConfig = jbossesb.getProviders();

        if(providersConfig == null) {
            return;
        }

        List<Provider> providers = providersConfig.getProviderList();
        int numScheduleProviders = 0;

        for(Provider provider : providers) {
            if(provider instanceof ScheduleProvider) {
                numScheduleProviders++;
View Full Code Here

        int pollFrequency = scheduledListener.getPollFrequencySeconds();
        int pollLatency = getPollLatencySeconds(scheduledListener);

        if(scheduleIdRef != null) {
            listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_ID_REF, scheduleIdRef);
            final Schedule schedule = model.getSchedule(scheduleIdRef) ;
            if (schedule.isSetStartDate()) {
                listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_START_DATE, Long.toString(schedule.getStartDate().getTimeInMillis())) ;
            }
            if (schedule.isSetEndDate()) {
                listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_END_DATE, Long.toString(schedule.getEndDate().getTimeInMillis())) ;
            }
            if (schedule instanceof SimpleSchedule) {
                final SimpleSchedule simpleSchedule = (SimpleSchedule)schedule ;
                final long simpleFrequency = simpleSchedule.getFrequency() ;
                final FrequencyUnit.Enum unit = simpleSchedule.getFrequencyUnits() ;
                final String frequencyVal ;
                if (unit.equals(FrequencyUnit.SECONDS)) {
                    frequencyVal = Long.toString(simpleFrequency * 1000) ;
                } else {
                    frequencyVal = Long.toString(simpleFrequency) ;
                }
                listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_SIMPLE_FREQUENCY, frequencyVal) ;
                if (simpleSchedule.isSetExecCount()) {
                    listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_SIMPLE_EXEC, Integer.toString(simpleSchedule.getExecCount())) ;
                }
            } else if (schedule instanceof CronSchedule) {
                final String cronExpression = ((CronSchedule)schedule).getCronExpression() ;
                if (cronExpression == null) {
                    throw new ConfigurationException("Missing cron expression from configuration") ;
                }
                listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_CRON_EXPRESSION, cronExpression) ;
            } else {
                throw new ConfigurationException("Unknown schedule type specified in configuration: " + schedule.getClass().getName()) ;
            }

            if(domElement.hasAttribute("poll-frequency-seconds") || domElement.hasAttribute("schedule-frequency") ) {
                logger.warn("Schedule Listener '" + listenerConfig.getTagName() + "' defines both 'scheduleidref' and frequency attributes.  Using the 'scheduleidref'.");
            }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.listeners.config.xbeanmodel130.JmsMessageFilterDocument.JmsMessageFilter

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.