com.sun.enterprise.admin.servermgmt.services
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:
isConfigValid(), ServiceHandler

Method Summary
 void createService()
          Creates an arbitrary service, specified by certain parameters.
 void createServiceInternal()
           
 void deleteService()
           
 void deleteServiceInternal()
           
 PlatformServicesInfo getInfo()
           
 String getLocationArgsRestart()
           
 String getLocationArgsStart()
           
 String getLocationArgsStop()
           
 String getManifestFilePath()
          Returns the absolute location of the manifest file as service understands it.
 String getManifestFileTemplatePath()
          Returns the absolute location of the template for the given service.
 ServerDirs getServerDirs()
          get the dirs with this thread-safe immutable guaranteed object.
 String getServiceProperties()
          Returns the additional properties of the Service.
 String getSuccessMessage()
           
 int getTimeoutSeconds()
           
 void initializeInternal()
           
 boolean isConfigValid()
          Determines if the configuration of the method is valid.
 boolean isDomain()
           
 boolean isInstance()
           
 void setServiceProperties(String cds)
          Sets the additional service properties that are specific to it.
 void setTimeoutSeconds(int number)
          Sets timeout in seconds before the master boot restarter should give up starting this service.
 Map<String,String> tokensAndValues()
          Returns the tokens and values of the service as a map.
 void writeReadmeFile(String msg)
           
 

Method Detail

getServerDirs

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

void setServiceProperties(String cds)
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

Map<String,String> 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.

getManifestFilePath

String getManifestFilePath()
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.


getManifestFileTemplatePath

String getManifestFileTemplatePath()
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

void writeReadmeFile(String msg)

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()


Copyright © 2012 GlassFish Community. All Rights Reserved.