Package net.sf.xbus.base.core.config

Examples of net.sf.xbus.base.core.config.Configuration


   * @return name ot the program to be called
   * @throws XException if something goes wrong
   */
  private String getProgramName() throws XException
  {
    Configuration config = Configuration.getInstance();

    String programName = config.getValue(Constants.CHAPTER_SYSTEM,
        mDestination.getName(), "ProgramName");
    programName = mDestination.replaceAllMarkers(programName)[0];

    return programName;
  }
View Full Code Here


   */
  private List getParameters() throws XException
  {
    Vector parameters = new Vector();

    Configuration config = Configuration.getInstance();

    String parameter = config.getValueOptional(Constants.CHAPTER_SYSTEM,
        mDestination.getName(), "Parameter1");
    int i = 1;
    while (parameter != null)
    {
      i++;
      parameter = mDestination.replaceAllMarkers(parameter)[0];
      parameters.add(parameter);
      parameter = config.getValueOptional(Constants.CHAPTER_SYSTEM,
          mDestination.getName(), "Parameter" + i);
    }
    return parameters;
  }
View Full Code Here

   */
  private List getProcessInputs() throws XException
  {
    Vector processInputs = new Vector();

    Configuration config = Configuration.getInstance();

    String processInput = config.getValueOptional(Constants.CHAPTER_SYSTEM,
        mDestination.getName(), "ProcessInput1");
    int i = 1;
    while (processInput != null)
    {
      i++;
      String[] pInput = mDestination.replaceAllMarkers(processInput);
      // Array for broadcast
      for (int j = 0; j < pInput.length; j++)
        processInputs.add(pInput[j]);
      processInput = config.getValueOptional(Constants.CHAPTER_SYSTEM,
          mDestination.getName(), "ProcessInput" + i);
    }
    return processInputs;
  }
