Пример #1
0
  /**
   * It loads the objects using their non singleton implementations.
   *
   * @param propFileName the name of the properties file that needs to be picked up from
   *     PEGASUS_HOME/etc directory.If it is null, then the default properties file should be picked
   *     up.
   */
  public void loadNonSingletonObjects(String propFileName) {
    // these should be invoked in non singleton
    // manner but is not.
    mLogger = LogManagerFactory.loadSingletonInstance();

    mLogMsg = new String();
    mPoolProvider = new String();
    mProps =
        PegasusProperties.getInstance(
            (propFileName == null)
                ?
                // load the default properties file
                edu.isi.pegasus.common.util.CommonProperties.PROPERTY_FILENAME
                :
                // load the file with this name from $PEGASUS_HOME/etc directory
                propFileName);

    // these should be invoked in non singleton
    // manner but is not.
    mUserOpts = UserOptions.getInstance();

    mWorkDir = mProps.getExecDirectory();
    mStorageDir = mProps.getStorageDirectory();
    mDeepStorageStructure = mProps.useDeepStorageDirectoryStructure();
  }
Пример #2
0
  /**
   * Initializes the object
   *
   * @param bag bag of pegasus objects
   */
  public void initialize(PegasusBag bag) {
    String value = System.getenv(COLLECT_METRICS_ENV_VARIABLE);
    mSendMetricsToServer = Boolean.parse(value, true);

    value = System.getenv(PRIMARY_METRICS_SERVER_URL_ENV_VARIABLE);
    if (value != null) {
      String[] urls = value.split(",");
      for (int i = 0; i < urls.length; i++) {
        mMetricsServers.add(urls[i]);
      }
    } else {
      mMetricsServers.add(METRICS_SERVER_DEFAULT_URL);
    }

    value = System.getenv(SECONDARY_METRICS_SERVER_URL_ENV_VARIABLE);
    if (value != null) {
      String[] urls = value.split(",");
      for (int i = 0; i < urls.length; i++) {
        mMetricsServers.add(urls[i]);
      }
    }

    // intialize the logger defensively
    if (bag != null) {
      mLogger = bag.getLogger();
    }
    if (mLogger == null) {
      mLogger = LogManagerFactory.loadSingletonInstance();
    }
  }
Пример #3
0
 /**
  * It loads the objects that the pool providers need in a singleton manner, wherever possible. If
  * the class in not implemented in Singleton manner, the objects would be loaded normally.
  */
 protected void loadSingletonObjects() {
   mLogger = LogManagerFactory.loadSingletonInstance();
   mLogMsg = new String();
   mPoolProvider = new String();
   mProps = PegasusProperties.getInstance();
   mUserOpts = UserOptions.getInstance();
   mWorkDir = mProps.getExecDirectory();
   mStorageDir = mProps.getStorageDirectory();
   mDeepStorageStructure = mProps.useDeepStorageDirectoryStructure();
 }
Пример #4
0
 public TransformationSelector() {
   mLogger = LogManagerFactory.loadSingletonInstance();
 }
Пример #5
0
 /**
  * An adapter method that converts the <code>SiteInfo</code> object to <code>SiteCatalogEntry
  * </code> object.
  *
  * @param s <code>SiteInfo</code> to be converted.
  * @return the converted <code>SiteCatalogEntry</code> object.
  */
 public static SiteCatalogEntry convert(SiteInfo s) {
   return SiteInfo2SiteCatalogEntry.convert(s, LogManagerFactory.loadSingletonInstance());
 }
Пример #6
0
 protected CatalogType() {
   mProfiles = new LinkedList<Profile>();
   mMetadata = new LinkedList<MetaData>();
   mPFNs = new LinkedList<PFN>();
   mLogger = LogManagerFactory.loadSingletonInstance();
 }