Package org.jboss.soa.esb.helpers

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


  /**
   * Gets the list of attributes.    We return all Lifecycle attributes from the ConfigTree,
   * and the start time, configtree XML, and the lifecycle state.
   */
  public AttributeList getAttributes(String[] arg0) {
    final ConfigTree config = m_lifecycle.getConfig() ;
    AttributeList attributeList = new AttributeList();
    Set<String> set = config.getAttributeNames();   
    String[] attribs = (String[])set.toArray(new String[set.size()]);
    for (int i = 0; i < attribs.length; i++) {
      Attribute at = new Attribute(attribs[i], config.getAttribute(attribs[i]));
      attributeList.add(at);
    }
   
    // Add lifecycle state to the list of properties
    Attribute lifecycleState = new Attribute(LIFECYCLESTATE_ATTRIB, m_lifecycle.getState().toString());
View Full Code Here


 
  protected ObjectName getObjectName()
  {
    ObjectName listObjectName = null;
    try {
      final ConfigTree config = m_lifecycle.getConfig() ;
      String categoryName = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
      String serviceName = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
      String targetCategoryName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
      String targetServiceName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
      String listenerName = config.getAttribute(ListenerTagNames.NAME_TAG);
      final LifecycleResourceManager lifecycleResourceManager = LifecycleResourceManager.getSingleton() ;
      final String[] associatedDeployments = lifecycleResourceManager.getAssociatedDeployments() ;
      final String deployment ;
      if ((associatedDeployments != null) && (associatedDeployments.length == 1))
      {
        deployment = associatedDeployments[0] ;
      }
      else
      {
        deployment = lifecycleResourceManager.getIdentity() ;
      }

      StringBuffer objectName = new StringBuffer();
      append(objectName, "deployment", deployment) ;
      append(objectName, ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, categoryName) ;
      append(objectName, ListenerTagNames.SERVICE_NAME_TAG, serviceName);
      append(objectName, ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, targetCategoryName);
      append(objectName, ListenerTagNames.TARGET_SERVICE_NAME_TAG, targetServiceName);
     
      if ("true".equals(config.getAttribute(ListenerTagNames.IS_GATEWAY_TAG))) {
        append(objectName, "gateway-name", listenerName) ;
      } else {
        append(objectName, "listener-name", listenerName) ;
      }
     
View Full Code Here

          "Missing or invalid " + ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
    if (Util.isNullString(_eprName))
      throw new ConfigurationException(
          "Missing or invalid " + ListenerTagNames.SERVICE_NAME_TAG);

    ConfigTree eprElement = _config.getFirstChild(ListenerTagNames.EPR_TAG);
    if (null == eprElement)
      throw new ConfigurationException(
          "Missing or invalid " + ListenerTagNames.EPR_TAG + " element");
    _epr = ListenerUtil.assembleEpr(eprElement);
View Full Code Here

      ConfigTree[] oaP = p_oParent.getChildren(NotificationList.ELEMENT);
      for (int i1 = 0; i1 < oaP.length; i1++)
      {
        NotificationList oCurr = new NotificationList(oaP[i1]);
        if (!oCurr.isOK()) continue;
        ConfigTree oCpy = oaP[i1].cloneObj();
        MacroExpander.replaceMacros(oCpy, p_oCtx);
        p_oNH.sendNotifications(oCpy, p_o);
      }
    }
    catch (Exception e)
View Full Code Here

        setMappedHttpHeaders(method, message);
       
        //The setting of HTTP headers from config still takes precedence. So do not set
        //a HTTP header in config if you want to keep the value sent from the client.
        for (int i = 0; i < requestHeaders.length; i++) {
            ConfigTree header = requestHeaders[i];
            String name = header.getAttribute("name");
            String value = header.getAttribute("value");

            if(name != null && value != null) {
                method.setRequestHeader(name, value);
            } else {
                logger.error("null Http request header name/value: '" + name + "':'" + value + "'.");
View Full Code Here

  private boolean deleteListFile;

  public NotifyFTPList(ConfigTree config) throws NotificationException
  {
    super( config );
    ConfigTree ftpConfig = getFtpConfig();
    listFiles = ftpConfig.getBooleanAttribute( "listFiles", false );
    deleteListFile = ftpConfig.getBooleanAttribute( "deleteListFile", false );
  }
View Full Code Here

  private void extractHttpClientProps(ConfigTree config) {
        ConfigTree[] httpClientConfigTrees = config.getChildren(HttpClientFactory.HTTP_CLIENT_PROPERTY);

        httpClientProps.setProperty(HttpClientFactory.TARGET_HOST_URL, endpointUrl.toString());
        final ConfigTree parent = config.getParent();
        if (parent != null) {
            final String maxThreads = parent.getAttribute(ListenerTagNames.MAX_THREADS_TAG);
            if (maxThreads != null) {
                httpClientProps.setProperty(Connection.MAX_TOTAL_CONNECTIONS, maxThreads);
                httpClientProps.setProperty(Connection.MAX_CONNECTIONS_PER_HOST, maxThreads);
            }
        }
View Full Code Here

    public java.util.Properties getHttpClientProps() {
      return httpClientProps;
    }

    public static void main(String[] args) throws ConfigurationException, ActionProcessingException {
        ConfigTree configTree = new ConfigTree("config");

        for(String arg : args) {
            int equalsIdx = arg.indexOf('=');

            if(equalsIdx == -1) {
                throw new IllegalArgumentException("Arguments must be in 'name=value' format.");
            }

            String name = arg.substring(0, equalsIdx);
            String value = arg.substring(equalsIdx + 1);
            if(!coreProperties.contains(name) && !name.equals("payload")) {
                ConfigTree httpClientProperty = new ConfigTree(HttpClientFactory.HTTP_CLIENT_PROPERTY, configTree);
                httpClientProperty.setAttribute("name", name);
                httpClientProperty.setAttribute("value", value);
            } else {
                configTree.setAttribute(name, value);
            }
        }
View Full Code Here

    ConfigTree[] actionList = configTree.getChildren(ListenerTagNames.ACTION_ELEMENT_TAG);
    final int numActions = actionList.length ;
    actionNames = new String[numActions] ;
   
    for (int count = 0 ; count < numActions ; count++) {
      final ConfigTree actionConfig = actionList[count] ;
      String actionId = getActionId(actionConfig);
      actionCounterHash.put(actionId + " " + MESSAGE_COUNTER, new IntHolder());
      actionFailedCounterHash.put(actionId + " " + FAILED_MESSAGE_COUNTER, new IntHolder());
      actionProcessTimeHash.put(actionId + " " + PROCESSING_TIME, new LongHolder());
      actionBytesFailedHash.put(actionId + " " + BYTES_FAILED, new LongHolder());
      actionBytesProcessedHash.put(actionId + " " + BYTES_PROCESSED, new LongHolder());
      if (actionConfig.getAttribute(ListenerTagNames.ACTION_ALERT_LENGTH_TAG) != null) {
        actionLengthThresholdHash.put(actionId, new Long(actionConfig.getAttribute(ListenerTagNames.ACTION_ALERT_LENGTH_TAG)));
      }
      if (actionConfig.getAttribute(ListenerTagNames.ACTION_ALERT_TIME_TAG) != null) {
        actionTimeThresholdHash.put(actionId, new Long(actionConfig.getAttribute(ListenerTagNames.ACTION_ALERT_TIME_TAG)));
      }
      actionNames[count] = actionId ;
    }
    serviceCount = Integer.valueOf(0);
    bytesProcessed = Long.valueOf(0);
View Full Code Here

public class PackageHibernateMessageContents {

    private MessagePayloadProxy payloadProxy;

    public PackageHibernateMessageContents() {
        this.payloadProxy = createPayloadProxy(new ConfigTree("default-config"));
    }
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.