FabricCodePackageActivationContext Class
- java.
lang. Object - AutoCloseable
- CodePackageActivationContext
- system.
fabric. FabricCodePackageActivationContext
- system.
public class FabricCodePackageActivationContext implements CodePackageActivationContext
Represents activation context for the Service Fabric service. This is valid for fabric activated service only.
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
close()
Cleans up resources held by this object. 1) Unregisters Code, Configuration and Data change handlers. 2) Releases Code, Configuration and Data broker's native pointers. 3) Releases CodeActivationContext native pointer. |
String |
getApplicationName()
Gets the name of the application. |
String |
getApplicationTypeName()
Gets the name of the application type. |
long |
getCodeActivationContextPtr()
Getter for CodePackageActicationPointer |
Observable<Package |
getCodePackageAddedEvent()
CodePackageAddedEvent should be used to register listeners to listen to the events that are generated on adding new Code package to service manifest. |
Observable<Package |
getCodePackageModifiedEvent()
CodePackageRemovedEvent should be used to register listeners to listen to the events that are generated on modifying a Code package in the service manifest. |
String |
getCodePackageName()
Gets the name of the fabric activated code package. |
List<String> |
getCodePackageNames()
Retrieves the list of code package names in the service manifest. |
Code |
getCodePackageObject(String packageName)
Returns the CodePackage object from Service Package that matches the packageName parameter |
Observable<Package |
getCodePackageRemovedEvent()
CodePackageRemovedEvent should be used to register listeners to listen to the events that are generated on removing a Code package in the service manifest. |
String |
getCodePackageVersion()
Gets the version of the fabric activated code package |
Observable<Package |
getConfigurationPackageAddedEvent()
ConfigurationPackageAddedEvent should be used to register listeners to listen to the events that are generated on adding new Config package to service manifest. |
Observable<Package |
getConfigurationPackageModifiedEvent()
ConfigurationPackageAddedEvent should be used to register listeners to listen to the events that are generated on modifying a Config package in the service manifest. |
List<String> |
getConfigurationPackageNames()
Retrieves the list of configuration package names in the service manifest. |
Configuration |
getConfigurationPackageObject(String packageName)
Returns ConfigurationPackage object from Service Package that matches the packageName parameter |
Observable<Package |
getConfigurationPackageRemovedEvent()
ConfigurationPackageAddedEvent should be used to register listeners to listen to the events that are generated on removing a Config package in the service manifest. |
String |
getContextId()
Gets the ID that represents the service package name qualified with Application package name. |
Observable<Package |
getDataPackageAddedEvent()
DataPackageAddedEvent should be used to register listeners to listen to the events that are generated on adding new Data package to service manifest. |
Observable<Package |
getDataPackageModifiedEvent()
DataPackageAddedEvent should be used to register listeners to listen to the events that are generated on modifying a Data package in the service manifest. |
List<String> |
getDataPackageNames()
Retrieves all data packages by name. |
Data |
getDataPackageObject(String packageName)
Returns DataPackage object from Service Package that matches the packageName parameter |
Observable<Package |
getDataPackageRemovedEvent()
DataPackageAddedEvent should be used to register listeners to listen to the events that are generated on removing a Data package in the service manifest. |
Endpoint |
getEndpoint(String endpointName)
Retrieves the endpoint by name. |
LinkedHashMap<String, Endpoint |
getEndpoints()
Retrieves all the end point names in the service manifest. |
String |
getLogDirectory()
Gets the path to the log directory that the application can use. |
String |
getServiceListenAddress()
The address at which the service should start the communication listener. |
String |
getServiceManifestName()
Retrieves the name of the service manifest. |
String |
getServiceManifestVersion()
Retrieves the version of the service manifest. |
String |
getServicePublishAddress()
The address which the service should publish as the listen address. |
LinkedHashMap<String, Service |
getServiceTypes()
Retrieves the list of Service Group types in the service manifest. |
String |
getTempDirectory()
Gets the path to the Temp directory that the Application can use. |
String |
getWorkDirectory()
Gets the path to the Work directory that the Application can use. |
void |
reportApplicationHealth(HealthInformation healthInfo)
Reports health for current application. |
void |
reportDeployedApplicationHealth(HealthInformation healthInfo)
Reports health for current deployed application. |
void |
reportDeployedServicePackageHealth(HealthInformation healthInfo)
Reports health for current deployed service package. |
Method Details
close
public void close()
Cleans up resources held by this object. 1) Unregisters Code, Configuration and Data change handlers. 2) Releases Code, Configuration and Data broker's native pointers. 3) Releases CodeActivationContext native pointer.
getApplicationName
public String getApplicationName()
Gets the name of the application.
Overrides:
FabricCodePackageActivationContext.getApplicationName()Returns:
getApplicationTypeName
public String getApplicationTypeName()
Gets the name of the application type.
Overrides:
FabricCodePackageActivationContext.getApplicationTypeName()Returns:
getCodeActivationContextPtr
public long getCodeActivationContextPtr()
Getter for CodePackageActicationPointer
Returns:
getCodePackageAddedEvent
public Observable
CodePackageAddedEvent should be used to register listeners to listen to the events that are generated on adding new Code package to service manifest.
Overrides:
FabricCodePackageActivationContext.getCodePackageAddedEvent()Returns:
getCodePackageModifiedEvent
public Observable
CodePackageRemovedEvent should be used to register listeners to listen to the events that are generated on modifying a Code package in the service manifest.
Overrides:
FabricCodePackageActivationContext.getCodePackageModifiedEvent()Returns:
getCodePackageName
public String getCodePackageName()
Gets the name of the fabric activated code package.
Overrides:
FabricCodePackageActivationContext.getCodePackageName()Returns:
getCodePackageNames
public List
Retrieves the list of code package names in the service manifest.
Overrides:
FabricCodePackageActivationContext.getCodePackageNames()Returns:
getCodePackageObject
public CodePackage getCodePackageObject(String packageName)
Returns the CodePackage object from Service Package that matches the packageName parameter
Overrides:
FabricCodePackageActivationContext.getCodePackageObject(String packageName)Parameters:
Returns:
getCodePackageRemovedEvent
public Observable
CodePackageRemovedEvent should be used to register listeners to listen to the events that are generated on removing a Code package in the service manifest.
Overrides:
FabricCodePackageActivationContext.getCodePackageRemovedEvent()Returns:
getCodePackageVersion
public String getCodePackageVersion()
Gets the version of the fabric activated code package
Overrides:
FabricCodePackageActivationContext.getCodePackageVersion()Returns:
getConfigurationPackageAddedEvent
public Observable
ConfigurationPackageAddedEvent should be used to register listeners to listen to the events that are generated on adding new Config package to service manifest.
Overrides:
FabricCodePackageActivationContext.getConfigurationPackageAddedEvent()Returns:
getConfigurationPackageModifiedEvent
public Observable
ConfigurationPackageAddedEvent should be used to register listeners to listen to the events that are generated on modifying a Config package in the service manifest.
Overrides:
FabricCodePackageActivationContext.getConfigurationPackageModifiedEvent()Returns:
getConfigurationPackageNames
public List
Retrieves the list of configuration package names in the service manifest.
Overrides:
FabricCodePackageActivationContext.getConfigurationPackageNames()Returns:
getConfigurationPackageObject
public ConfigurationPackage getConfigurationPackageObject(String packageName)
Returns ConfigurationPackage object from Service Package that matches the packageName parameter
Overrides:
FabricCodePackageActivationContext.getConfigurationPackageObject(String packageName)Parameters:
Returns:
getConfigurationPackageRemovedEvent
public Observable
ConfigurationPackageAddedEvent should be used to register listeners to listen to the events that are generated on removing a Config package in the service manifest.
Overrides:
FabricCodePackageActivationContext.getConfigurationPackageRemovedEvent()Returns:
getContextId
public String getContextId()
Gets the ID that represents the service package name qualified with Application package name.
Overrides:
FabricCodePackageActivationContext.getContextId()Returns:
getDataPackageAddedEvent
public Observable
DataPackageAddedEvent should be used to register listeners to listen to the events that are generated on adding new Data package to service manifest.
Overrides:
FabricCodePackageActivationContext.getDataPackageAddedEvent()Returns:
getDataPackageModifiedEvent
public Observable
DataPackageAddedEvent should be used to register listeners to listen to the events that are generated on modifying a Data package in the service manifest.
Overrides:
FabricCodePackageActivationContext.getDataPackageModifiedEvent()Returns:
getDataPackageNames
public List
Retrieves all data packages by name.
Overrides:
FabricCodePackageActivationContext.getDataPackageNames()Returns:
getDataPackageObject
public DataPackage getDataPackageObject(String packageName)
Returns DataPackage object from Service Package that matches the packageName parameter
Overrides:
FabricCodePackageActivationContext.getDataPackageObject(String packageName)Parameters:
Returns:
getDataPackageRemovedEvent
public Observable
DataPackageAddedEvent should be used to register listeners to listen to the events that are generated on removing a Data package in the service manifest.
Overrides:
FabricCodePackageActivationContext.getDataPackageRemovedEvent()Returns:
getEndpoint
public EndpointResourceDescription getEndpoint(String endpointName)
Retrieves the endpoint by name.
Overrides:
FabricCodePackageActivationContext.getEndpoint(String endpointName)Parameters:
Returns:
getEndpoints
public LinkedHashMap
Retrieves all the end point names in the service manifest.
Overrides:
FabricCodePackageActivationContext.getEndpoints()Returns:
getLogDirectory
public String getLogDirectory()
Gets the path to the log directory that the application can use.
Overrides:
FabricCodePackageActivationContext.getLogDirectory()Returns:
getServiceListenAddress
public String getServiceListenAddress()
The address at which the service should start the communication listener.
Overrides:
FabricCodePackageActivationContext.getServiceListenAddress()Returns:
getServiceManifestName
public String getServiceManifestName()
Retrieves the name of the service manifest.
Overrides:
FabricCodePackageActivationContext.getServiceManifestName()Returns:
getServiceManifestVersion
public String getServiceManifestVersion()
Retrieves the version of the service manifest.
Overrides:
FabricCodePackageActivationContext.getServiceManifestVersion()Returns:
getServicePublishAddress
public String getServicePublishAddress()
The address which the service should publish as the listen address.
Overrides:
FabricCodePackageActivationContext.getServicePublishAddress()Returns:
getServiceTypes
public LinkedHashMap
Retrieves the list of Service Group types in the service manifest.
Overrides:
FabricCodePackageActivationContext.getServiceTypes()Returns:
getTempDirectory
public String getTempDirectory()
Gets the path to the Temp directory that the Application can use.
Overrides:
FabricCodePackageActivationContext.getTempDirectory()Returns:
getWorkDirectory
public String getWorkDirectory()
Gets the path to the Work directory that the Application can use.
Overrides:
FabricCodePackageActivationContext.getWorkDirectory()Returns:
reportApplicationHealth
public void reportApplicationHealth(HealthInformation healthInfo)
Reports health for current application.
Overrides:
FabricCodePackageActivationContext.reportApplicationHealth(HealthInformation healthInfo)Parameters:
reportDeployedApplicationHealth
public void reportDeployedApplicationHealth(HealthInformation healthInfo)
Reports health for current deployed application.
Overrides:
FabricCodePackageActivationContext.reportDeployedApplicationHealth(HealthInformation healthInfo)Parameters:
reportDeployedServicePackageHealth
public void reportDeployedServicePackageHealth(HealthInformation healthInfo)
Reports health for current deployed service package.
Overrides:
FabricCodePackageActivationContext.reportDeployedServicePackageHealth(HealthInformation healthInfo)Parameters: