Interface Service
- All Known Implementing Classes:
LinuxService,NonSMFServiceAdapter,ServiceAdapter,SMFService,WindowsService
public interface Service
Represents an abstract Service. This interface defines sufficient methods for any platform integration of application
server with various service control mechanisms on various platforms. An example is SMF for Solaris.
- Since:
- SJSAS 9.1
- Author:
- Kedar Mhaswade
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidCreates an arbitrary service, specified by certain parameters.voidvoidvoidgetInfo()com.sun.enterprise.util.io.ServerDirsget the dirs with this thread-safe immutable guaranteed object.Returns the additional properties of the Service.intvoidbooleanDetermines if the configuration of the method is valid.booleanisDomain()booleanvoidSets the additional service properties that are specific to it.voidsetTimeoutSeconds(int number) Sets timeout in seconds before the master boot restarter should give up starting this service.Returns the tokens and values of the service as a map.voidwriteReadmeFile(String msg)
-
Method Details
-
getServerDirs
com.sun.enterprise.util.io.ServerDirs getServerDirs()get the dirs with this thread-safe immutable guaranteed object. It saves a LOT of error checking... You should set the variable in the constructor. You are not allowed to change it later- Parameters:
dirs-
-
getTimeoutSeconds
int getTimeoutSeconds() -
setTimeoutSeconds
void setTimeoutSeconds(int number) Sets timeout in seconds before the master boot restarter should give up starting this service.- Parameters:
number- a non-negative integer representing timeout. A value of zero implies infinite timeout.
-
getServiceProperties
String getServiceProperties()Returns the additional properties of the Service.- Returns:
- String representing addtional properties of the service. May return default properties as well.
-
setServiceProperties
Sets the additional service properties that are specific to it.- Parameters:
must- be a colon separated String, if not null. No effect, if null is passed.
-
isConfigValid
boolean isConfigValid()Determines if the configuration of the method is valid. When this class is constructed, appropriate defaults are used. But before attempting to create the service in the Solaris platform, it is important that the necessary configuration is done by the users via various mutator methods of this class. This method must be called to guard against some abnormal failures before creating the service. It makes sure that the caller has set all the necessary parameters reasonably. Note that it does not validate the actual values.- Returns:
- true if the configuration is valid, an exception is thrown otherwise
- Throws:
RuntimeException- if the configuration is not valid
-
tokensAndValues
Returns the tokens and values of the service as a map. This method converts a service into corresponding tokens and their values.- Returns:
- tokens and values as a Map<String, String>.
-
getManifestFile
File getManifestFile()- Returns:
- the absolute location of the manifest file as service understands it. It takes into account the name, type and configuration location of the service. It is expected that these are set before calling this method. If the Fully Qualified Service Name is invalid, a RuntimeException results.
-
getManifestTemplateFile
File getManifestTemplateFile()- Returns:
- the absolute location of the template for the given service. The type of the service must be set before calling this method, otherwise a runtime exception results.
-
createService
void createService()Creates an arbitrary service, specified by certain parameters. The implementations should dictate the mappings in the parameters received. The creation of service is either successful or not. In other words, the implementations must retain the original state of the operating platform if the service creation is not successful completely.- Parameters:
params- a Map between Strings that represents the name value pairs required to create the service- Throws:
RuntimeException- if there is any error is creation of service
-
getSuccessMessage
String getSuccessMessage() -
writeReadmeFile
-
getLocationArgsStart
String getLocationArgsStart() -
getLocationArgsRestart
String getLocationArgsRestart() -
getLocationArgsStop
String getLocationArgsStop() -
isDomain
boolean isDomain() -
isInstance
boolean isInstance() -
getInfo
PlatformServicesInfo getInfo() -
initializeInternal
void initializeInternal() -
createServiceInternal
void createServiceInternal() -
deleteService
void deleteService() -
deleteServiceInternal
void deleteServiceInternal()
-