FabricCodePackageActivationContext Class

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<PackageAddedEventArgs<CodePackage>> 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<PackageModifiedEventArgs<CodePackage>> 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.

CodePackage getCodePackageObject(String packageName)

Returns the CodePackage object from Service Package that matches the packageName parameter

Observable<PackageRemovedEventArgs<CodePackage>> 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<PackageAddedEventArgs<ConfigurationPackage>> 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<PackageModifiedEventArgs<ConfigurationPackage>> 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.

ConfigurationPackage getConfigurationPackageObject(String packageName)

Returns ConfigurationPackage object from Service Package that matches the packageName parameter

Observable<PackageRemovedEventArgs<ConfigurationPackage>> 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<PackageAddedEventArgs<DataPackage>> 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<PackageModifiedEventArgs<DataPackage>> 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.

DataPackage getDataPackageObject(String packageName)

Returns DataPackage object from Service Package that matches the packageName parameter

Observable<PackageRemovedEventArgs<DataPackage>> 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.

EndpointResourceDescription getEndpoint(String endpointName)

Retrieves the endpoint by name.

LinkedHashMap<String, EndpointResourceDescription> 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, ServiceTypeDescription> 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:

The name of the application.

getApplicationTypeName

public String getApplicationTypeName()

Gets the name of the application type.

Overrides:

FabricCodePackageActivationContext.getApplicationTypeName()

Returns:

The name of the application type.

getCodeActivationContextPtr

public long getCodeActivationContextPtr()

Getter for CodePackageActicationPointer

Returns:

CodePackageActicationPointer

getCodePackageAddedEvent

public Observable> getCodePackageAddedEvent()

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:

Getter for the CodePackageAddedEvent Observable<T>.

getCodePackageModifiedEvent

public Observable> 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.

Overrides:

FabricCodePackageActivationContext.getCodePackageModifiedEvent()

Returns:

Getter for the CodePackageRemovedEvent Observable<T>.

getCodePackageName

public String getCodePackageName()

Gets the name of the fabric activated code package.

Overrides:

FabricCodePackageActivationContext.getCodePackageName()

Returns:

The name of the fabric activated code package.

getCodePackageNames

public List getCodePackageNames()

Retrieves the list of code package names in the service manifest.

Overrides:

FabricCodePackageActivationContext.getCodePackageNames()

Returns:

The list of code package names in the service manifest.

getCodePackageObject

public CodePackage getCodePackageObject(String packageName)

Returns the CodePackage object from Service Package that matches the packageName parameter

Overrides:

FabricCodePackageActivationContext.getCodePackageObject(String packageName)

Parameters:

packageName - Name of the CodePackage

Returns:

returns CodePackage

getCodePackageRemovedEvent

public Observable> 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.

Overrides:

FabricCodePackageActivationContext.getCodePackageRemovedEvent()

Returns:

Getter for the CodePackageRemovedEvent Observable<T>.

getCodePackageVersion

public String getCodePackageVersion()

Gets the version of the fabric activated code package

Overrides:

FabricCodePackageActivationContext.getCodePackageVersion()

Returns:

The version of the fabric activated code package.

getConfigurationPackageAddedEvent

public Observable> getConfigurationPackageAddedEvent()

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:

Getter for the ConfigurationPackageAddedEvent Observable<T>.

getConfigurationPackageModifiedEvent

public Observable> 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.

Overrides:

FabricCodePackageActivationContext.getConfigurationPackageModifiedEvent()

Returns:

Getter for the ConfigurationPackageAddedEvent Observable<T>.

getConfigurationPackageNames

public List getConfigurationPackageNames()

Retrieves the list of configuration package names in the service manifest.

Overrides:

FabricCodePackageActivationContext.getConfigurationPackageNames()

Returns:

The list of configuration package names in the service manifest.

getConfigurationPackageObject

public ConfigurationPackage getConfigurationPackageObject(String packageName)

Returns ConfigurationPackage object from Service Package that matches the packageName parameter

Overrides:

FabricCodePackageActivationContext.getConfigurationPackageObject(String packageName)

Parameters:

packageName - Name of the ConfigurationPackage

Returns:

getConfigurationPackageRemovedEvent

public Observable> 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.

Overrides:

FabricCodePackageActivationContext.getConfigurationPackageRemovedEvent()

Returns:

Getter for the ConfigurationPackageAddedEvent Observable<T>.

getContextId

public String getContextId()

