Package schrodinger :: Package application :: Package licensing :: Module licadmin :: Class LocalServerProcess
[hide private]
[frames] | no frames]

Class LocalServerProcess

     object --+    
              |    
LicenseResource --+
                  |
                 LocalServerProcess

Instance Methods [hide private]
 
__init__(self)
The location may be either a pathname or the port@host address of a license server.
 
errors(self)
Return the errors of localserver license resources.
 
numResources(self)
 
clearResources(self)
Clears the license resources that are registered with this process.
 
addResource(self, resource)
Register a new license resource.
 
setTemplateResource(self, resource)
Sets a known good license from which to obtain generic information, such as pathname, version, logfile, etc.
 
checkResource(self, resource)
Check the health of a local server resource by using this local server process.
 
checkRunning(self)
Checks whether the server process is currently running.
 
isRunning(self)
Whether the server process is currently running.
 
health(self)
Returns the health of server process if there are any license resources to serve.
 
waitForSchrodDaemon(self, license_file, timeout=60)
Wait timeout seconds for lmstat to report if SCHROD vendor daemon is UP or DOWN.
 
_start(self, resources, logfile=None, append_log=True)
Start the given server resources - they do not necessarily have to be added to this server process object.
 
start(self, logfile=None, append_log=True)
Starts the server process with all the local license resources that have been added.
 
stop(self, pathname=None, anydaemon=False)
Stops the server process (both SCHROD and LMGRD).

Inherited from LicenseResource: __repr__, __unicode__, add_error, available_tokens, canonical_filename, checkout, ident, is_local_server, is_server, is_stub, jobs, lmdiag, lmstat, location, logfile, memory_leak_server, outdated_server, pathname, priority, refresh, schrod_port, server_host_and_port, server_hostid, server_hostids, server_hostnames, server_pathname, server_version, stub_license, summary, tokens, total_tokens

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from LicenseResource: LEAK_VERSIONS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

The location may be either a pathname or the port@host address of a license server. The source should be the name of the environment variable that specified this resource, or the pathname of the directory where it was found.

Overrides: object.__init__
(inherited documentation)

errors(self)

 

Return the errors of localserver license resources.

Overrides: LicenseResource.errors

addResource(self, resource)

 

Register a new license resource. The resource must be a local server license, and it must be good. Use checkResource() first to determine whether the license is good before adding.

Parameters:
  • resource (LicenseResource) - the local server license resource to add

setTemplateResource(self, resource)

 

Sets a known good license from which to obtain generic information, such as pathname, version, logfile, etc.

Parameters:
  • resource (LicenseResource) - the local server license to use as a template

checkResource(self, resource)

 

Check the health of a local server resource by using this local server process. This will by necessity stop and start the server process.

If the license server was running before this method was called, it will be restarted.

Parameters:
  • resource (LicenseResource) - the local server license to check

isRunning(self)

 

Whether the server process is currently running. This will actively check the running state if it has not yet been checked. Otherwise, the running state is passively tracked via an internal variable.

health(self)

 

Returns the health of server process if there are any license resources to serve. Otherwise returns RESOURCE_UNAVAILABLE and sets no errors. The health of the server process aggregates the health of all added resources.

Overrides: LicenseResource.health

waitForSchrodDaemon(self, license_file, timeout=60)

 

Wait timeout seconds for lmstat to report if SCHROD vendor daemon is UP or DOWN. This will allow further operations to read the server log or get features to be reliable.

_start(self, resources, logfile=None, append_log=True)

 

Start the given server resources - they do not necessarily have to be added to this server process object. It is up to the caller to ensure that the server is stopped before trying to start it.

Parameters:
  • resources (list of LicenseResource) - licenses to start
  • logfile (str) - the logfile to write lmgrd output
  • append_log (bool) - whether to append to the logfile or overwrite it

stop(self, pathname=None, anydaemon=False)

 

Stops the server process (both SCHROD and LMGRD).

Parameters:
  • anydaemon (bool) - If set to True, this will allow stopping non-SCHROD vendor daemon. This is mostly used for automated testing purpose.