org.apache.excalibur.instrument.client
Class InstrumentManagerConnection

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byorg.apache.excalibur.instrument.client.InstrumentManagerConnection
All Implemented Interfaces:
java.awt.image.ImageObserver, LogEnabled, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable
Direct Known Subclasses:
HTTPInstrumentManagerConnection

public abstract class InstrumentManagerConnection
extends javax.swing.JComponent
implements LogEnabled, java.lang.Runnable

A Connection to the remote InstrumentManager.

Since:
4.1
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:23 $
Author:
Avalon Development Team
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
InstrumentManagerConnection()
          Creates a new InstrumentManagerConnection.
 
Method Summary
 void enableLogging(Logger logger)
          Provide component with a logger.
abstract  InstrumentManagerData getInstrumentManager()
          Returns the Instrument Manager.
abstract  java.lang.Object getKey()
          Returns the key used to identify this object.
protected  InstrumentManagerConnectionListener[] getListenerArray()
          Get a threadsafe array of the current listeners avoiding synchronization when possible.
protected  Logger getLogger()
           
protected  InstrumentSampleFrame[] getSampleFrameArray()
          Returns a thread save array representation of the InstrumentSampleFrames.
 java.lang.String getTabTitle()
          Returns the title to display in the tab for the connection.
 java.lang.String getTabTooltip()
          Returns the tooltip to display in the tab for the connection.
 java.lang.String getTitle()
          Returns the title for the connection.
 void init()
          Called to initialize the connection object.
protected abstract  void invokeGC()
          Invokes GC on the JVM running the InstrumentManager.
abstract  boolean isConnected()
          Returns true if connected.
 boolean isDeleted()
          Returns true once the connection has been deleted.
 void loadState(Configuration state)
          Loads the state from a Configuration object.
 void run()
           
 Configuration saveState()
          Saves the current state into a Configuration.
 java.lang.String toString()
          Returns a string representation of the connection.
 void update()
          Causes the InstrumentManagerConnection to update itself with the latest data from the server.
 void updateSampleFrames()
          Updates all registered SampleFrames with the latest data from the server.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstrumentManagerConnection

public InstrumentManagerConnection()
Creates a new InstrumentManagerConnection.

Method Detail

enableLogging

public void enableLogging(Logger logger)
Description copied from interface: LogEnabled
Provide component with a logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
logger - the logger. Must not be null.

getLogger

protected Logger getLogger()

run

public void run()
Specified by:
run in interface java.lang.Runnable

init

public void init()
Called to initialize the connection object.


isDeleted

public boolean isDeleted()
Returns true once the connection has been deleted.

Returns:
True if deleted.

getTabTitle

public java.lang.String getTabTitle()
Returns the title to display in the tab for the connection.

Returns:
The tab title.

getTabTooltip

public java.lang.String getTabTooltip()
Returns the tooltip to display in the tab for the connection.

Returns:
The tab tooltip.

getTitle

public java.lang.String getTitle()
Returns the title for the connection.

Returns:
The title.

getKey

public abstract java.lang.Object getKey()
Returns the key used to identify this object.

Returns:
The key used to identify this object.

isConnected

public abstract boolean isConnected()
Returns true if connected.

Returns:
True if connected.

getInstrumentManager

public abstract InstrumentManagerData getInstrumentManager()
Returns the Instrument Manager.

Returns:
The Instrument Manager.

update

public void update()
Causes the InstrumentManagerConnection to update itself with the latest data from the server. Called by the updateConnection method.


invokeGC

protected abstract void invokeGC()
Invokes GC on the JVM running the InstrumentManager.


saveState

public Configuration saveState()
Saves the current state into a Configuration.

Returns:
The state as a Configuration.

loadState

public void loadState(Configuration state)
               throws ConfigurationException
Loads the state from a Configuration object.

Parameters:
state - Configuration object to load state from.
Throws:
ConfigurationException - If there were any problems loading the state.

updateSampleFrames

public void updateSampleFrames()
Updates all registered SampleFrames with the latest data from the server. The status of all Sample Frames is also handled by this method, so it must handle disconnected connections and missing or expired samples correctly.


getListenerArray

protected InstrumentManagerConnectionListener[] getListenerArray()
Get a threadsafe array of the current listeners avoiding synchronization when possible. The contents of the returned array will never change.

Returns:
An array of the currently registered listeners

getSampleFrameArray

protected InstrumentSampleFrame[] getSampleFrameArray()
Returns a thread save array representation of the InstrumentSampleFrames.

Returns:
A thread save array representation of the InstrumentSampleFrames.

toString

public java.lang.String toString()
Returns a string representation of the connection.



Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.