org.kaariboga.server
Class Boga

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--org.kaariboga.server.Boga
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, BaseListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, java.awt.MenuContainer, javax.swing.event.MenuListener, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class Boga
extends javax.swing.JFrame
implements java.awt.event.ActionListener, javax.swing.event.MenuListener, javax.swing.event.ListSelectionListener, BaseListener

This class implements a kaariboga server with a nice user interface.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  java.lang.String[] agentPaths
          The directories which include the agents
(package private)  java.lang.String agentsPath
          String from the properties file, that determines the directories which include the agents
(package private)  KaaribogaAddress boServer
          Address of the server that registers all servers in domain.
(package private)  ClassManager classManager
          Manages the byte codes of the loaded classes.
(package private)  javax.swing.JFileChooser fileChooser
           
(package private)  KaaribogaAddress ipServer
          Address of the server that determines the IP address of this server in case of dynamic IP
private  KaaribogaBase kaaribogaBase
          The base that handles all kaaribogas.
(package private)  javax.swing.JList list
           
(package private)  javax.swing.DefaultListModel listModel
           
(package private)  javax.swing.JScrollPane listScroller
           
(package private)  KaaribogaAddress localBaseAddress
          Address of the local Kaariboga base
(package private)  javax.swing.JMenu mCreate
           
(package private)  javax.swing.JMenu mEdit
           
(package private)  javax.swing.JMenuBar menuBar
           
(package private)  javax.swing.JMenu mFile
           
(package private)  javax.swing.JMenuItem miCreateCounter
           
(package private)  javax.swing.JMenuItem miCreateExecuter
           
(package private)  javax.swing.JMenuItem miCreateHelloAgent
           
(package private)  javax.swing.JMenuItem miCreateHelloTraveler
           
(package private)  javax.swing.JMenuItem miCreateMessageReceiver
           
(package private)  javax.swing.JMenuItem miCreateMessageSender
           
(package private)  javax.swing.JMenuItem miCreateReproducer
           
(package private)  javax.swing.JMenuItem miCreateReturnAgent
           
(package private)  javax.swing.JMenuItem miDestroy
           
(package private)  javax.swing.JMenuItem miExit
           
(package private)  javax.swing.JMenuItem miGoOffline
           
(package private)  javax.swing.JMenuItem miGoOnline
           
(package private)  javax.swing.JMenuItem miLoad
           
(package private)  javax.swing.JMenuItem miSendTo
           
(package private)  javax.swing.JMenu mServer
           
(package private)  javax.swing.JPanel panel
           
private  KbPlugInManager plugInManager
          PlugInManager to handle the loaded plug-ins
(package private)  int port
          Port number for connections
(package private)  java.util.Properties props
          Properties defined in Boga.config
(package private)  java.lang.String selectedKaariboga
          Name of the agent that was selected in the list.
(package private)  java.lang.String strConfigFile
          Where the settings for the server are.
(package private)  java.lang.String strIpServer
          server that serves a valid IP address in case of dynamic IP addressing
 
Fields inherited from class javax.swing.JFrame
accessibleContext, defaultCloseOperation, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, dbg, focusMgr, inputContext, inputContextLock, nativeActive, OPENED, ownedWindowList, warningString, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, needsPaint, printing, printingThreads
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Boga()
          Create a new Boga server.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Handles the menu events
 void baseKaaribogaArrived(BaseEvent e)
          Reaction when a kaariboga agent has arrived on the base or has been added on creation.
 void baseKaaribogaCreated(BaseEvent e)
          Reaction when a kaariboga agent has been put to a base and the base invoked the agent's onCreate method.
 void baseKaaribogaDestroyed(BaseEvent e)
          Reaction when a kaariboga agent has been destroyed.
 void baseKaaribogaLeft(BaseEvent e)
          Reaction when a kaariboga agent left the base.
(package private)  void createCounter()
          Creates a Counter and puts it to the base.
(package private)  void createExecuter()
          Creates an Executer and puts it to the base.
(package private)  void createHelloAgent()
          Generates a HelloAgent and puts it to the base.
(package private)  void createHelloTraveler()
          Generates a HelloTraveler and puts it to the base.
(package private)  void createMessageReceiver()
          Creates a MessageReceiver and puts it to the base.
(package private)  void createMessageSender()
          Creates an MessageSender and puts it to the base.
(package private)  void createReproducer()
          Creates an Reproducer and puts it to the base.
(package private)  void createReturnAgent()
          Creates a ReturnAgent and puts it to the base.
 void dispose()
          Call for a proper clean up of the network connections.
(package private)  void editDestroy()
          Destroys the selected kaariboga.
(package private)  void editSendTo()
          Sends the selected kaariboga to another base.
(package private)  void goOffline()
          Causes the base to go offline
(package private)  void goOnline()
          Causes the base to go online
 void loadFromFile()
          Loads a kaariboga agent from a file
 void loadKaariboga(java.lang.String name)
          Loads a kaariboga agent
static void main(java.lang.String[] args)
          Create a new Boga server.
 void menuCanceled(javax.swing.event.MenuEvent evt)
           
 void menuDeselected(javax.swing.event.MenuEvent evt)
           
 void menuSelected(javax.swing.event.MenuEvent evt)
           
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Remembers the agent that was chosen from the list.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

strConfigFile

java.lang.String strConfigFile
Where the settings for the server are.

agentsPath

java.lang.String agentsPath
String from the properties file, that determines the directories which include the agents

