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

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


  {
    if (!mIsOpen)
    {
      try
      {
        Configuration config = Configuration.getInstance();
        String user = config.getValueOptional(mConfigChapter,
            mConfigSection, "User");
        if (user != null)
        {
          String password = config.getValue(mConfigChapter,
              mConfigSection, "Password");
          mConnection = DriverManager.getConnection(
              mDBUrl.toString(), user, password);
        }
        else
        {
          mConnection = DriverManager
              .getConnection(mDBUrl.toString());
        }

        mConnection.setAutoCommit(config.getValueAsBoolean(
            mConfigChapter, mConfigSection, "AutoCommit"));
      }
      catch (SQLException e)
      {
        throw new XException(Constants.LOCATION_EXTERN,
View Full Code Here


   * @return set of read rows
   * @throws XException if something goes wrong
   */
  public ResultSet executeRead(String statement) throws XException
  {
    Configuration config = Configuration.getInstance();
    Statement stmt = null;

    try
    {
      stmt = mConnection.createStatement();

      int maxRows = config.getValueAsInt(mConfigChapter, mConfigSection,
          "MaxRows");
      if (maxRows >= 0)
      {
        stmt.setMaxRows(maxRows);
      }
View Full Code Here

        .getName()));

    /*
     * Getting an instance of the NamedDBConnection
     */
    Configuration config = Configuration.getInstance();
    String connectionName = config.getValue(Constants.CHAPTER_SYSTEM,
        mDestination.getName(), "DBConnection");
    DBConnection connection = DBConnection.getInstance(connectionName);

    /*
     * Execute the given SQL statements
View Full Code Here

   *            name
   * @throws XException if something goes wrong
   */
  private AS400Connection(String name) throws XException
  {
    Configuration config = Configuration.getInstance();
    String systemName = config.getValue(AS400CONNECTION, name, SYSTEMNAME);
    String user = config.getValue(AS400CONNECTION, name, USER);
    String password = config.getValue(AS400CONNECTION, name, PASSWORD);

    mIsTestSystem = TEST_SYSTEM.equals(systemName);

    if (!mIsTestSystem)
    {
View Full Code Here

   *
   * @throws XException if something goes wrong
   */
  public FileSenderConfiguration(XBUSSystem xbusSystem) throws XException
  {
    Configuration config = Configuration.getInstance();
    mResolution = retrieveResolution(xbusSystem.getName());
    mEncoding = retrieveEncoding(xbusSystem.getName());
    String filenameString = config.getValue(Constants.CHAPTER_SYSTEM,
        xbusSystem.getName(), Constants.KEY_FILENAME);
    if (xbusSystem.getBroadcast())
      xbusSystem.getBroadcastData(filenameString);
    mFilenames = xbusSystem.replaceAllMarkers(filenameString);
  }
View Full Code Here

   * @param system name of the interface definition
   * @throws XException if something goes wrong
   */
  protected void readConfiguration(String system) throws XException
  {
    Configuration config = Configuration.getInstance();
    mResolution = getResolution(system);
    mOnError = getOnError(system);

    mHost = config.getValue(Constants.CHAPTER_SYSTEM, system, "Host");
    mUser = config.getValue(Constants.CHAPTER_SYSTEM, system, "User");
    mPassword = config.getValue(Constants.CHAPTER_SYSTEM, system,
        "Password");
  }
View Full Code Here

   * @return exist resolution (Preserve, Rename or Delete) as String
   * @exception XException if resolution is falsh or any errors occurs
   */
  private String getResolution(String system) throws XException
  {
    Configuration config = Configuration.getInstance();
    String resolution = config.getValue(Constants.CHAPTER_SYSTEM, system,
        Constants.KEY_RECEIVE_RESOL);
    if (!resolution.equals(Constants.READ_PRESERVE)
        && !resolution.equals(Constants.READ_DELETE))
    {
      List params = new Vector();
View Full Code Here

   * @return exist resolution (Preserve, Rename or Delete) as String
   * @exception XException if resolution is falsh or any errors occurs
   */
  private String getOnError(String system) throws XException
  {
    Configuration config = Configuration.getInstance();
    String onError = config.getValue(Constants.CHAPTER_SYSTEM, system,
        "OnError");
    if (!onError.equals(Constants.READ_PRESERVE)
        && !onError.equals(Constants.READ_DELETE))
    {
      List params = new Vector();
View Full Code Here

   *                configurationnor by accesing the AS400
   */
  static public String getEncoding(AS400 as400System, String system)
      throws XException
  {
    Configuration config = Configuration.getInstance();
    String configEncoding = null;
    configEncoding = config.getValueOptional(Constants.CHAPTER_SYSTEM,
        system, Constants.KEY_ENCODING);

    if (configEncoding == null)
    {
      try
View Full Code Here

   * @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;
  } // getProgramName()
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.