argos.deploy
Class ComponentManager

java.lang.Object
  extended by argos.deploy.ComponentManager

public class ComponentManager
extends Object

ComponentManager is the control center for Argos, it handles deployment, redployment and stopping of services. Deployment of new service files is done by calling the public method deploy(). When this method is called it is assumed that the service is not running already. If the service is already running the loading of that service will fail. To redploy a service the method redeploy() is to be used.

Redeploy() will stop the services that are needed to be stopped including any depending services before it calls deploy() and brings those services up again.

Stopping is done in the public method stop(), it will stop the given services and all services that are dependant on the stopped services.

argos.deploy.HotDeployer is the class that will call these methods. It is however possible to call control the ComponentManager through JMX. For this the methods startService(String filename) and startService(String serviceName) has been added.


Field Summary
static String COMPONENT_STOPPED
           
 NotificationProxy proxy
          NotifictionProxy used to send out events.
static String SERVICE_FAILED
          This constant is added to notifications when a service has failed loading.
static String SERVICE_LOADING
          This constant is added to notifications when a service is about to be loaded.
static String SERVICE_STARTED
          This constant is added to notifications when a service has started.
static String SERVICE_STOPPED
          This constant is added to notifications when the micro kernel has done everything it is suppose to do to stop the service.
static String STOPPING_COMPONENT
           
static String STOPPING_SERVICE
           
 
Method Summary
 void deploy(List<File> files)
           
static ComponentManager getInstance()
          Gets the singelton instance of this class
 MBeanNotificationInfo[] getNotificationInfo()
          This method returns the types of notifications this object can broadcast
 void redeploy(List<File> files)
          This method will redploy the given files by stopping all the files and then deploying them with the deploy method.
 void shutdown()
          This method will stopp all services that has been deployed.
 boolean start(ServiceMetaInfo meta)
           
 boolean startService(String name)
          This method will start a service by filename.
 void stop(ComponentMetaInfo component)
           
 List<File> stop(List<ServiceMetaInfo> services)
          This methods stops the given services and the services that depends on them.
 void stop(ServiceMetaInfo service)
           
 boolean stopService(String name)
          This method will stop a service and only this service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_STARTED

public static final String SERVICE_STARTED
This constant is added to notifications when a service has started. That means that the micro kernel has done everything it is suppose to do to stop the service.

See Also:
Constant Field Values

SERVICE_STOPPED

public static final String SERVICE_STOPPED
This constant is added to notifications when the micro kernel has done everything it is suppose to do to stop the service.

See Also:
Constant Field Values

SERVICE_LOADING

public static final String SERVICE_LOADING
This constant is added to notifications when a service is about to be loaded. That is after the class loader has been created but before any thing else is done.

See Also:
Constant Field Values

SERVICE_FAILED

public static final String SERVICE_FAILED
This constant is added to notifications when a service has failed loading.

See Also:
Constant Field Values

COMPONENT_STOPPED

public static final String COMPONENT_STOPPED
See Also:
Constant Field Values

STOPPING_COMPONENT

public static final String STOPPING_COMPONENT
See Also:
Constant Field Values

STOPPING_SERVICE

public static final String STOPPING_SERVICE
See Also:
Constant Field Values

proxy

public NotificationProxy proxy
NotifictionProxy used to send out events. See constants for what events can be sent out.

Method Detail

deploy

public void deploy(List<File> files)

start

public boolean start(ServiceMetaInfo meta)

redeploy

public void redeploy(List<File> files)
This method will redploy the given files by stopping all the files and then deploying them with the deploy method.

Parameters:
files - Files that will be redeployed

stop

public List<File> stop(List<ServiceMetaInfo> services)
This methods stops the given services and the services that depends on them.

Parameters:
metadatas - The services meta information
Returns:
A list of files (services) that were actually stopped.

stop

public void stop(ServiceMetaInfo service)

stop

public void stop(ComponentMetaInfo component)

stopService

public boolean stopService(String name)
This method will stop a service and only this service

Parameters:
name - The name of the service that will be stopped
Returns:
True if the service was stopped, false otherwise.

startService

public boolean startService(String name)
This method will start a service by filename.

Parameters:
name - The filename
Returns:
True if the service was started, false if not.

shutdown

public void shutdown()
This method will stopp all services that has been deployed.


getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
This method returns the types of notifications this object can broadcast

Returns:
Types of notifications

getInstance

public static ComponentManager getInstance()
Gets the singelton instance of this class

Returns:
Singelton of ComponentManager


Copyright © 2004-2007 University of Troms?. All Rights Reserved.