com.sap.cds.feature.cloudfoundry.CloudFoundryApplicationInfoProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cds-feature-cloudfoundry Show documentation
Show all versions of cds-feature-cloudfoundry Show documentation
Cloud Foundry feature for CDS Services Java
/**************************************************************************
* (C) 2019-2024 SAP SE or an SAP affiliate company. All rights reserved. *
**************************************************************************/
package com.sap.cds.feature.cloudfoundry;
import com.sap.cds.services.environment.ApplicationInfo;
import com.sap.cds.services.environment.ApplicationInfoProvider;
import com.sap.cds.services.utils.environment.VcapApplicationParser;
/**
* Provides {@link ApplicationInfo} based on CloudFoundry's VCAP_APPLICATION
*/
public class CloudFoundryApplicationInfoProvider implements ApplicationInfoProvider {
private ApplicationInfo applicationInfo;
@Override
public ApplicationInfo get() {
if(applicationInfo == null) {
applicationInfo = VcapApplicationParser.getApplicationInfo(System.getenv(VcapApplicationParser.VCAP_APPLICATION));
}
return applicationInfo;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy