|
||||||||||
| 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
javax.swing.JPanel
jigcell.compare.ui.PanelTab
jigcell.compare.cellcycle.OAAConnector
public class OAAConnector
A connector allowing the Comparator to be controlled through OAA requests.
This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| 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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected java.lang.String |
agentName
Agent name to expose |
protected bsh.Interpreter |
beanshell
Interpreter for commands |
static java.lang.String |
CONFIG_AGENTNAME
Property key for agent name |
protected static java.lang.String[][] |
DISPATCH_ARGUMENTS
Argument lists for dispatch solvables |
protected static java.lang.String |
FUNCTION_DISPATCH
Start of function names for performing dispatches |
protected static java.lang.String |
FUNCTION_EXECUTE
Function name for executing a command |
protected static java.lang.String |
FUNCTION_SENDFILE
Function name for sending a file |
protected static java.lang.String |
FUNCTION_SENDFILEPART
Function name for sending part of a file |
protected com.sri.oaa2.lib.LibOaa |
myOaa
OAA connection |
protected static java.lang.String |
NAME_CALLBACK
Name of the OAA callback method |
protected static java.lang.String |
NAME_COMPARATOR
Name of the dispatch target for the Comparator |
protected static java.lang.String |
NAME_FACILITATOR
Name of the facilitator connection ID |
protected static java.lang.String |
NAME_FUNCTION
Prefix name of a dispatch function |
protected static java.lang.String |
NAME_VARIANT
Prefix name of a dispatch function with multiple variants |
protected java.util.Map |
partWriters
Currently open file parts |
protected static java.util.regex.Pattern |
PATTERN_DISPATCH
Pattern for matching a dispatch |
protected static java.util.regex.Pattern |
PATTERN_VARIANT
Pattern for matching a dispatch |
protected static java.lang.String |
SOLVABLE_EXECUTE
Solvable for executing a command |
protected static java.lang.String |
SOLVABLE_SENDFILE
Solvable for sending a file |
protected static java.lang.String |
SOLVABLE_SENDFILEPART
Solvable for sending part of a file |
protected static java.lang.String |
TOKEN_ENDTERM
Token marking the end of a term |
protected static java.lang.String |
TOKEN_NEXTTERM
Token marking the start of the next term |
protected static java.lang.String |
TOKEN_STARTTERM
Token marking the start of a term |
protected static java.lang.String |
VARIABLE_COMPARE
Variable to attach to compare |
protected static java.lang.String |
VARIABLE_INSTANCE
Variable to attach to a dispatch instance |
protected static java.lang.String |
VARIABLE_METHOD
Variable to attach to a dispatch method |
| Fields inherited from class jigcell.compare.ui.PanelTab |
|---|
compare, configMarkers, PATH_ABOUT, PATH_DESCRIPTION_ABOUT, tabName |
| 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 jigcell.compare.ITab |
|---|
CONFIG_TABNAME, STATE_ENDINITIALIZE, STATE_ENDUI, STATE_INITIALIZE, STATE_RUNNING, STATES |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
OAAConnector(Compare compare,
java.lang.String configMarker)
Creates a new connector for receiving commands from OAA. |
|
| Method Summary | |
|---|---|
protected java.lang.StringBuffer |
buildDispatch(int args,
java.lang.String target,
java.lang.String functor)
Constructs a new dispatch solvable. |
protected java.lang.StringBuffer |
computeDispatches(java.util.Set dispatchNames,
java.lang.String prefix,
java.lang.Object o)
Constructs a list of dispatch solvables that can be accessed from an object. |
static com.sri.oaa2.lib.LibOaa |
connect(java.lang.String agentName)
Creates an OAA connection suitable for sending commands through an OAAConnector. |
static com.sri.oaa2.icl.IclList |
dispatch(com.sri.oaa2.lib.LibOaa myOaa,
java.lang.String command,
java.lang.String input,
java.lang.String output)
Dispatches a command through an OAAConnector. |
protected boolean |
doDispatch(java.lang.String functor,
com.sri.oaa2.icl.IclTerm goal,
com.sri.oaa2.icl.IclTerm answer)
Performs a function dispatch in this Comparator. |
protected boolean |
doExecute(com.sri.oaa2.icl.IclTerm goal,
com.sri.oaa2.icl.IclTerm answer)
Executes a command in this Comparator. |
boolean |
doOAAEvent(com.sri.oaa2.icl.IclTerm goal,
com.sri.oaa2.icl.IclList params,
com.sri.oaa2.icl.IclList answers)
|
protected boolean |
doSendFile(com.sri.oaa2.icl.IclTerm goal,
com.sri.oaa2.icl.IclTerm answer,
boolean part)
Receives a file or part. |
static com.sri.oaa2.icl.IclList |
execute(com.sri.oaa2.lib.LibOaa myOaa,
java.lang.String command)
Executes a command through an OAAConnector. |
protected java.lang.Object |
findInstanceForDispatch(java.lang.String tabName)
Finds the object that should be dispatched against from the tab name or null if no object can be found. |
protected java.lang.reflect.Method |
findMethodForDispatch(java.lang.Object instance,
java.lang.String methodName)
Finds the method that should be dispatched against from the dispatch instance and method name or null if no method can be found. |
protected void |
initialize()
Performs any initialization work for the view. |
protected java.lang.String |
mungeTabName(java.lang.String name)
Converts a tab name into a solvable friendly form. |
protected void |
oaaConnect()
Creates the OAA connection. |
protected void |
oaaDisconnect()
Destroys the OAA connection. |
protected void |
oaaDisconnect(java.lang.String message,
java.lang.Exception cause)
Destroys the OAA connection. |
static com.sri.oaa2.icl.IclList |
sendFile(com.sri.oaa2.lib.LibOaa myOaa,
java.lang.String name,
java.lang.String file)
Sends a file through an OAAConnector. |
protected static com.sri.oaa2.icl.IclList |
solve(com.sri.oaa2.lib.LibOaa myOaa,
com.sri.oaa2.icl.IclTerm goal)
Requests an OAA solvable. |
| Methods inherited from class jigcell.compare.ui.PanelTab |
|---|
createAboutDialog, createAboutDialogForTab, createConfigEditor, createMenus, createTools, createUI, getCompare, getConfigForView, getConfigMarkers, getHostIdentifier, getName, propertyChange, readConfiguration |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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 |
| 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, 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, 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, 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, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CONFIG_AGENTNAME
protected static final java.util.regex.Pattern PATTERN_DISPATCH
protected static final java.util.regex.Pattern PATTERN_VARIANT
protected static final java.lang.String[][] DISPATCH_ARGUMENTS
protected static final java.lang.String FUNCTION_DISPATCH
protected static final java.lang.String FUNCTION_EXECUTE
protected static final java.lang.String FUNCTION_SENDFILE
protected static final java.lang.String FUNCTION_SENDFILEPART
protected static final java.lang.String NAME_CALLBACK
protected static final java.lang.String NAME_COMPARATOR
protected static final java.lang.String NAME_FACILITATOR
protected static final java.lang.String NAME_FUNCTION
protected static final java.lang.String NAME_VARIANT
protected static final java.lang.String SOLVABLE_EXECUTE
protected static final java.lang.String SOLVABLE_SENDFILE
protected static final java.lang.String SOLVABLE_SENDFILEPART
protected static final java.lang.String TOKEN_ENDTERM
protected static final java.lang.String TOKEN_NEXTTERM
protected static final java.lang.String TOKEN_STARTTERM
protected static final java.lang.String VARIABLE_COMPARE
protected static final java.lang.String VARIABLE_INSTANCE
protected static final java.lang.String VARIABLE_METHOD
protected bsh.Interpreter beanshell
protected com.sri.oaa2.lib.LibOaa myOaa
protected java.util.Map partWriters
protected java.lang.String agentName
| Constructor Detail |
|---|
public OAAConnector(Compare compare,
java.lang.String configMarker)
compare - Comparator backend to interface withconfigMarker - Marker for retrieving configuration information from Comparator backend| Method Detail |
|---|
public static com.sri.oaa2.lib.LibOaa connect(java.lang.String agentName)
agentName - Name that other OAA clients will see you as
public static com.sri.oaa2.icl.IclList dispatch(com.sri.oaa2.lib.LibOaa myOaa,
java.lang.String command,
java.lang.String input,
java.lang.String output)
myOaa - OAA librarycommand - Dispatch commandinput - List of input variables or null if noneoutput - Name of output variable or null if none
public static com.sri.oaa2.icl.IclList execute(com.sri.oaa2.lib.LibOaa myOaa,
java.lang.String command)
myOaa - OAA librarycommand - Command
public static com.sri.oaa2.icl.IclList sendFile(com.sri.oaa2.lib.LibOaa myOaa,
java.lang.String name,
java.lang.String file)
myOaa - OAA libraryname - File namefile - File contents
protected static com.sri.oaa2.icl.IclList solve(com.sri.oaa2.lib.LibOaa myOaa,
com.sri.oaa2.icl.IclTerm goal)
myOaa - OAA librarygoal - Goal
public boolean doOAAEvent(com.sri.oaa2.icl.IclTerm goal,
com.sri.oaa2.icl.IclList params,
com.sri.oaa2.icl.IclList answers)
doOAAEvent in interface com.sri.oaa2.lib.OAAEventListener
protected java.lang.StringBuffer buildDispatch(int args,
java.lang.String target,
java.lang.String functor)
args - Number of optional argumentstarget - Dispatch target namefunctor - Function name and argument list
protected java.lang.StringBuffer computeDispatches(java.util.Set dispatchNames,
java.lang.String prefix,
java.lang.Object o)
dispatchNames - Existing list of dispatch namesprefix - Prefix for object solvable nameso - Object
protected boolean doDispatch(java.lang.String functor,
com.sri.oaa2.icl.IclTerm goal,
com.sri.oaa2.icl.IclTerm answer)
functor - Munged function name to dispatchgoal - OAA goalanswer - Response to command
protected boolean doExecute(com.sri.oaa2.icl.IclTerm goal,
com.sri.oaa2.icl.IclTerm answer)
goal - OAA goalanswer - Response to command
protected boolean doSendFile(com.sri.oaa2.icl.IclTerm goal,
com.sri.oaa2.icl.IclTerm answer,
boolean part)
goal - OAA goalanswer - Response to commandpart - Whether this is a part or complete fileprotected java.lang.Object findInstanceForDispatch(java.lang.String tabName)
tabName - Tab name
protected java.lang.reflect.Method findMethodForDispatch(java.lang.Object instance,
java.lang.String methodName)
instance - Dispatch instancemethodName - Method nameprotected void initialize()
initialize in class PanelTabprotected java.lang.String mungeTabName(java.lang.String name)
name - Tab nameprotected void oaaConnect()
protected void oaaDisconnect()
protected void oaaDisconnect(java.lang.String message,
java.lang.Exception cause)
message - Information message about error situationcause - Why the connection is being destroyed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||