Class SMFService
java.lang.Object
com.sun.enterprise.admin.servermgmt.services.ServiceAdapter
com.sun.enterprise.admin.servermgmt.services.SMFService
- All Implemented Interfaces:
Service
Represents the SMF Service. Holds the tokens and their values that are consumed by the SMF templates. The recommended
way to use this class (or its instances) is to initialize it with default constructor and then apply various mutators
to configure the service. Finally, callers should make sure that the configuration is valid, before attempting to
create the service in the Solaris platform.
- Since:
- SJSAS 9.0
- Author:
- Kedar Mhaswade
- See Also:
-
isConfigValid()SMFServiceHandler
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates the service on the given platform.voidReturns the absolute location of the manifest file as SMF understands it.Returns the absolute location of the template for the given service.Returns the additional properties of the Service.For safety -- this is similar to the subversion dry-run command.intReturns timeout in seconds before the master boot restarter should give up starting this service.voidbooleanDetermines if the configuration of the method is valid.voidSets 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.toString()Returns a String representation of the SMFService.voidwriteReadmeFile(String msg) Methods inherited from class com.sun.enterprise.admin.servermgmt.services.ServiceAdapter
createService, deleteService, getInfo, getLocationArgsRestart, getServerDirs, isDomain, isInstance
-
Field Details
-
TIMEOUT_SECONDS_DV
- See Also:
-
AS_ADMIN_USER_DEF_VAL
- See Also:
-
SP_DELIMITER
- See Also:
-
PRIVILEGES_DEFAULT_VAL
- See Also:
-
NETADDR_PRIV_VAL
- See Also:
-
BASIC_NETADDR_PRIV_VAL
- See Also:
-
START_INSTANCES_TN
- See Also:
-
START_INSTANCES_DEFAULT_VAL
-
NO_START_INSTANCES_PROPERTY
- See Also:
-
SVCCFG
- See Also:
-
SVCADM
- See Also:
-
MANIFEST_HOME
- See Also:
-
-
Method Details
-
createServiceInternal
public void createServiceInternal()Creates the service on the given platform. -
deleteServiceInternal
public void deleteServiceInternal() -
getTimeoutSeconds
public int getTimeoutSeconds()Returns timeout in seconds before the master boot restarter should give up starting this service. -
setTimeoutSeconds
public 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
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:
cds- must be a colon separated String, if not null. No effect, if null is passed.
-
isConfigValid
public 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. Note that a copy is returned.- Returns:
- a copy of tokens and values
-
getManifestFilePath
Returns the absolute location of the manifest file as SMF 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
Returns the absolute location of the template for the given service. If the file can not be found at its required location then the file will be copied from inside this jar file to the file system. The type of the service must be set before calling this method, otherwise a runtime exception results. -
toString
Returns a String representation of the SMFService. It contains a new-line separated "name=value" String that contains the name and value of each of of the tokens that were set in the service. -
getSuccessMessage
For safety -- this is similar to the subversion dry-run command. It does everything except create the service. -
initializeInternal
public void initializeInternal() -
writeReadmeFile
-
getLocationArgsStart
-
getLocationArgsStop
-