Class NonSMFServiceAdapter
java.lang.Object
com.sun.enterprise.admin.servermgmt.services.ServiceAdapter
com.sun.enterprise.admin.servermgmt.services.NonSMFServiceAdapter
- All Implemented Interfaces:
Service
- Direct Known Subclasses:
LinuxService,WindowsService
The original implementation of Services had serious design problems. The Service interface is ENORMOUSLY fat and non
OO in the sense that outside callers had to set things to make things work. The interface is not generic -- it is
very SMF specific It is extremely difficult to implement the interface because it has SO MANY methods that non-SMF
don't need. This "Adapter" makes it easier to implement the interface. Eventually we should have one adapter for all
services but the SMF code is difficult and time-consuming to change. Meantime I'm adding new functionality (August
2010, bnevins) for instances. I'm moving implementations of the new interface methods to "ServiceAdapter" which ALL
services extend.
- Author:
- bnevins
-
Method Summary
Modifier and TypeMethodDescriptionfinal StringReturns the absolute location of the manifest file as service understands it.final StringReturns the absolute location of the template for the given service.final StringReturns the additional properties of the Service.final intfinal booleanDetermines if the configuration of the method is valid.final voidSets the additional service properties that are specific to it.final 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.Methods inherited from class com.sun.enterprise.admin.servermgmt.services.ServiceAdapter
createService, deleteService, getInfo, getLocationArgsRestart, getServerDirs, isDomain, isInstanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sun.enterprise.admin.servermgmt.services.Service
createServiceInternal, deleteServiceInternal, getLocationArgsStart, getLocationArgsStop, getSuccessMessage, initializeInternal, writeReadmeFile
-
Method Details
-
getTimeoutSeconds
public final int getTimeoutSeconds() -
setTimeoutSeconds
public final void setTimeoutSeconds(int number) Description copied from interface:ServiceSets 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
Description copied from interface:ServiceReturns the additional properties of the Service.- Returns:
- String representing addtional properties of the service. May return default properties as well.
-
setServiceProperties
Description copied from interface:ServiceSets the additional service properties that are specific to it. -
tokensAndValues
Description copied from interface:ServiceReturns 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>.
-
getManifestFilePath
Description copied from interface:ServiceReturns 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
Description copied from interface:ServiceReturns 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. -
isConfigValid
public final boolean isConfigValid()Description copied from interface:ServiceDetermines 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
-