agentPaths

java.lang.String[] agentPaths
The directories which include the agents

strIpServer

java.lang.String strIpServer
server that serves a valid IP address in case of dynamic IP addressing

menuBar

javax.swing.JMenuBar menuBar

mFile

javax.swing.JMenu mFile

miLoad

javax.swing.JMenuItem miLoad

miExit

javax.swing.JMenuItem miExit

mEdit

javax.swing.JMenu mEdit

miSendTo

javax.swing.JMenuItem miSendTo

miDestroy

javax.swing.JMenuItem miDestroy

mCreate

javax.swing.JMenu mCreate

miCreateHelloAgent

javax.swing.JMenuItem miCreateHelloAgent

miCreateHelloTraveler

javax.swing.JMenuItem miCreateHelloTraveler

miCreateReturnAgent

javax.swing.JMenuItem miCreateReturnAgent

miCreateCounter

javax.swing.JMenuItem miCreateCounter

miCreateExecuter

javax.swing.JMenuItem miCreateExecuter

miCreateMessageReceiver

javax.swing.JMenuItem miCreateMessageReceiver

miCreateMessageSender

javax.swing.JMenuItem miCreateMessageSender

miCreateReproducer

javax.swing.JMenuItem miCreateReproducer

mServer

javax.swing.JMenu mServer

miGoOnline

javax.swing.JMenuItem miGoOnline

miGoOffline

javax.swing.JMenuItem miGoOffline

fileChooser

javax.swing.JFileChooser fileChooser

panel

javax.swing.JPanel panel

list

javax.swing.JList list

listModel

javax.swing.DefaultListModel listModel

listScroller

javax.swing.JScrollPane listScroller

classManager

ClassManager classManager
Manages the byte codes of the loaded classes.

selectedKaariboga

java.lang.String selectedKaariboga
Name of the agent that was selected in the list.

kaaribogaBase

private KaaribogaBase kaaribogaBase
The base that handles all kaaribogas.

plugInManager

private KbPlugInManager plugInManager
PlugInManager to handle the loaded plug-ins

boServer

KaaribogaAddress boServer
Address of the server that registers all servers in domain.

ipServer

KaaribogaAddress ipServer
Address of the server that determines the IP address of this server in case of dynamic IP

port

int port
Port number for connections

localBaseAddress

KaaribogaAddress localBaseAddress
Address of the local Kaariboga base

props

java.util.Properties props
Properties defined in Boga.config
Constructor Detail

Boga

public Boga()
Create a new Boga server.
Method Detail

dispose

public void dispose()
Call for a proper clean up of the network connections.
Overrides:
dispose in class java.awt.Window

main

public static void main(java.lang.String[] args)
Create a new Boga server. Boga server is a swing based server with a nice look and feel.

menuCanceled

public void menuCanceled(javax.swing.event.MenuEvent evt)
Specified by:
menuCanceled in interface javax.swing.event.MenuListener

menuDeselected

public void menuDeselected(javax.swing.event.MenuEvent evt)
Specified by:
menuDeselected in interface javax.swing.event.MenuListener

menuSelected

public void menuSelected(javax.swing.event.MenuEvent evt)
Specified by:
menuSelected in interface javax.swing.event.MenuListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Handles the menu events
Specified by:
actionPerformed in interface java.awt.event.ActionListener

loadFromFile

public void loadFromFile()
Loads a kaariboga agent from a file

loadKaariboga

public void loadKaariboga(java.lang.String name)
Loads a kaariboga agent
Parameters:
name - classname of the agent, for example org.kaariboga.agents.HelloAgent

editSendTo

void editSendTo()
Sends the selected kaariboga to another base.

editDestroy

void editDestroy()
Destroys the selected kaariboga.

goOnline

void goOnline()
Causes the base to go online

goOffline

void goOffline()
Causes the base to go offline

createHelloAgent

void createHelloAgent()
Generates a HelloAgent and puts it to the base.

createHelloTraveler

void createHelloTraveler()
Generates a HelloTraveler and puts it to the base.

createReturnAgent

void createReturnAgent()
Creates a ReturnAgent and puts it to the base.

createCounter

void createCounter()
Creates a Counter and puts it to the base.

createExecuter

void createExecuter()
Creates an Executer and puts it to the base.

createMessageReceiver

void createMessageReceiver()
Creates a MessageReceiver and puts it to the base.

createMessageSender

void createMessageSender()
Creates an MessageSender and puts it to the base.

createReproducer

void createReproducer()
Creates an Reproducer and puts it to the base.

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Remembers the agent that was chosen from the list.
Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

baseKaaribogaCreated

public void baseKaaribogaCreated(BaseEvent e)
Reaction when a kaariboga agent has been put to a base and the base invoked the agent's onCreate method.
Specified by:
baseKaaribogaCreated in interface BaseListener

baseKaaribogaArrived

public void baseKaaribogaArrived(BaseEvent e)
Reaction when a kaariboga agent has arrived on the base or has been added on creation.
Specified by:
baseKaaribogaArrived in interface BaseListener

baseKaaribogaLeft

public void baseKaaribogaLeft(BaseEvent e)
Reaction when a kaariboga agent left the base.
Specified by:
baseKaaribogaLeft in interface BaseListener

baseKaaribogaDestroyed

public void baseKaaribogaDestroyed(BaseEvent e)
Reaction when a kaariboga agent has been destroyed.
Specified by:
baseKaaribogaDestroyed in interface BaseListener