|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.apache.excalibur.instrument.client.InstrumentManagerConnection
public abstract class InstrumentManagerConnection
A Connection to the remote InstrumentManager.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private boolean |
m_deleted
|
private javax.swing.JLabel |
m_descriptionLabel
|
private InstrumentClientFrame |
m_frame
|
private long |
m_lastLeaseRenewalTime
|
private InstrumentManagerConnectionListener[] |
m_listenerArray
|
private java.util.List |
m_listeners
|
private org.apache.avalon.framework.logger.Logger |
m_logger
|
private MaintainedSampleLease[] |
m_maintainedSampleLeaseArray
|
private java.util.HashMap |
m_maintainedSampleLeaseMap
|
private java.lang.Thread |
m_runner
|
private InstrumentSampleFrame[] |
m_sampleFrameArray
|
private java.util.Map |
m_sampleFrames
Maintain a list of all sample frames which are viewing data in this connection. |
private InstrumentManagerTree |
m_tree
|
private InstrumentManagerTreeModel |
m_treeModel
|
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 | |
---|---|
(package private) void |
addInstrumentManagerConnectionListener(InstrumentManagerConnectionListener listener)
Adds a InstrumentManagerConnectionListener to the list of listeners which receive state updates of the connection. |
private void |
addSampleFrame(java.lang.String sampleName,
InstrumentSampleFrame sampleFrame)
Adds a single sample frame. |
(package private) void |
delete()
Called when the connection should be closed and then deleted along with any frames and resources that are associated with it. |
void |
enableLogging(org.apache.avalon.framework.logger.Logger logger)
|
(package private) InstrumentClientFrame |
getFrame()
Returns a reference to the client frame. |
abstract InstrumentManagerData |
getInstrumentManager()
Returns the Instrument Manager. |
(package private) javax.swing.tree.DefaultMutableTreeNode |
getInstrumentSampleTreeNode(java.lang.String sampleName)
|
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 org.apache.avalon.framework.logger.Logger |
getLogger()
|
(package private) MaintainedSampleLease |
getMaintainedSampleLease(java.lang.String sampleName)
Returns a MaintainedSampleLease given a name if the sample is being maintained. |
private MaintainedSampleLease[] |
getMaintainedSampleLeaseArray()
Returns a thread save array representation of the MaintainedSampleLeases. |
private InstrumentSampleFrame |
getSampleFrame(java.lang.String sampleName)
Returns a sample frame given a sample name. |
protected InstrumentSampleFrame[] |
getSampleFrameArray()
Returns a thread save array representation of the InstrumentSampleFrames. |
(package private) InstrumentSampleSnapshotData |
getSampleSnapshot(java.lang.String sampleName)
Returns a snapshot of the specified sample. |
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. |
(package private) InstrumentManagerTreeModel |
getTreeModel()
Returns the TreeModel which contains the entire Instrument tree for this connection. |
(package private) void |
handleLeasedSamples()
Called once each second by the main worker thread of the client. |
(package private) void |
hideSampleFrame(InstrumentSampleFrame sampleFrame)
Called when a Sample Frame is closed. |
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. |
(package private) void |
loadSampleFrame(org.apache.avalon.framework.configuration.Configuration sampleFrameState)
Loads an InstrumentSampleFrame from a saved state. |
void |
loadState(org.apache.avalon.framework.configuration.Configuration state)
Loads the state from a Configuration object. |
(package private) void |
removeInstrumentManagerConnectionListener(InstrumentManagerConnectionListener listener)
Removes a InstrumentManagerConnectionListener from the list of listeners which receive state updates of the connection. |
private void |
removeSampleFrame(java.lang.String sampleName)
Removes a single sample frame. |
void |
run()
|
org.apache.avalon.framework.configuration.Configuration |
saveState()
Saves the current state into a Configuration. |
(package private) void |
setFrame(InstrumentClientFrame frame)
Stores a reference to the client frame. |
(package private) void |
showCreateSampleDialog(InstrumentData instrumentData)
Create a new Sample assigned to the specified instrument data. |
(package private) void |
startMaintainingSample(java.lang.String instrumentName,
int type,
long interval,
int size,
long leaseDuration,
java.lang.String description)
Start maintaining the lease for an instrument sample which already exists. |
(package private) void |
stopMaintainingSample(java.lang.String sampleName)
Stop maintaining the lease for an instrument sample which already exists. |
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. |
(package private) void |
viewSample(java.lang.String sampleName)
Displays a frame for the given sample. |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private org.apache.avalon.framework.logger.Logger m_logger
private InstrumentManagerTreeModel m_treeModel
private InstrumentManagerTree m_tree
private InstrumentClientFrame m_frame
private boolean m_deleted
private java.lang.Thread m_runner
private javax.swing.JLabel m_descriptionLabel
private final java.util.List m_listeners
private InstrumentManagerConnectionListener[] m_listenerArray
private long m_lastLeaseRenewalTime
private java.util.HashMap m_maintainedSampleLeaseMap
private MaintainedSampleLease[] m_maintainedSampleLeaseArray
private java.util.Map m_sampleFrames
private InstrumentSampleFrame[] m_sampleFrameArray
Constructor Detail |
---|
public InstrumentManagerConnection()
Method Detail |
---|
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging
in interface org.apache.avalon.framework.logger.LogEnabled
protected org.apache.avalon.framework.logger.Logger getLogger()
public void run()
run
in interface java.lang.Runnable
final void setFrame(InstrumentClientFrame frame)
frame
- The main client frame.final InstrumentClientFrame getFrame()
public void init()
public boolean isDeleted()
public java.lang.String getTabTitle()
public java.lang.String getTabTooltip()
public java.lang.String getTitle()
public abstract java.lang.Object getKey()
public abstract boolean isConnected()
public abstract InstrumentManagerData getInstrumentManager()
public void update()
protected abstract void invokeGC()
public org.apache.avalon.framework.configuration.Configuration saveState()
public void loadState(org.apache.avalon.framework.configuration.Configuration state) throws org.apache.avalon.framework.configuration.ConfigurationException
state
- Configuration object to load state from.
org.apache.avalon.framework.configuration.ConfigurationException
- If there were any problems loading the
state.public void updateSampleFrames()
InstrumentManagerTreeModel getTreeModel()
javax.swing.tree.DefaultMutableTreeNode getInstrumentSampleTreeNode(java.lang.String sampleName)
void addInstrumentManagerConnectionListener(InstrumentManagerConnectionListener listener)
listener
- InstrumentManagerConnectionListener to start receiving
state updates.void removeInstrumentManagerConnectionListener(InstrumentManagerConnectionListener listener)
listener
- InstrumentManagerConnectionListener to stop receiving
state updates.protected InstrumentManagerConnectionListener[] getListenerArray()
InstrumentSampleSnapshotData getSampleSnapshot(java.lang.String sampleName)
Returns
- a snapshot of the specified sample.private InstrumentSampleFrame getSampleFrame(java.lang.String sampleName)
sampleName
- Name of the sample requested.
private void addSampleFrame(java.lang.String sampleName, InstrumentSampleFrame sampleFrame)
private void removeSampleFrame(java.lang.String sampleName)
protected InstrumentSampleFrame[] getSampleFrameArray()
void loadSampleFrame(org.apache.avalon.framework.configuration.Configuration sampleFrameState) throws org.apache.avalon.framework.configuration.ConfigurationException
sampleFrameState
- Saved state of the frame to load.
org.apache.avalon.framework.configuration.ConfigurationException
- If there are any problems with the state.void viewSample(java.lang.String sampleName)
sampleName
- Name of the sample to display.void delete()
void hideSampleFrame(InstrumentSampleFrame sampleFrame)
void startMaintainingSample(java.lang.String instrumentName, int type, long interval, int size, long leaseDuration, java.lang.String description)
instrumentName
- The full name of the instrument whose sample is
to be created or updated.type
- The type of sample to be created.interval
- Sample interval of the new sample.size
- Number of samples in the new sample.leaseDuration
- Length of the lease to maintain in milliseconds.description
- Description to assign to the new sample.void stopMaintainingSample(java.lang.String sampleName)
MaintainedSampleLease getMaintainedSampleLease(java.lang.String sampleName)
sampleName
- Name of the sample being requested.
private MaintainedSampleLease[] getMaintainedSampleLeaseArray()
void handleLeasedSamples()
void showCreateSampleDialog(InstrumentData instrumentData)
instrumentData
- Instrument to add a sample to.public java.lang.String toString()
toString
in class java.awt.Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |