Package org.jboss.soa.esb.helpers

Examples of org.jboss.soa.esb.helpers.ConfigTree


            Generator generator = new Generator(new ByteArrayInputStream(configXml.getBytes()), listenerXml, gatewayXml);
            generator.generate();
            byte[] listenerBytes = listenerXml.toByteArray();
            //System.out.println("*************** listenerBytes: " + new String(listenerBytes));
            ByteArrayInputStream listenerIs = new ByteArrayInputStream(listenerBytes);
            ConfigTree listenerConfig = ConfigTree.fromInputStream(listenerIs);
            if (serviceName != null) {
              listenerConfig.setAttribute(ListenerTagNames.DEPLOYMENT_NAME_TAG,
                serviceName.getKeyProperty(ListenerTagNames.DEPLOYMENT_NAME_TAG));
            }
            List<ManagedLifecycle> instances = LifecycleUtil.getListeners(listenerConfig);

            byte[] gatewayBytes = gatewayXml.toByteArray();
            //System.out.println("*************** gatewayBytes: " + new String(gatewayBytes));
            ByteArrayInputStream gatewayIs = new ByteArrayInputStream(gatewayBytes);
            ConfigTree gatewayConfig = ConfigTree.fromInputStream(gatewayIs);
            instances.addAll(LifecycleUtil.getGateways(gatewayConfig));
           
            ModelAdapter model = generator.getModel();
           
            // Handle the ServiceContracts
View Full Code Here


                m_iTimeoutSo = (null != sTimeoutSo) ? Integer.parseInt(sTimeoutSo) : FtpUtils.getTimeoutSo();
        }

        protected void configTreeFromEpr () throws RemoteFileSystemException
        {
                m_oParms = new ConfigTree("fromEpr");
                try
                {
                        m_oParms.setAttribute(PARMS_FTP_SERVER, m_sFtpServer);
                        m_oParms.setAttribute(PARMS_USER, m_sUser);
                        if (m_sPasswd != null)
View Full Code Here

        instance = new ScheduleProvider(schedulerConfig, schedules);

        try {
            for(ManagedLifecycle listener : listeners) {
                if(listener instanceof ScheduledEventListener) {
                    ConfigTree config = listener.getConfig();
                    String scheduleIdRef = config.getAttribute(ATTR_SCHEDULE_ID_REF);

                    if(scheduleIdRef != null) {
                        instance.addListener((ScheduledEventListener) listener, scheduleIdRef);
                    } else {
                        long frequency = config.getLongAttribute(ATTR_FREQUENCY, 10);
                        instance.addListener((ScheduledEventListener) listener, frequency);
                    }
                }
            }
        } catch (SchedulingException e) {
View Full Code Here

        } // _________________________________

        public FtpClientUtil (List<KeyValuePair> attribs, boolean connect)
                        throws RemoteFileSystemException, ConfigurationException
        {
                m_oParms = new ConfigTree("fromProps");
                for (KeyValuePair oCurr : attribs)
                        m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
                initialize(connect);
        } // __________________________________
View Full Code Here

    m_oCols = new Properties();
    ConfigTree[] oaP = m_oParms.getChildren(CHILD_COLUMN);
    for (int i1 = 0; i1 < oaP.length; i1++)
    {
      ConfigTree oCurr = oaP[i1];
      String sCol = oCurr.getAttribute(ATT_NAME);
      if (null == sCol)
      {
        continue;
      }
      sCol = sCol.trim();
      if (sCol.length() < 1)
      {
        continue;
      }
      String sVal = oCurr.getAttribute(ATT_VALUE);
      if (null == sVal)
      {
        sVal = "";
      }
     
View Full Code Here

     *            Object - This object's toString() method will supply contents
     *            of mail message
     */
    public void sendEmail(final Message message) throws MessageDeliverException
    {
        ConfigTree configTree = config.cloneObj();
        overrideSmtpProperties(message, configTree);
       
        Object obj = payloadProxy.getPayload(message);
        sendEmail(configTree, obj);
    }
View Full Code Here

            } else {
                content = obj.toString();
                payloadBytes = content.getBytes();
            }

            ConfigTree configTree = config.cloneObj();
            String sMsg = configTree.getAttribute(Email.MESSAGE);
            sMsg = ((null == sMsg) ? content : (sMsg + "\n" + content));
            configTree.setAttribute(Email.MESSAGE, sMsg);
           
            sendEmail(configTree, payloadBytes);
        }
        catch (final AddressException e)
        {
View Full Code Here

                for (int i = 0; i < noOfItems; i++) {
                    this.allowedPorts[i] = Integer.parseInt(tokens.nextToken());
                }
            }
   
            ConfigTree configTree = toConfigTree(config);
   
            try {
                messageComposer = MessageComposer.Factory.getInstance(configTree.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG, HttpMessageComposer.class.getName()), configTree);
            } catch (ConfigurationException e) {
                throw new ServletException("Failed to create message composer.", e);
            } catch (MessageDeliverException e) {
                throw new ServletException("Failed to create message composer.", e);
            }
   
            asyncInvoke = configTree.getBooleanAttribute(ASYNC_SERVICE_INVOKE, false);
            if(asyncInvoke) {
                String asyncSCConfig = configTree.getAttribute(ASYNC_STATUS_CODE);
                try {
                    asyncStatusCode = Integer.parseInt(asyncSCConfig);
                } catch (NumberFormatException e) {
                    throw new ServletException("Invalid static asynchronous response code configuration '" + asyncSCConfig + "'.", e);
                }
   
                String payloadPath = configTree.getAttribute(ASYNC_PAYLOAD);
                if(payloadPath != null) {
                    try {
                        asyncPayload = readStaticAsyncResponse(payloadPath);
                    } catch (ConfigurationException e) {
                        throw new ServletException("Invalid Exception to HTTP Status mapping configuration.", e);
                    }
                    asyncContentType = configTree.getAttribute(ASYNC_PAYLOAD_CONTENT_TYPE);
                    asyncCharacterEncoding = configTree.getAttribute(ASYNC_PAYLOAD_CHARACTER_ENCODING);
                }
            } else {
                blockingTimeout = configTree.getLongAttribute("synchronousTimeout", 30000L);
            }
   
            String exceptionMappingsCSV = configTree.getAttribute(EXCEPTION_MAPPINGS);
            if(exceptionMappingsCSV != null) {
                try {
                    exceptionMappings = HttpGatewayMapper.decodeExceptionMappingsCSV(exceptionMappingsCSV);
                } catch (ConfigurationException e) {
                    throw new ServletException("Invalid Exception to HTTP Status mapping configuration.", e);
View Full Code Here

            return;
        }
    }

    private ConfigTree toConfigTree(ServletConfig config) {
        ConfigTree configTree = new ConfigTree("config");
        Enumeration<?> configNames = config.getInitParameterNames();

        while(configNames.hasMoreElements()) {
            String name = (String) configNames.nextElement();
            configTree.setAttribute(name, config.getInitParameter(name));
        }

        return configTree;
    }
View Full Code Here

    private final String requestLocation ;
    private final String responseLocation ;
   
    public LogMessageAction(final ConfigTree config)
    {
        final ConfigTree parent = config.getParent() ;
        requestLocation = parent.getAttribute(ListenerTagNames.REQUEST_LOCATION_TAG) ;
        responseLocation = parent.getAttribute(ListenerTagNames.RESPONSE_LOCATION_TAG) ;
    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.helpers.ConfigTree

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.