com.cometway.ak
Class SecureServiceManager

java.lang.Object
  extended by com.cometway.props.Props
      extended by com.cometway.ak.Agent
          extended by com.cometway.ak.ServiceAgent
              extended by com.cometway.ak.RequestAgent
                  extended by com.cometway.ak.SecureServiceManager
All Implemented Interfaces:
AgentInterface, RequestAgentInterface, HasStateMachineModel
Direct Known Subclasses:
PropsListServiceManager

public class SecureServiceManager
extends RequestAgent

Reference implementation of the ServiceManagerInterface. There's nothing implicitly "secure" about this implementation. This agent will generate HTML detailing its registered directory if service_name is setup (default: /admin/services.agent).


Nested Class Summary
 class SecureServiceManager.SecureServiceManagerImpl
           
 
Field Summary
protected  java.util.HashMap services
           
protected  ServiceManagerInterface sm
           
 
Fields inherited from class com.cometway.ak.Agent
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter
 
Constructor Summary
SecureServiceManager()
           
 
Method Summary
protected  java.util.List getServiceList()
          Returns a List containing the Props of currently registered services.
static java.lang.String getTimeStamp()
          Returns a string with the current time using SimpleDateFormat("yyyyMMdd HHmmss.SSS").
 void handleRequest(AgentRequest request)
          This agent implements and registers itself as a RequestAgent that generates an HTML list of currently registered services and other stats.
 void initProps()
          Override this method to initialize this agent's properties before it is started.
 void start()
          Starts the service manager.
 void stop()
          Stops the service manager.
 
Methods inherited from class com.cometway.ak.Agent
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, println, register, registerService, setAgentController, setProps, toString, unregister, unregisterService, warning, warning
 
Methods inherited from class com.cometway.props.Props
addListener, append, copy, copyFrom, copyTo, decrementInteger, dump, enableListeners, enumerateKeys, format, getBoolean, getByteArray, getCharacter, getDate, getDate, getDateString, getDouble, getFloat, getHexString, getInteger, getKeys, getLong, getNextKey, getProperty, getProperty, getPropsContainer, getSize, getString, getString, getTokens, getTokens, getTrimmedString, getVector, hasProperty, incrementInteger, insertProps, loadProps, notifyPropsChanged, notifyPropsChangedIgnore, notifyPropsChangedIgnore, parse, propertyMatchesRegEx, readFromFile, regExPropertyMatches, removeAll, removeListener, removeProperty, resumeNotify, saveProps, set, setBoolean, setCharacter, setDefault, setDouble, setFloat, setInteger, setLong, setProperty, setProperty, setProperty, setPropsContainer, suspendNotify, writeToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

services

protected java.util.HashMap services

sm

protected ServiceManagerInterface sm
Constructor Detail

SecureServiceManager

public SecureServiceManager()
Method Detail

initProps

public void initProps()
Description copied from class: Agent
Override this method to initialize this agent's properties before it is started.

Specified by:
initProps in interface AgentInterface
Overrides:
initProps in class Agent

start

public void start()
Starts the service manager.

Specified by:
start in interface AgentInterface
Overrides:
start in class ServiceAgent

stop

public void stop()
Stops the service manager.

Specified by:
stop in interface AgentInterface
Overrides:
stop in class ServiceAgent

handleRequest

public void handleRequest(AgentRequest request)
This agent implements and registers itself as a RequestAgent that generates an HTML list of currently registered services and other stats. This is a useful agent when you are developing agents for use with com.cometway.httpd.Webserver.


getServiceList

protected java.util.List getServiceList()
Returns a List containing the Props of currently registered services.


getTimeStamp

public static java.lang.String getTimeStamp()
Returns a string with the current time using SimpleDateFormat("yyyyMMdd HHmmss.SSS").