de.fhg.igd.semoa.server
Class AgentLauncherImpl

java.lang.Object
  extended byde.fhg.igd.semoa.service.AbstractService
      extended byde.fhg.igd.semoa.server.AgentLauncherImpl
All Implemented Interfaces:
AgentLauncher, Service

public class AgentLauncherImpl
extends AbstractService
implements AgentLauncher

Implements a "convenience" service for creating simple agents. Calling threads need to have permission to access various very sensitive services in the server such as the KeyMaster.

Generated agents are launched automatically, if possible.

Version:
"$Id: AgentLauncherImpl.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Volker Roth

Nested Class Summary
protected  class AgentLauncherImpl.AgentLauncherJob
          Runnable class to invoke method launchAgent in a new Thread.
 
Field Summary
private  SortedMap filters_
          The SortedMap of launch filters an agent has to pass.
private  long filterUpdate_
          The last time the list of launch filters was fetched.
private  Object lock_
          A private lock object.
private static Logger log_
          The Logger instance for this class
 
Fields inherited from class de.fhg.igd.semoa.service.AbstractService
REV_POSTFIX, REV_PREFIX
 
Fields inherited from interface de.fhg.igd.semoa.server.AgentLauncher
MODE_DIGEST, MODE_IMPORT, MODE_LOCAL, WHATIS
 
Constructor Summary
AgentLauncherImpl()
           
 
Method Summary
 String author()
          Returns the name of the author of the service.
protected  SortedMap getLaunchFilters()
           
 String info()
          Returns the informative string which should describe the service's essence in a sentence.
 void launchAgent(Resource resource, Properties props)
          This method internally calls launchAgent(resource, props, false).
 void launchAgent(Resource resource, Properties props, boolean wait)
          Creates an agent and runs it in the local server.
protected  void launchAgent0(Resource resource, Properties props)
           
 String revision()
          Returns the revision number of this class as a string.
 
Methods inherited from class de.fhg.igd.semoa.service.AbstractService
checkDependencies, dependencies, docs, doPrivileged, doPrivileged, getACC, getEnvironment, majorVersion, minorVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log_

private static Logger log_
The Logger instance for this class


filterUpdate_

private long filterUpdate_
The last time the list of launch filters was fetched.


filters_

private SortedMap filters_
The SortedMap of launch filters an agent has to pass.


lock_

private Object lock_
A private lock object.

Constructor Detail

AgentLauncherImpl

public AgentLauncherImpl()
Method Detail

info

public String info()
Description copied from class: AbstractService
Returns the informative string which should describe the service's essence in a sentence.

Specified by:
info in interface Service
Specified by:
info in class AbstractService
Returns:
the String with the service's short description.

author

public String author()
Description copied from class: AbstractService
Returns the name of the author of the service. The format to be used should be John Doe <jdoe@zilch.net>.

Specified by:
author in interface Service
Specified by:
author in class AbstractService
Returns:
the String with the author's name.

revision

public String revision()
Description copied from class: AbstractService
Returns the revision number of this class as a string. This class provides default implementations of methods majorVersion(), minorVersion based on the assumption that this method returns a revision string as generated by rcs(1) for the template "$Revision: 1.7 $/$Date: 2007-08-08 04:41:53 +0200 (Wed, 08 Aug 2007) $".

Specified by:
revision in class AbstractService

getLaunchFilters

protected SortedMap getLaunchFilters()
Returns:
The SortedMap of agent launch filters.

launchAgent

public void launchAgent(Resource resource,
                        Properties props)
Description copied from interface: AgentLauncher
This method internally calls launchAgent(resource, props, false).

Specified by:
launchAgent in interface AgentLauncher

launchAgent

public void launchAgent(Resource resource,
                        Properties props,
                        boolean wait)
Description copied from interface: AgentLauncher
Creates an agent and runs it in the local server. The agent will be created under the authority of the running server. In other words, the agent will be signed by the local server which will thus become the official owner of that agent.

Agent creation is created by means of properties. Please refer to class AgentStructure for a complete list of properties required and interpreted by the default mechanisms in SeMoA.

The Resource passed to this method is copied before any operations starts. In other words, the resource that is passed is not modified, and modifying it after the agent is launched will not cause side effects.

Specified by:
launchAgent in interface AgentLauncher
Parameters:
props - The properties of the agent, including the properties that define how the agent is created.
resource - The resource that contains the data of the agent. If it is null then an empty default resource is created for the agent.
wait - If true, the agent is launched in a synchronous manner, otherwise the agent is launched in a new thread and this method returns directly.

launchAgent0

protected void launchAgent0(Resource resource,
                            Properties props)
                     throws GeneralSecurityException,
                            IllegalAgentException,
                            IOException
Throws:
GeneralSecurityException
IllegalAgentException
IOException


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.