Gets the ID that represents the service package name qualified with Application package name.

Overrides:

FabricCodePackageActivationContext.getContextId()

Returns:

The context ID.

getDataPackageAddedEvent

public Observable> getDataPackageAddedEvent()

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:

Getter for the DataPackageAddedEvent Observable<T>.

getDataPackageModifiedEvent

public Observable> 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.

Overrides:

FabricCodePackageActivationContext.getDataPackageModifiedEvent()

Returns:

Getter for the DataPackageAddedEvent Observable<T>.

getDataPackageNames

public List getDataPackageNames()

Retrieves all data packages by name.

Overrides:

FabricCodePackageActivationContext.getDataPackageNames()

Returns:

A list of data packages.

getDataPackageObject

public DataPackage getDataPackageObject(String packageName)

Returns DataPackage object from Service Package that matches the packageName parameter

Overrides:

FabricCodePackageActivationContext.getDataPackageObject(String packageName)

Parameters:

packageName - Name of the DataPackage

Returns:

Returns DataPackage object from Service Package that matches the packageName parameter.

getDataPackageRemovedEvent

public Observable> 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.

Overrides:

FabricCodePackageActivationContext.getDataPackageRemovedEvent()

Returns:

Getter for the DataPackageAddedEvent Observable<T>.

getEndpoint

public EndpointResourceDescription getEndpoint(String endpointName)

Retrieves the endpoint by name.

Overrides:

FabricCodePackageActivationContext.getEndpoint(String endpointName)

Parameters:

endpointName - The name of the endpoint.

Returns:

The endpoint with a specified name.

getEndpoints

public LinkedHashMap getEndpoints()

Retrieves all the end point names in the service manifest.

Overrides:

FabricCodePackageActivationContext.getEndpoints()

Returns:

The end point names in the service manifest.

getLogDirectory

public String getLogDirectory()

Gets the path to the log directory that the application can use.

Overrides:

FabricCodePackageActivationContext.getLogDirectory()

Returns:

The path to the application logs directory.

getServiceListenAddress

public String getServiceListenAddress()

The address at which the service should start the communication listener.

Overrides:

FabricCodePackageActivationContext.getServiceListenAddress()

Returns:

The address at which the service should start the communication listener

getServiceManifestName

public String getServiceManifestName()

Retrieves the name of the service manifest.

Overrides:

FabricCodePackageActivationContext.getServiceManifestName()

Returns:

The name of the service manifest.

getServiceManifestVersion

public String getServiceManifestVersion()

Retrieves the version of the service manifest.

Overrides:

FabricCodePackageActivationContext.getServiceManifestVersion()

Returns:

The version of the service manifest.

getServicePublishAddress

public String getServicePublishAddress()

The address which the service should publish as the listen address.

Overrides:

FabricCodePackageActivationContext.getServicePublishAddress()

Returns:

The address which the service should publish as the listen address.

getServiceTypes

public LinkedHashMap getServiceTypes()

Retrieves the list of Service Group types in the service manifest.

Overrides:

FabricCodePackageActivationContext.getServiceTypes()

Returns:

The list of Service Group types in the service manifest.

getTempDirectory

public String getTempDirectory()

Gets the path to the Temp directory that the Application can use.

Overrides:

FabricCodePackageActivationContext.getTempDirectory()

Returns:

The path to the Temp directory.

getWorkDirectory

public String getWorkDirectory()

Gets the path to the Work directory that the Application can use.

Overrides:

FabricCodePackageActivationContext.getWorkDirectory()

Returns:

The path to the Work directory.

reportApplicationHealth

public void reportApplicationHealth(HealthInformation healthInfo)

Reports health for current application.

Overrides:

FabricCodePackageActivationContext.reportApplicationHealth(HealthInformation healthInfo)

Parameters:

healthInfo - Health information that is to be reported.

reportDeployedApplicationHealth

public void reportDeployedApplicationHealth(HealthInformation healthInfo)

Reports health for current deployed application.

Overrides:

FabricCodePackageActivationContext.reportDeployedApplicationHealth(HealthInformation healthInfo)

Parameters:

healthInfo - Health information that is to be reported.

reportDeployedServicePackageHealth

public void reportDeployedServicePackageHealth(HealthInformation healthInfo)

Reports health for current deployed service package.

Overrides:

FabricCodePackageActivationContext.reportDeployedServicePackageHealth(HealthInformation healthInfo)

Parameters:

healthInfo - Health information that is to be reported.

Applies to