com.sun.enterprise.admin.servermgmt.services
Class NonSMFServiceAdapter

java.lang.Object
  extended by com.sun.enterprise.admin.servermgmt.services.ServiceAdapter
      extended by com.sun.enterprise.admin.servermgmt.services.NonSMFServiceAdapter
All Implemented Interfaces:
Service
Direct Known Subclasses:
LinuxService, WindowsService

public abstract class NonSMFServiceAdapter
extends ServiceAdapter

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
 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.
 String getServiceProperties()
          Returns the additional properties of the Service.
 int getTimeoutSeconds()
           
 boolean isConfigValid()
          Determines if the configuration of the method is valid.
 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.
 
Methods inherited from class com.sun.enterprise.admin.servermgmt.services.ServiceAdapter
createService, deleteService, getInfo, getLocationArgsRestart, getServerDirs, isDomain, isInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.enterprise.admin.servermgmt.services.Service
createServiceInternal, deleteServiceInternal, getLocationArgsStart, getLocationArgsStop, getSuccessMessage, initializeInternal, writeReadmeFile
 

Method Detail

getTimeoutSeconds

public final int getTimeoutSeconds()

setTimeoutSeconds

public final void setTimeoutSeconds(int number)
Description copied from interface: Service
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

public final String getServiceProperties()
Description copied from interface: Service
Returns the additional properties of the Service.

Returns:
String representing addtional properties of the service. May return default properties as well.

setServiceProperties

public final void setServiceProperties(String cds)
Description copied from interface: Service
Sets the additional service properties that are specific to it.


tokensAndValues

public final Map<String,String> tokensAndValues()
Description copied from interface: Service
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

public final String getManifestFilePath()
Description copied from interface: Service
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

public final String getManifestFileTemplatePath()
Description copied from interface: Service
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.


isConfigValid

public final boolean isConfigValid()
Description copied from interface: Service
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


Copyright © 2012 GlassFish Community. All Rights Reserved.