springs.context.threads
Class AgentCreator

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--springs.context.threads.AgentCreator
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
AgentCreator_RMIImpl

public abstract class AgentCreator
extends java.lang.Thread

A Springs agent creator.

Author:
Sergio Ilarri Artigas

Field Summary
protected  springs.agent.SpringsAgent _agent
           
protected  java.lang.Throwable _error
           
protected  boolean _isMoving
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AgentCreator(springs.agent.SpringsAgent agent, boolean isMoving)
          Constructor.
 
Method Summary
 void createAgent()
          Creates the agent.
protected abstract  void createAgentTemplate()
           
 java.lang.Throwable getError()
          In case the creation failed, it gets the error.
 boolean isSuccessful()
          Obtains if the agent creation was successful.
 void run()
          Performs the creation of the agent in background.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_agent

protected springs.agent.SpringsAgent _agent

_error

protected java.lang.Throwable _error

_isMoving

protected boolean _isMoving
Constructor Detail

AgentCreator

public AgentCreator(springs.agent.SpringsAgent agent,
                    boolean isMoving)
Constructor.

Parameters:
agent - the agent.
isMoving - a boolean indicating if the agent is sent because of a movement from another context.
See Also:
SpringsAgent
Method Detail

isSuccessful

public boolean isSuccessful()
Obtains if the agent creation was successful.

Returns:
a boolean indicating whether the creation was successful.

getError

public java.lang.Throwable getError()
In case the creation failed, it gets the error.

Returns:
the error.
See Also:
Throwable

run

public void run()
Performs the creation of the agent in background.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

createAgent

public void createAgent()
                 throws CreationException,
                        AlreadyExistingAgentException
Creates the agent.

Throws:
CreationException - if error.
AlreadyExistingAgentException - if the agent cannot be registered because it already exist at the context.
See Also:
CreationException, AlreadyExistingAgentException

createAgentTemplate

protected abstract void createAgentTemplate()
                                     throws CreationException,
                                            AlreadyExistingAgentException
CreationException
AlreadyExistingAgentException