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

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


   * only be generated via the method <code>getInstance()</code>. Each
   * instance is put in a <code>Hashtable</code> with the name of the thread
   * as the key.
   */
  private MQConnection() throws XException {
    Configuration config = Configuration.getInstance();
    mQueueSuffix = config.getValueOptional("Connection", "MQ",
        "QueueSuffix");
    if (mQueueSuffix == null) {
      mQueueSuffix = "";
    }

View Full Code Here


  public void open() throws XException {
    if (!mIsOpen) {
      jndiContext = null;

      if (mQueueConnectionFactory == null) {
        Configuration config = Configuration.getInstance();
        mQueueConnectionFactory = (QueueConnectionFactory) jndiLookup(config
            .getValue("Connection", "MQ", "QueueConnectionFactory"));
      }

      try {
        mConnection = mQueueConnectionFactory.createQueueConnection();
View Full Code Here

   *            the name of the sender/receiver
   *
   * @return the name of the message queue
   */
  public String getPhysQueuename(XBUSSystem system) throws XException {
    Configuration config = Configuration.getInstance();
    String physQueuename = config.getValue(Constants.CHAPTER_SYSTEM, system
        .getName(), "Queuename");

    physQueuename = system.replaceAllMarkers(physQueuename)[0];
    return new StringBuffer(physQueuename).append(mQueueSuffix).toString();
  }
View Full Code Here

   */
  public FileTrace()
  {
    try
    {
      Configuration config = Configuration.getInstance();
      String filename = config.getValue("Base", "Trace", "Filename");

      mFilename = Constants.XBUS_HOME + Constants.FILE_SEPERATOR + "log"
          + Constants.FILE_SEPERATOR + filename;
    }
    catch (Exception e)
View Full Code Here

        break;
      default :
        priorityname = "NA    ";
    }

    Configuration config = Configuration.getInstance();
    int maxLength = config.getValueAsInt("Base", "Trace", "MaxLength");

    if ((maxLength >= 0) && (message.length() > maxLength))
    {
      message = message.substring(0, maxLength);
    }
View Full Code Here

  public static void initialize()
  {
    try
    {
      Integer traceLevel;
      Configuration config = Configuration.getInstance();
      traceLevel = new Integer(config.getValue("Base", "Trace", "Level"));
      mTracelevel = traceLevel.intValue();

      String tracerShort = config.getValue("Base", "Trace", "Tracer");
      String tracerName = Configuration.getClass("Trace", tracerShort);

      mTarget = (TraceTarget) Class.forName(tracerName).newInstance();
      System.out.println("Tracing with " + tracerName);
    }
View Full Code Here

public class ByteArrayConverterFactory
{
  static public ByteArrayConverter getConverter(String system)
      throws XException
  {
    Configuration config = Configuration.getInstance();
    String as400name = config.getValueOptional(Constants.CHAPTER_SYSTEM,
        system, "AS400");

    if (as400name != null)
    {
      return new ByteArrayConverterAS400(system);
View Full Code Here

public class TraceFileRenamer
{

  public static void main(String[] args)
  {
    Configuration config;
    // to get the path of the trace file and the "critical" file size
    try
    {
      config = Configuration.getInstance();
      String fileName = config.getValueOptional("Base", "Trace",
          "Filename");
      // trace file name
      if (fileName != null)
      { // file name given
        long maxFileSize = config.getValueAsLongOptional("Base",
            "Trace", "MaxFileSize");
        // maximal size
        if (maxFileSize > 0)
        { // maximal size specified
          String filePath = Constants.XBUS_HOME
View Full Code Here

      mFTPClient = new FTPClient();

      /*
       * Connect to the FTP Server
       */
      Configuration config = Configuration.getInstance();
      mHost = config.getValue(CHAPTER_FTPCONNECTION, mName, "Host");
      mPort = config.getValueAsIntOptional(CHAPTER_FTPCONNECTION, mName,
          "Port");

      try
      {
        if (mPort > 0)
        {
          mFTPClient.connect(mHost, mPort);
        }
        else
        {
          mFTPClient.connect(mHost);
        }

        int reply = getReplyCode();

        if (!FTPReply.isPositiveCompletion(reply))
        {
          close();
          Vector params = new Vector(2);
          params.add(mHost);
          params.add(getReplyString());
          throw new XException(Constants.LOCATION_EXTERN,
              Constants.LAYER_TECHNICAL,
              Constants.PACKAGE_TECHNICAL_FTP, "1", params);
        }

        mOpen = true;

        /*
         * Login to the FTP server
         */
        String user = config.getValue(CHAPTER_FTPCONNECTION, mName,
            "User");
        String password = config.getValueOptional(
            CHAPTER_FTPCONNECTION, mName, "Password");
        String account = config.getValueOptional(CHAPTER_FTPCONNECTION,
            mName, "Account");

        boolean successful = false;
        if (account == null)
        {
          successful = mFTPClient.login(user, password);
        }
        else
        {
          successful = mFTPClient.login(user, password, account);
        }

        if (!successful)
        {
          close();
          Vector params = new Vector(3);
          params.add(mHost);
          params.add(user);
          if (account == null)
          {
            throw new XException(Constants.LOCATION_EXTERN,
                Constants.LAYER_TECHNICAL,
                Constants.PACKAGE_TECHNICAL_FTP, "2", params);

          }
          else
          {
            params.add(user);
            throw new XException(Constants.LOCATION_EXTERN,
                Constants.LAYER_TECHNICAL,
                Constants.PACKAGE_TECHNICAL_FTP, "3", params);
          }

        }

        /*
         * Set the file type
         */
        int fileTypeInt = 0;
        String fileTypeString = config.getValueOptional(
            CHAPTER_FTPCONNECTION, mName, "FileType");
        if (fileTypeString == null)
        {
          fileTypeString = "ASCII";
        }
View Full Code Here

   */
  public String getSystems()
  {
    try
    {
      Configuration config = Configuration.getInstance();
      List targets = config.getSections("System");
      StringBuffer buf = new StringBuffer(
          "<option selected>--------------------");
      for (Iterator it = targets.iterator(); it.hasNext();)
      {
        buf.append("<option>");
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.