org.pandora
Class Pandora

java.lang.Object
  extended by org.pandora.Pandora

public class Pandora
extends java.lang.Object

This class represents the identity of Pandora, and controls module registration, startup and shutdown. It defines a singleton that represents the system.


Field Summary
static java.lang.String CONFIG_FILE
           
static java.util.logging.Level DEFAULT_DEBUG_LEVEL
           
static java.util.logging.Level FINE
           
static java.util.logging.Level[] LEVELS
           
static int POOL_SIZE
           
static java.util.logging.Level WARNING
           
 
Constructor Summary
Pandora()
           
 
Method Summary
 void addLogListener(LogListener listener)
           
 Avatar avatar()
          Return the Avatar.
 Awareness awareness()
          Return the awareness.
static Pandora createInstance()
           
static Pandora createInstance(java.lang.String configFile, java.lang.String memory)
           
static Pandora createInstanceFromPool(java.lang.String instanceName)
          Return the cached instance from the pool if available, otherwise create a new instance.
 java.util.logging.Level getDebugLevel()
          Return the debugging level.
 boolean getFilterProfanity()
           
static java.util.concurrent.ConcurrentMap<java.lang.String,Pandora> getInstances()
           
 java.util.logging.Logger getLog()
           
 java.util.Set<LogListener> getLogListeners()
           
 java.lang.String getName()
          Return the instances name.
 boolean isDebug()
           
 boolean isDebugFine()
           
 boolean isDebugFiner()
           
 boolean isDebugFinest()
           
 boolean isDebugSever()
           
 boolean isDebugWarning()
           
 void log(java.lang.Object source, java.lang.String message, java.util.logging.Level level, java.lang.Object... arguments)
          Log the message if the debug level is greater or equal to the level.
 void log(java.lang.Object source, java.lang.Throwable error)
          Log the exception.
 Memory memory()
          Return the memory.
 Mind mind()
          Return the mind.
 Mood mood()
          Return the mood.
 void pool()
          Return the instance to the pool, or shutdown if too many instances pooled.
 void removeLogListener(LogListener listener)
           
 void setAvatar(Avatar avatar)
          Set the Avatar.
 void setAwareness(Awareness awareness)
          Set the awareness.
 void setDebugLevel(java.util.logging.Level level)
          Set the debugging level.
 void setFilterProfanity(boolean filterProfanity)
           
 void setLog(java.util.logging.Logger log)
           
 void setLogListeners(java.util.Set<LogListener> logListeners)
           
 void setMemory(Memory memory)
          Set the memory.
 void setMind(Mind mind)
          Set the mind.
 void setMood(Mood mood)
          Set the mood.
 void shutdown()
          Shutdown the system gracefully, persist memory and terminate thoughts.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FINE

public static final java.util.logging.Level FINE

WARNING

public static final java.util.logging.Level WARNING

DEFAULT_DEBUG_LEVEL

public static java.util.logging.Level DEFAULT_DEBUG_LEVEL

LEVELS

public static final java.util.logging.Level[] LEVELS

CONFIG_FILE

public static java.lang.String CONFIG_FILE

POOL_SIZE

public static int POOL_SIZE
Constructor Detail

Pandora

public Pandora()
Method Detail

createInstance

public static Pandora createInstance()

createInstance

public static Pandora createInstance(java.lang.String configFile,
                                     java.lang.String memory)

createInstanceFromPool

public static Pandora createInstanceFromPool(java.lang.String instanceName)
Return the cached instance from the pool if available, otherwise create a new instance.


getFilterProfanity

public boolean getFilterProfanity()

setFilterProfanity

public void setFilterProfanity(boolean filterProfanity)

getDebugLevel

public java.util.logging.Level getDebugLevel()
Return the debugging level.


isDebug

public boolean isDebug()

isDebugFine

public boolean isDebugFine()

isDebugFiner

public boolean isDebugFiner()

isDebugFinest

public boolean isDebugFinest()

isDebugWarning

public boolean isDebugWarning()

isDebugSever

public boolean isDebugSever()

log

public void log(java.lang.Object source,
                java.lang.String message,
                java.util.logging.Level level,
                java.lang.Object... arguments)
Log the message if the debug level is greater or equal to the level.


log

public void log(java.lang.Object source,
                java.lang.Throwable error)
Log the exception.


setDebugLevel

public void setDebugLevel(java.util.logging.Level level)
Set the debugging level.


awareness

public Awareness awareness()
Return the awareness. The awareness defines the senses.


setAwareness

public void setAwareness(Awareness awareness)
Set the awareness. The awareness defines the senses.


mind

public Mind mind()
Return the mind. The mind defines the thoughts.


mood

public Mood mood()
Return the mood. The mood defines emotional states.


avatar

public Avatar avatar()
Return the Avatar. The Avatar expresses the emotional states.


setMind

public void setMind(Mind mind)
Set the mind. The mind defines the thoughts.


setMood

public void setMood(Mood mood)
Set the mood. The mood defines emotional states.


setAvatar

public void setAvatar(Avatar avatar)
Set the Avatar. The Avatar expresses the emotional state.


memory

public Memory memory()
Return the memory. The memory defines the knowledge networks.


setMemory

public void setMemory(Memory memory)
Set the memory. The memory defines the knowledge networks.


shutdown

public void shutdown()
Shutdown the system gracefully, persist memory and terminate thoughts.


pool

public void pool()
Return the instance to the pool, or shutdown if too many instances pooled. TODO: pool by name so can reassign, currently this just keeps memory session active.


getName

public java.lang.String getName()
Return the instances name. This is the instance/database name, not her real name.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addLogListener

public void addLogListener(LogListener listener)

removeLogListener

public void removeLogListener(LogListener listener)

getLogListeners

public java.util.Set<LogListener> getLogListeners()

setLogListeners

public void setLogListeners(java.util.Set<LogListener> logListeners)

getInstances

public static java.util.concurrent.ConcurrentMap<java.lang.String,Pandora> getInstances()

getLog

public java.util.logging.Logger getLog()

setLog

public void setLog(java.util.logging.Logger log)