You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2008/08/26 22:53:15 UTC
svn commit: r689220 - in /incubator/uima/sandbox/trunk/uima-as:
uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/
uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/details/
uimaj-ep-deployeditor/src/main/java/org/apache/u...
Author: schor
Date: Tue Aug 26 13:53:15 2008
New Revision: 689220
URL: http://svn.apache.org/viewvc?rev=689220&view=rev
Log:
[UIMA-1146] committed Tong's patches to support the scaleout options in the gui. Fixed one missing apache header in one new file.
Added:
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/GenericHoverManager.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/IGenericHoverOwner.java
Modified:
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/DeploymentDescriptorEditor.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/Messages.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/details/AEMetaDataDetailsPage.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/DDEInformationControl.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/resources/org/apache/uima/dde/internal/messages.properties
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentConstants.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentMetaData.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/RemoteAEDeploymentMetaData.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/AEDeploymentMetaData_Impl.java
incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/RemoteAEDeploymentMetaData_Impl.java
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/DeploymentDescriptorEditor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/DeploymentDescriptorEditor.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/DeploymentDescriptorEditor.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/DeploymentDescriptorEditor.java Tue Aug 26 13:53:15 2008
@@ -32,7 +32,6 @@
import org.apache.uima.dde.internal.page.OverviewPage;
import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.resource.metadata.Import;
-import org.apache.uima.taeconfigurator.Messages;
import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
import org.apache.uima.taeconfigurator.editors.MultiPageEditorContributor;
import org.apache.uima.taeconfigurator.editors.point.IUimaEditorExtension;
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/Messages.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/Messages.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/Messages.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/Messages.java Tue Aug 26 13:53:15 2008
@@ -80,9 +80,21 @@
static public String DDE_AEMetaDataDetails_QueueNameForRemote;
- static public String DDE_AEMetaDataDetails_NumberOfConsumers;
+ static public String DDE_RemoteReplyQueueScaleout; // for remote delegates
+ static public String DDE_InputQueueScaleout; // for input queue
+ static public String DDE_ReplyQueueListenersForCoLocated; // for co-located delegates
+
+ static public String Hover_Disable_NumberOfReplicatedInstances; // If disable, hover messages
+
+ static public String Hover_RemoteReplyQueueScaleout; // for remote delegates
+
+ static public String Hover_InputQueueScaleout; // for input queue
+
+ static public String Hover_ReplyQueueListenersForCoLocated; // for co-located delegates
+
+
/** ************************************************************************ */
private Messages() {
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/details/AEMetaDataDetailsPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/details/AEMetaDataDetailsPage.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/details/AEMetaDataDetailsPage.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/details/AEMetaDataDetailsPage.java Tue Aug 26 13:53:15 2008
@@ -30,6 +30,10 @@
import org.apache.uima.collection.CollectionReaderDescription;
import org.apache.uima.dde.internal.DeploymentDescriptorEditor;
import org.apache.uima.dde.internal.Messages;
+import org.apache.uima.dde.internal.hover.DDEInformationControl;
+import org.apache.uima.dde.internal.hover.GenericHoverManager;
+import org.apache.uima.dde.internal.hover.HoverManager;
+import org.apache.uima.dde.internal.hover.IGenericHoverOwner;
import org.apache.uima.dde.internal.page.MasterDetails;
import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.resource.metadata.MetaDataObject;
@@ -54,6 +58,9 @@
import org.eclipse.jface.fieldassist.DecoratedField;
import org.eclipse.jface.fieldassist.FieldDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
@@ -64,6 +71,8 @@
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -72,6 +81,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.AbstractFormPart;
@@ -136,6 +146,14 @@
private MetaDataObject currentMetaDataObject;
+ protected Label labelInputQueueScaleout;
+
+ protected Spinner inputQueueScaleout;
+
+ protected Label labelReplyQueueForCoLocated;
+
+ protected Spinner replyQueueListenersForCoLocated;
+
// For Remote Deployment
private DecoratedField brokerUrlDecoField;
@@ -152,7 +170,9 @@
protected CCombo remoteQueueLocation;
- protected Spinner replyQueueConsumers;
+ protected Label labelRemoteReplyQueueScaleout;
+
+ protected Spinner remoteReplyQueueScaleout;
protected Label serializerMethod;
@@ -204,8 +224,14 @@
} else if (e.getSource() == initialFsHeapSizeRemote) {
updateInitialFsHeapSize(initialFsHeapSizeRemote.getSelection());
- } else if (e.getSource() == replyQueueConsumers) {
- ((RemoteAEDeploymentMetaData) currentMetaDataObject).setReplyQueueConcurrentConsumers(replyQueueConsumers.getSelection());
+ } else if (e.getSource() == remoteReplyQueueScaleout) {
+ ((RemoteAEDeploymentMetaData) currentMetaDataObject).setRemoteReplyQueueScaleout(remoteReplyQueueScaleout.getSelection());
+
+ } else if (e.getSource() == inputQueueScaleout) {
+ ((AEDeploymentMetaData) currentMetaDataObject).setInputQueueScaleout(inputQueueScaleout.getSelection());
+
+ } else if (e.getSource() == replyQueueListenersForCoLocated) {
+ ((AEDeploymentMetaData) currentMetaDataObject).setInternalReplyQueueScaleout(replyQueueListenersForCoLocated.getSelection());
}
multiPageEditor.setFileDirty();
}
@@ -386,10 +412,50 @@
asMode.addSelectionListener(asynAggregateListener);
// <scaleout numberOfInstances="1"/> <!-- optional -->
+ Label labelScaleout = toolkit.createLabel(compositeCoLocatedSetting, Messages.DDE_AEMetaDataDetails_NumberOfReplicatedInstances);
scaleout = FormSection2.createLabelAndSpinner(toolkit, compositeCoLocatedSetting,
- Messages.DDE_AEMetaDataDetails_NumberOfReplicatedInstances, SWT.BORDER, 1, Integer.MAX_VALUE, false);
+ labelScaleout, SWT.BORDER, 1, Integer.MAX_VALUE, false);
scaleout.setSelection(1);
scaleout.addSelectionListener(asynAggregateListener);
+ GenericHoverManager hover = new GenericHoverManager(new IGenericHoverOwner() {
+ public void computeInformation(GenericHoverManager hoverManager, Point ptHoverEventLocation) {
+ if (!scaleout.isEnabled()) {
+ hoverManager.setDisplayedInformation(Messages.Hover_Disable_NumberOfReplicatedInstances,
+ new Rectangle(1, ptHoverEventLocation.y, 1, 1));
+ } else {
+ hoverManager.setDisplayedInformation(null, null);
+ }
+ }
+ }, getPresenterControlCreator("commandId"));
+ hover.install(labelScaleout);
+
+ labelInputQueueScaleout = toolkit.createLabel(compositeCoLocatedSetting, Messages.DDE_InputQueueScaleout);
+ inputQueueScaleout = FormSection2.createLabelAndSpinner(toolkit, compositeCoLocatedSetting,
+ labelInputQueueScaleout, SWT.BORDER, 1,
+ Integer.MAX_VALUE, false);
+ inputQueueScaleout.setSelection(1);
+ inputQueueScaleout.addSelectionListener(asynAggregateListener);
+ hover = new GenericHoverManager(new IGenericHoverOwner() {
+ public void computeInformation(GenericHoverManager hoverManager, Point ptHoverEventLocation) {
+ hoverManager.setDisplayedInformation(Messages.Hover_InputQueueScaleout,
+ new Rectangle(1, ptHoverEventLocation.y, 1, 1));
+ }
+ }, getPresenterControlCreator("commandId"));
+ hover.install(labelInputQueueScaleout);
+
+ labelReplyQueueForCoLocated = toolkit.createLabel(compositeCoLocatedSetting, Messages.DDE_ReplyQueueListenersForCoLocated);
+ replyQueueListenersForCoLocated = FormSection2.createLabelAndSpinner(toolkit, compositeCoLocatedSetting,
+ labelReplyQueueForCoLocated, SWT.BORDER, 1,
+ Integer.MAX_VALUE, false);
+ replyQueueListenersForCoLocated.setSelection(1);
+ replyQueueListenersForCoLocated.addSelectionListener(asynAggregateListener);
+ hover = new GenericHoverManager(new IGenericHoverOwner() {
+ public void computeInformation(GenericHoverManager hoverManager, Point ptHoverEventLocation) {
+ hoverManager.setDisplayedInformation(Messages.Hover_ReplyQueueListenersForCoLocated,
+ new Rectangle(1, ptHoverEventLocation.y, 1, 1));
+ }
+ }, getPresenterControlCreator("commandId"));
+ hover.install(labelReplyQueueForCoLocated);
// <casMultiplier poolSize="5"/> <!-- optional -->
casMultiplierLabel = toolkit.createLabel(compositeCoLocatedSetting,
@@ -444,12 +510,21 @@
decorationEndPoint.setDescription("The name of the queue cannot be empty");
endPointDecoField.addFieldDecoration(decorationEndPoint, SWT.LEFT | SWT.TOP, false);
- replyQueueConsumers = FormSection2.createLabelAndSpinner(toolkit, compositeRemoteSetting,
- Messages.DDE_AEMetaDataDetails_NumberOfConsumers, SWT.BORDER, 1,
- Integer.MAX_VALUE, false, FormSection2.MAX_DECORATION_WIDTH);
- replyQueueConsumers.setSelection(1);
- replyQueueConsumers.addSelectionListener(asynAggregateListener);
-
+ labelRemoteReplyQueueScaleout = toolkit.createLabel(compositeRemoteSetting, Messages.DDE_RemoteReplyQueueScaleout);
+ remoteReplyQueueScaleout = FormSection2.createLabelAndSpinner(toolkit, compositeRemoteSetting,
+ labelRemoteReplyQueueScaleout, SWT.BORDER, 1,
+ Integer.MAX_VALUE, false);
+ remoteReplyQueueScaleout.setSelection(1);
+ remoteReplyQueueScaleout.addSelectionListener(asynAggregateListener);
+ hover = new GenericHoverManager(new IGenericHoverOwner() {
+
+ public void computeInformation(GenericHoverManager hoverManager, Point ptHoverEventLocation) {
+ hoverManager.setDisplayedInformation(Messages.Hover_RemoteReplyQueueScaleout,
+ new Rectangle(1, ptHoverEventLocation.y, 1, 1));
+ }
+
+ }, getPresenterControlCreator("commandId"));
+ hover.install(labelRemoteReplyQueueScaleout);
// <casMultiplier poolSize="5"/> <!-- optional -->
casMultiplierLabelRemote = toolkit.createLabel(compositeRemoteSetting,
@@ -504,9 +579,19 @@
if (obj.isAsync()) {
scaleout.setSelection(1);
scaleout.setEnabled(false);
+ scaleout.setToolTipText("For AS Aggregate, only 1 instance is allowed.");
+ labelInputQueueScaleout.setVisible(true);
+ inputQueueScaleout.setVisible(true);
+ labelReplyQueueForCoLocated.setVisible(true);
+ replyQueueListenersForCoLocated.setVisible(true);
} else {
scaleout.setEnabled(true);
+ scaleout.setToolTipText(null);
scaleout.setSelection(obj.getNumberOfInstances());
+ labelInputQueueScaleout.setVisible(false);
+ inputQueueScaleout.setVisible(false);
+ labelReplyQueueForCoLocated.setVisible(false);
+ replyQueueListenersForCoLocated.setVisible(false);
}
ResourceSpecifier rs = obj.getResourceSpecifier();
@@ -538,6 +623,14 @@
} else {
asMode.setEnabled(true);
asMode.setSelection(obj.isAsync());
+ if (obj.isAsync()) {
+ if (obj.getInputQueueScaleout() > 0) {
+ inputQueueScaleout.setSelection(obj.getInputQueueScaleout());
+ }
+ if (obj.getInternalReplyQueueScaleout() > 0) {
+ replyQueueListenersForCoLocated.setSelection(obj.getInternalReplyQueueScaleout());
+ }
+ }
}
} else if (rs instanceof CollectionReaderDescription) {
// Handle as CAS Multiplier
@@ -614,9 +707,8 @@
endPoint.setText(obj.getInputQueue().getEndPoint());
}
- if (obj.getReplyQueueConcurrentConsumers() > 0) {
- replyQueueConsumers.setSelection(obj.getReplyQueueConcurrentConsumers());
- }
+ int n = obj.getRemoteReplyQueueScaleout() > 0 ? obj.getRemoteReplyQueueScaleout() : 1;
+ remoteReplyQueueScaleout.setSelection(n);
if (obj.getResourceSpecifier() != null) {
// Is AnalysisEngineDescription ?
@@ -669,6 +761,15 @@
FormMessage.setMessage(mform.getForm().getForm(), msg, msgType);
}
+ private IInformationControlCreator getPresenterControlCreator(final String commandId) {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, SWT.WRAP, null);
+ }
+ };
+ }
+
+
/** ********************************************************************** */
public void commit(boolean onSave) {
@@ -799,76 +900,14 @@
if (!toAsyncAggreagte) {
// Set CAS pool size to the number of instances
multiPageEditor.getOverviewPage().setCasPoolSize(metaData.getNumberOfInstances());
+
+ // Set number of listeners to default value (=1)
+ inputQueueScaleout.setSelection(1);
+ replyQueueListenersForCoLocated.setSelection(1);
}
masterPart.refresh();
multiPageEditor.setFileDirty();
}
-
- /** ********************************************************************** */
- /* Context Sensitive Pop-up Menu */
- /** ********************************************************************** */
-
- /**
- * Creates a pop-up menu on the given control
- *
- * @param menuControl
- * the control with which the pop-up menu will be associated
- */
- private void createContextMenu(Control menuControl) {
- MenuManager menuMgr = new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- });
- Menu menu = menuMgr.createContextMenu(menuControl);
- menuControl.setMenu(menu);
-
- // register the context menu such that other plugins may contribute to it
- //
- // __workbenchPartSite.registerContextMenu(menuMgr, _catTreeViewer);
- }
-
- /**
- * Adds items to the context menu
- *
- * @param menu
- * The menu to contribute to
- */
- protected void fillContextMenu(IMenuManager menu) {
- Action action = new Action() {
- public void run() {
- handleBrowseDD();
- }
- };
- action.setText("Browse DD ...");
- action.setEnabled(true);
- menu.add(action);
-
- } // fillContextMenu
-
- protected void handleBrowseDD() {
- IResource resource = WorkspaceResourceDialog.getWorkspaceResourceElement(multiPageEditor.cde.getEditorSite().getShell(),
- getWorkspaceRoot(), "Select UIMA deployment descriptor",
- "Select Analysis Engine's deployment descriptor file");
- if (resource != null) {
- XMLizable xmlizable = UimaApplication_Impl.parseUimaXmlDescriptor(resource.getLocation().toOSString());
- if (xmlizable == null || !(xmlizable instanceof AEDeploymentDescription_Impl)) {
- // Trace.err("xmlizable: " + xmlizable.getClass().getName());
- return;
- }
- AEService aeService = ((AEDeploymentDescription_Impl) xmlizable).getAeService();
- brokerUrl.setText(aeService.getBrokerURL());
- endPoint.setText(aeService.getEndPoint());
- }
- }
- /**
- * Convenience method to get the workspace root.
- */
- private IWorkspaceRoot getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
}
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/DDEInformationControl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/DDEInformationControl.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/DDEInformationControl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/DDEInformationControl.java Tue Aug 26 13:53:15 2008
@@ -263,8 +263,8 @@
+ (obj.getInputQueue() != null ? obj.getInputQueue().getBrokerURL() : "") + "</li>");
buf.append("<li><b>Queue Name:</b> "
+ (obj.getInputQueue() != null ? obj.getInputQueue().getEndPoint() : "") + "</li>");
- if (obj.getReplyQueueConcurrentConsumers() > 0) {
- buf.append("<li><b>Concurrent Consumers for reply queue:</b> " + obj.getReplyQueueConcurrentConsumers() + "</li>");
+ if (obj.getRemoteReplyQueueScaleout() > 0) {
+ buf.append("<li><b>Concurrent Consumers for reply queue:</b> " + obj.getRemoteReplyQueueScaleout() + "</li>");
}
// Error Config
toStringFromErrorConfig(buf, obj.getAsyncAEErrorConfiguration());
Added: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/GenericHoverManager.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/GenericHoverManager.java?rev=689220&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/GenericHoverManager.java (added)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/GenericHoverManager.java Tue Aug 26 13:53:15 2008
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.dde.internal.hover;
+
+import org.eclipse.jface.text.AbstractHoverInformationControlManager;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.TreeItem;
+
+public class GenericHoverManager extends AbstractHoverInformationControlManager {
+
+ // TODO Create a mapping from Control (used getSubjectControl()) to Owner
+ // so that this GenericHoverManager can be re-used with multiple controls.
+ private IGenericHoverOwner owner;
+
+ public GenericHoverManager(IGenericHoverOwner hoverOwner, IInformationControlCreator creator) {
+ super(creator);
+ this.owner = hoverOwner;
+ }
+
+ @Override
+ protected void computeInformation() {
+ Point pt = getHoverEventLocation();
+ // Call the hover owner to set the information to be shown
+ owner.computeInformation(this, pt);
+ }
+
+ /**
+ * Sets the parameters of the information to be displayed. These are the information
+ * itself and the area for which the given information is valid. This so called
+ * subject area is a graphical region of the information control's subject control.
+ * This method calls <code>presentInformation()</code>
+ * to trigger the presentation of the computed information.
+ *
+ * @param information the information
+ * @param subjectArea the subject area
+ */
+ public void setDisplayedInformation(Object information, Rectangle subjectArea) {
+ super.setInformation(information, subjectArea);
+ }
+
+}
Added: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/IGenericHoverOwner.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/IGenericHoverOwner.java?rev=689220&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/IGenericHoverOwner.java (added)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/hover/IGenericHoverOwner.java Tue Aug 26 13:53:15 2008
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.uima.dde.internal.hover;
+
+import org.eclipse.swt.graphics.Point;
+
+public interface IGenericHoverOwner {
+
+ public void computeInformation(GenericHoverManager hoverManager, Point ptHoverEventLocation);
+
+}
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java Tue Aug 26 13:53:15 2008
@@ -96,6 +96,7 @@
remoteMetaData.setParent(metaData.getParent());
remoteMetaData.setKey(metaData.getKey());
remoteMetaData.setCasMultiplierPoolSize(metaData.getCasMultiplierPoolSize());
+ remoteMetaData.setRemoteReplyQueueScaleout(-1);
try {
remoteMetaData.setResourceSpecifier(metaData.getResourceSpecifier(), null, false);
} catch (InvalidXMLException e) {
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/resources/org/apache/uima/dde/internal/messages.properties
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/resources/org/apache/uima/dde/internal/messages.properties?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/resources/org/apache/uima/dde/internal/messages.properties (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-deployeditor/src/main/resources/org/apache/uima/dde/internal/messages.properties Tue Aug 26 13:53:15 2008
@@ -36,9 +36,16 @@
DDE_AEMetaDataDetails_NumberOfReplicatedInstances = Number of replicated instances:
DDE_AEMetaDataDetails_BrokerURLForRemote = Broker URL for remote service:
DDE_AEMetaDataDetails_QueueNameForRemote = Queue name for remote service:
-DDE_AEMetaDataDetails_NumberOfConsumers = Number of consumers for reply queue:
DDE_AEMetaDataDetails_PoolSizeOfCM = Pool size of CasMultiplier:
DDE_AEMetaDataDetails_InitalSizeOfCASHeap = Initial size of CAS heap (in bytes):
+DDE_RemoteReplyQueueScaleout = Remote Reply Queue Scale-out:
+DDE_InputQueueScaleout = Input Queue Scale-out:
+DDE_ReplyQueueListenersForCoLocated = Internal Reply Queue Scale-out:
+
+Hover_Disable_NumberOfReplicatedInstances = Only 1 instance is allowed for AS aggregate.
+Hover_RemoteReplyQueueScaleout = Specify the number of reply queue listeners\nfor remote delegates. Normally set to 1.
+Hover_InputQueueScaleout = Specify the number of input queue listeners\nfor AS aggregate. Normally set to 1.
+Hover_ReplyQueueListenersForCoLocated = Specify the number of reply queue listeners\nfor co-located delegates. Normally set to 1.
# Wizard for Adding/Editing Environment Variable
DDE_EnvVariable_Wizard_Window_Title = Customization for C++ Analysis Engine
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentConstants.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentConstants.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentConstants.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentConstants.java Tue Aug 26 13:53:15 2008
@@ -89,8 +89,10 @@
final static public String TAG_IMPORT = "import";
final static public String TAG_REPLY_QUEUE = "replyQueue";
- final static public String TAG_ATTR_CONCURRENT_CONSUMERS = "concurrentConsumers";
-
+ final static public String TAG_ATTR_INPUT_QUEUE_SCALEOUT = "inputQueueScaleout";
+ final static public String TAG_ATTR_INTERNAL_REPLYQUEUE_SCALEOUT = "internalReplyQueueScaleout";
+ final static public String TAG_ATTR_REMOTE_REPLYQUEUE_SCALEOUT = "remoteReplyQueueScaleout";
+
final static public String TAG_SERIALIZER = "serializer";
final static public String TAG_ATTR_METHOD = "method";
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentMetaData.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentMetaData.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentMetaData.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/AEDeploymentMetaData.java Tue Aug 26 13:53:15 2008
@@ -72,6 +72,26 @@
* @return the numberOfInstances
*/
public int getNumberOfInstances();
+
+ /**
+ * Get the number of reply queue listeners for co-located delegates.
+ * (Only applicable if the AE is an Async Aggregate)
+ *
+ * @return int Number of listeners
+ */
+ public int getInputQueueScaleout();
+
+ public void setInputQueueScaleout(int numberOfListeners);
+
+ /**
+ * Get the number of reply queue listeners for co-located delegates.
+ * (Only applicable if the AE is an Async Aggregate)
+ *
+ * @return int Number of listeners
+ */
+ public int getInternalReplyQueueScaleout();
+
+ public void setInternalReplyQueueScaleout(int numberOfListeners);
/**
* @param numberOfInstances the numberOfInstances to set
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/RemoteAEDeploymentMetaData.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/RemoteAEDeploymentMetaData.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/RemoteAEDeploymentMetaData.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/RemoteAEDeploymentMetaData.java Tue Aug 26 13:53:15 2008
@@ -108,9 +108,14 @@
*/
public void setReplyQueueLocation(String replyQueueLocation);
- public int getReplyQueueConcurrentConsumers();
+ /**
+ * Get the number of reply queue listeners for remote delegates.
+ *
+ * @return int Number of listeners
+ */
+ public int getRemoteReplyQueueScaleout();
- public void setReplyQueueConcurrentConsumers(int concurrentConsumers);
+ public void setRemoteReplyQueueScaleout(int concurrentConsumers);
/**
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/AEDeploymentMetaData_Impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/AEDeploymentMetaData_Impl.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/AEDeploymentMetaData_Impl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/AEDeploymentMetaData_Impl.java Tue Aug 26 13:53:15 2008
@@ -106,6 +106,10 @@
protected ResourceSpecifier resourceSpecifier;
protected Import importedAE; // import by location|name of AE descriptor
+
+ protected int inputQueueScaleout = -1;
+
+ protected int internalReplyQueueScaleout = -1;
/** ********************************************************************** */
@@ -296,14 +300,58 @@
if (AEDeploymentConstants.TAG_ATTR_KEY.equalsIgnoreCase(name)) {
// Set "key = ..." attribute
setKey(val);
+
} else if (AEDeploymentConstants.TAG_ATTR_ASYNC.equalsIgnoreCase(name)) {
// Set "async =[yes|no]" attribute
setAsync(Boolean.parseBoolean(val));
+
+ } else if (AEDeploymentConstants.TAG_ATTR_INPUT_QUEUE_SCALEOUT.equalsIgnoreCase(name)) {
+ // Set "inputQueueScaleout =nnn" attribute
+ try {
+ int n = Integer.parseInt(val);
+ if (n > 0) {
+ setInputQueueScaleout(n);
+ } else {
+ throw new InvalidXMLException(InvalidXMLException.INVALID_ELEMENT_TEXT,
+ new Object[] { n, TAG_ATTR_INPUT_QUEUE_SCALEOUT });
+ }
+ } catch (NumberFormatException e) {
+ throw new InvalidXMLException(InvalidXMLException.UNKNOWN_ELEMENT,
+ new Object[] { TAG_ATTR_INPUT_QUEUE_SCALEOUT }, e);
+ }
+
+ } else if (AEDeploymentConstants.TAG_ATTR_INTERNAL_REPLYQUEUE_SCALEOUT.equalsIgnoreCase(name)) {
+ // Set "inputQueueScaleout =nnn" attribute
+ try {
+ int n = Integer.parseInt(val);
+ if (n > 0) {
+ setInternalReplyQueueScaleout(n);
+ } else {
+ throw new InvalidXMLException(InvalidXMLException.INVALID_ELEMENT_TEXT,
+ new Object[] { n, TAG_ATTR_INTERNAL_REPLYQUEUE_SCALEOUT });
+ }
+ } catch (NumberFormatException e) {
+ throw new InvalidXMLException(InvalidXMLException.UNKNOWN_ELEMENT,
+ new Object[] { TAG_ATTR_INTERNAL_REPLYQUEUE_SCALEOUT }, e);
+ }
+
} else {
throw new InvalidXMLException(InvalidXMLException.UNKNOWN_ELEMENT,
new Object[]{name});
}
}
+
+ // Check validity of queue listeners
+ if (!isAsync()) {
+ if (getInputQueueScaleout() > 1) {
+ throw new InvalidXMLException(InvalidXMLException.INVALID_ELEMENT_TEXT,
+ new Object[] { getInputQueueScaleout(), TAG_ATTR_INPUT_QUEUE_SCALEOUT });
+ }
+ if (getInternalReplyQueueScaleout() > 1) {
+ throw new InvalidXMLException(InvalidXMLException.INVALID_ELEMENT_TEXT,
+ new Object[] { getInternalReplyQueueScaleout(), TAG_ATTR_INTERNAL_REPLYQUEUE_SCALEOUT });
+ }
+ }
}
// Has "key = ..." attribute ?
@@ -492,6 +540,16 @@
attrs.addAttribute("", AEDeploymentConstants.TAG_ATTR_ASYNC,
AEDeploymentConstants.TAG_ATTR_ASYNC, null, Boolean.toString(isAsync()));
// }
+ if (inputQueueScaleout > 0) {
+ attrs.addAttribute("", AEDeploymentConstants.TAG_ATTR_INPUT_QUEUE_SCALEOUT,
+ AEDeploymentConstants.TAG_ATTR_INPUT_QUEUE_SCALEOUT, null,
+ "" + inputQueueScaleout);
+ }
+ if (internalReplyQueueScaleout > 0) {
+ attrs.addAttribute("", AEDeploymentConstants.TAG_ATTR_INTERNAL_REPLYQUEUE_SCALEOUT,
+ AEDeploymentConstants.TAG_ATTR_INTERNAL_REPLYQUEUE_SCALEOUT, null,
+ "" + internalReplyQueueScaleout);
+ }
aContentHandler.startElement("", AEDeploymentConstants.TAG_ANALYSIS_ENGINE,
AEDeploymentConstants.TAG_ANALYSIS_ENGINE, attrs);
attrs.clear();
@@ -626,6 +684,10 @@
public void setAsync(boolean async) {
issetAsync = true;
this.async = async;
+ if (!async) {
+ inputQueueScaleout = -1; // undefined
+ internalReplyQueueScaleout = -1; // undefined
+ }
}
/**
@@ -705,6 +767,22 @@
this.initialFsHeapSize = initialFsHeapSize;
}
+ public int getInputQueueScaleout() {
+ return inputQueueScaleout;
+ }
+
+ public int getInternalReplyQueueScaleout() {
+ return internalReplyQueueScaleout;
+ }
+
+ public void setInputQueueScaleout(int numberOfListeners) {
+ inputQueueScaleout = numberOfListeners;
+ }
+
+ public void setInternalReplyQueueScaleout(int numberOfListeners) {
+ internalReplyQueueScaleout = numberOfListeners;
+ }
+
/** ********************************************************************** */
}
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/RemoteAEDeploymentMetaData_Impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/RemoteAEDeploymentMetaData_Impl.java?rev=689220&r1=689219&r2=689220&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/RemoteAEDeploymentMetaData_Impl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-ep-runtime-deployeditor/src/main/java/org/apache/uima/aae/deployment/impl/RemoteAEDeploymentMetaData_Impl.java Tue Aug 26 13:53:15 2008
@@ -57,7 +57,7 @@
protected InputQueue inputQueue = new InputQueue_Impl();
protected String replyQueueLocation = null; // DEFAULT_REPLY_QUEUE_LOCATION; // NOT defined
- protected int replyQueueConsumers = -1; // DEFAULT_CONCURRENT_CONSUMERS; // NOT defined
+ protected int remoteReplyQueueScaleout = -1; // DEFAULT_CONCURRENT_CONSUMERS; // NOT defined
protected String serializerMethod = "xmi"; // NOT defined
protected AsyncAEErrorConfiguration errorConfiguration;
@@ -94,7 +94,7 @@
{
String val;
- // Check for "key" attribute
+ // Check for "key" and "remoteReplyQueueScaleout" attributes
NamedNodeMap map = aElement.getAttributes();
if (map != null) {
for (int i=0; i<map.getLength(); ++i) {
@@ -109,6 +109,21 @@
if (AEDeploymentConstants.TAG_ATTR_KEY.equalsIgnoreCase(name)) {
// Set "key = ..." attribute
setKey(val);
+ } else if (AEDeploymentConstants.TAG_ATTR_REMOTE_REPLYQUEUE_SCALEOUT.equalsIgnoreCase(name)) {
+ // "remoteReplyQueueScaleout" attribute
+ try {
+ int n = Integer.parseInt(val);
+ if (n > 0) {
+ setRemoteReplyQueueScaleout(n);
+ } else {
+ throw new InvalidXMLException(InvalidXMLException.INVALID_ELEMENT_TEXT,
+ new Object[] { n, TAG_ATTR_REMOTE_REPLYQUEUE_SCALEOUT });
+ }
+ } catch (NumberFormatException e) {
+ throw new InvalidXMLException(InvalidXMLException.UNKNOWN_ELEMENT,
+ new Object[] { TAG_ATTR_REMOTE_REPLYQUEUE_SCALEOUT }, e);
+ }
+
} else {
throw new InvalidXMLException(InvalidXMLException.UNKNOWN_ELEMENT,
new Object[]{name});
@@ -168,25 +183,6 @@
}
}
- int n;
- val = DDParserUtil.checkAndGetAttributeValue(TAG_REPLY_QUEUE, TAG_ATTR_CONCURRENT_CONSUMERS, elem, false);
- if (val == null || val.trim().length() == 0) {
- n = 1;
- } else {
- try {
- n = Integer.parseInt(val);
- if (n <= 0) {
- // n = 1;
- throw new InvalidXMLException(InvalidXMLException.INVALID_ELEMENT_TEXT,
- new Object[] { n, TAG_ATTR_CONCURRENT_CONSUMERS });
- }
- } catch (NumberFormatException e) {
- throw new InvalidXMLException(InvalidXMLException.UNKNOWN_ELEMENT,
- new Object[] { TAG_ATTR_CONCURRENT_CONSUMERS }, e);
- }
- }
- setReplyQueueConcurrentConsumers(n);
-
} else if (TAG_SERIALIZER.equalsIgnoreCase(elem.getTagName())) {
// setSerializerMethod(elem.getAttribute(TAG_ATTR_METHOD));
setSerializerMethod(DDParserUtil.checkAndGetAttributeValue(TAG_SERIALIZER, TAG_ATTR_METHOD, elem, true));
@@ -268,6 +264,10 @@
if (getKey() != null && getKey().trim().length() > 0) {
attrs.addAttribute("", TAG_ATTR_KEY, AEDeploymentConstants.TAG_ATTR_KEY, null, getKey());
}
+ if (remoteReplyQueueScaleout > 0) {
+ attrs.addAttribute("", TAG_ATTR_REMOTE_REPLYQUEUE_SCALEOUT, TAG_ATTR_REMOTE_REPLYQUEUE_SCALEOUT,
+ null, "" + remoteReplyQueueScaleout);
+ }
aContentHandler.startElement("", TAG_REMOTE_DELEGATE,
TAG_REMOTE_DELEGATE, attrs);
attrs.clear();
@@ -298,17 +298,11 @@
attrs.clear();
}
- // <replyQueue concurrentConsumers="1" location="[local|remote]"/> <!-- optional -->
+ // <replyQueue location="[local|remote]"/> <!-- optional -->
// Note: location="local" is NO longer support. Will be warned by DDE
- if (replyQueueConsumers > 1 || replyQueueLocation != null) {
- if (replyQueueConsumers > 1) {
- attrs.addAttribute("", TAG_ATTR_CONCURRENT_CONSUMERS, TAG_ATTR_CONCURRENT_CONSUMERS,
- null, "" + replyQueueConsumers);
- }
- if (replyQueueLocation != null) {
- attrs.addAttribute("", TAG_ATTR_LOCATION, TAG_ATTR_LOCATION,
+ if (replyQueueLocation != null) {
+ attrs.addAttribute("", TAG_ATTR_LOCATION, TAG_ATTR_LOCATION,
null, replyQueueLocation);
- }
aContentHandler.startElement("",
TAG_REPLY_QUEUE, TAG_REPLY_QUEUE, attrs);
aContentHandler.endElement("", "", TAG_REPLY_QUEUE);
@@ -439,12 +433,12 @@
this.initialFsHeapSize = initialFsHeapSize;
}
- public int getReplyQueueConcurrentConsumers() {
- return replyQueueConsumers;
+ public int getRemoteReplyQueueScaleout() {
+ return remoteReplyQueueScaleout;
}
- public void setReplyQueueConcurrentConsumers(int concurrentConsumers) {
- replyQueueConsumers = concurrentConsumers;
+ public void setRemoteReplyQueueScaleout(int concurrentConsumers) {
+ remoteReplyQueueScaleout = concurrentConsumers;
}