cz.cuni.amis.pogamut.base.component.controller
Interface IComponentControlHelper

All Known Subinterfaces:
ISharedComponentControlHelper
All Known Implementing Classes:
ComponentControlHelper, SharedComponentControlHelper, SharedComponentController.ControlHelper

public interface IComponentControlHelper

Provides a way to control the component.

We have purposefully created specific helper interface for the control of the IComponent. That's because the designer of the component might want to hide its start/stop/kill method (e.g. they should not be accessible by anyone). This is typical when using IComponentController to automatically start/stop the component based on its dependencies.

So if you want to hide these methods from the public interface of your component, than create private inner class inside your component and implement how the component is starting/stopping/killing itself possibly by recalling private methods of the component.


Method Summary
 void kill()
          Kills the component in ruthless way.
 void pause()
          Pauses the component.
 void prePause()
          Called before the IPausingEvent of the component is broadcast.
 void preResume()
          Called before the IResumingEvent of the component is broadcast.
 void preStart()
          Called before the IStartingEvent of the component is broadcast.
 void preStartPaused()
          Called before IStartingPausedEvent of the component is broadcast.
 void preStop()
          Called before the IStoppingEvent of the component is broadcast.
 void reset()
          Called whenever IResetEvent is caught.
 void resume()
          Resumes the component.
 void start()
          Starts the component.
 void startPaused()
          Starts the component but it assumes that the component just prepares whatever data structures it needs / make connections / handshake whatever it needs with the environment / etc.
 void stop()
          Stops the component.
 

Method Detail

preStart

void preStart()
              throws PogamutException
Called before the IStartingEvent of the component is broadcast.

You may need to prepare some stuff before starting event is generated

Throws:
PogamutException

start

void start()
           throws PogamutException
Starts the component. It should throw exception, if it can not start.

Throws:
PogamutException

preStartPaused

void preStartPaused()
                    throws PogamutException
Called before IStartingPausedEvent of the component is broadcast.

You may need to prepare some stuff before starting event is generated.

Throws:
PogamutException

startPaused

void startPaused()
                 throws PogamutException
Starts the component but it assumes that the component just prepares whatever data structures it needs / make connections / handshake whatever it needs with the environment / etc.

It should not let the agent to perform designers work (i.e., UT2004 bots should not start playing in the game).

After this call, the component should behave as it would have been paused with pause().

Throws:
PogamutException

prePause

void prePause()
              throws PogamutException
Called before the IPausingEvent of the component is broadcast.

You may need to pre-clean some stuff.

Throws:
PogamutException

pause

void pause()
           throws PogamutException
Pauses the component.

Called whenever IPausingEvent is caught from one of the dependencies.

Throws:
PogamutException

preResume

void preResume()
               throws PogamutException
Called before the IResumingEvent of the component is broadcast.

You may need to pre-clean some stuff.

Throws:
PogamutException

resume

void resume()
            throws PogamutException
Resumes the component.

Called whenever IResumingEvent is caught from one of the dependencies.

Throws:
PogamutException

preStop

void preStop()
             throws PogamutException
Called before the IStoppingEvent of the component is broadcast.

You may need to pre-clean some stuff.

Throws:
PogamutException

stop

void stop()
          throws PogamutException
Stops the component.

It should throw an exception if the component can't be stopped.

Throws:
PogamutException

kill

void kill()
Kills the component in ruthless way. It must be non-blocking method.

Called whenever IFatalErrorEvent is caught.

Must not throw any exception whatsoever.


reset

void reset()
           throws PogamutException
Called whenever IResetEvent is caught. It should reinitialize data structures of the component so it can be started again.

Should throw an exception in case that the component can't be reseted.

Throws:
PogamutException