View Full Code Here

   * @exception XException - If any error occurs
   */
  public AS400FileSender(XBUSSystem system) throws XException
  {

    Configuration config = Configuration.getInstance();
    String as400name = config.getValue(Constants.CHAPTER_SYSTEM, system
        .getName(), "AS400");

    // create an AS400 object for the server that holds the files
    // and connection to the iSeries
    AS400Connection connection = AS400Connection.getInstance(as400name);
View Full Code Here

   */
  private void readConfiguration(XBUSSystem system) throws XException
  {
    try
    {
      Configuration config = Configuration.getInstance();
      mResolution = getResolution(config, system.getName());
      mEncoding = getEncoding(mAS400System, system.getName());
      String filename = config.getValue(Constants.CHAPTER_SYSTEM, system
          .getName(), Constants.KEY_FILENAME);
      filename = system.replaceAllMarkers(filename)[0];
      mQSYSobjPathname = new QSYSObjectPathName(filename);
    }
    catch (Exception ex)
View Full Code Here

   */
  public String execute(String function, String callData) throws XException
  {
    String retString = null;

    Configuration config = Configuration.getInstance();
    int timeout = config.getValueAsIntOptional(Constants.CHAPTER_SYSTEM,
        mDestination.getName(), "Timeout") * 1000;
    if (timeout == 0)
    {
      timeout = Integer.MAX_VALUE;
    }
View Full Code Here

   */
  public Object transform(Object inObject, XBUSSystem source,
      XBUSSystem destination, Message destinationMessage)
      throws XException
  {
    Configuration config = Configuration.getInstance();

    // After restructuring the xBus transformation calls, the old
    // configuration
    // key "XslRequestFromRequest" was no longer meaningful because the
    // source
    // and destination systems determine, which style sheet should be used.
    // The differentiation between transformation from reponse or from
    // request is
    // done in net.sf.xbus.application.Router.distributeInternal when
    // looking
    // at the incoming response.
    // The new configuration key is "XSLTStylesheet";
    // The old configuration key "XslRequestFromRequest" still works for
    // upgrade compatibility.
    String xslFile = config.getValueOptional("XslRequestFromRequest",
        source.getName(), destination.getName());
    if (xslFile == null)
    {
      xslFile = config.getValue("XSLTStylesheet", source.getName(),
          destination.getName());
    }
    xslFile = new StringBuffer(XSL_LOCATION).append(xslFile).toString();

    return transformXML((Document) inObject, xslFile, destinationMessage);
View Full Code Here

   * subclass of <code>XMLMessage</code>.
   */
  protected XMLMessageAbstract createMessage(XBUSSystem destination,
      XMLMessageAbstract source) throws XException
  {
    Configuration config = Configuration.getInstance();
    String newMessageClassShortname = config.getValue(
        Constants.CHAPTER_SYSTEM, destination.getName(), "Message");
    String newMessageClass = Configuration.getClass("Message",
        newMessageClassShortname);

    Class[] conArgsClass = new Class[]
View Full Code Here

  /**
   * Starts all configured threads to process message for different systems.
   */
  public synchronized void startAllSystems() throws XException {
    Configuration config = Configuration.getInstance();

    PreProcessor.process(PreProcessor.RECEIVER_SERVICE);

    List sections = config.getSections(Constants.CHAPTER_SYSTEM);
    String system = null;
    String receiver = null;
    for (Iterator it = sections.iterator(); it.hasNext();) {
      system = (String) it.next();
      receiver = config.getValueOptional(Constants.CHAPTER_SYSTEM,
          system, "Receiver");
      if ((receiver != null) && (receiver.endsWith("Thread"))) {
        ReceiverThreadManager.getInstance().startReceiverThread(system);
      }
    }
View Full Code Here

  {
    try
    {
      Vector postProcessors = new Vector();

      Configuration config = Configuration.getInstance();

      String destination = config.getValueOptional(
          Constants.CHAPTER_SYSTEM, source.getName(),
          "PostProcessor.System");

      if (destination != null)
      {
        String configModus = config.getValueOptional(
            Constants.CHAPTER_SYSTEM, source.getName(),
            "PostProcessor.Modus");
        if (configModus == null)
        {
          configModus = Constants.POSTPROCESSING_PERSYSTEM;
        } // if (configModus == null)
        if (configModus.equals(modus))
        {
          Object[] postProcessor =
          {
              destination,
              Boolean.valueOf(config.getValueAsBoolean(
                  Constants.CHAPTER_SYSTEM, source.getName(),
                  "PostProcessor.Asynchronous"))};
          postProcessors.add(postProcessor);
        } // if (configModus.equals(modus))
      } // if (destination != null) - a single postprocessor
      else
      { // Perhaps several postprocessors
        destination = config.getValueOptional(Constants.CHAPTER_SYSTEM,
            source.getName(), "PostProcessor1.System");
        for (int i = 1; destination != null; i++)
        { // Loop over postprocessors
          String configModus = config.getValueOptional(
              Constants.CHAPTER_SYSTEM, source.getName(),
              "PostProcessor" + i + ".Modus");
          if (configModus == null)
          {
            configModus = Constants.POSTPROCESSING_PERSYSTEM;
          } // if (configModus == null)
          if (configModus.equals(modus))
          {
            Object[] postProcessor =
            {
                destination,
                Boolean.valueOf(config.getValueAsBoolean(
                    Constants.CHAPTER_SYSTEM, source
                        .getName(), "PostProcessor" + i
                        + ".Asynchronous"))};
            postProcessors.add(postProcessor);
          } // if (configModus.equals(modus))
          destination = config.getValueOptional(
              Constants.CHAPTER_SYSTEM, source.getName(),
              "PostProcessor" + (i + 1) + ".System");
        } // for (int i=1; destination!=null; i++)
      } // else (destination != null)

      for (int i = 0; i < postProcessors.size(); i++)
      {
        destination = (String) ((Object[]) postProcessors.get(i))[0];
        PostProcessor postProc = new PostProcessor(new XBUSSystem(
            destination, source.getAddresses(), config
                .getValueAsBooleanOptional("System",
                    destination, "Broadcast")), callData);
        if (((Boolean) ((Object[]) postProcessors.get(i))[1])
            .booleanValue())
        {
View Full Code Here

TOP

Related Classes of net.sf.xbus.base.core.config.Configuration

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.