You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2008/02/12 17:06:59 UTC
svn commit: r620839 - in /activemq/camel/trunk/components/camel-uface: ./
src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/camel/
src/main/java/org/apache/camel/component.uface/ src/main/java/org/apach...
Author: jstrachan
Date: Tue Feb 12 08:06:52 2008
New Revision: 620839
URL: http://svn.apache.org/viewvc?rev=620839&view=rev
Log:
added a simple UFace component for browsing endpoints in Swing / JFace / Eclipse
Added:
activemq/camel/trunk/components/camel-uface/
activemq/camel/trunk/components/camel-uface/pom.xml (with props)
activemq/camel/trunk/components/camel-uface/src/
activemq/camel/trunk/components/camel-uface/src/main/
activemq/camel/trunk/components/camel-uface/src/main/java/
activemq/camel/trunk/components/camel-uface/src/main/java/org/
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java (with props)
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceComponent.java (with props)
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java (with props)
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/Main.java (with props)
activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java (with props)
activemq/camel/trunk/components/camel-uface/src/main/resources/
activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/
activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/
activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/
activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/
activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/
activemq/camel/trunk/components/camel-uface/src/main/resources/META-INF/services/org/apache/camel/component/
activemq/camel/trunk/components/camel-uface/src/test/
activemq/camel/trunk/components/camel-uface/src/test/java/
activemq/camel/trunk/components/camel-uface/src/test/java/org/
activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/
activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/
activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/
activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java (with props)
activemq/camel/trunk/components/camel-uface/src/test/resources/
activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/
activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/spring/
activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/spring/camel.xml (with props)
activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties (with props)
Added: activemq/camel/trunk/components/camel-uface/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/pom.xml?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/pom.xml (added)
+++ activemq/camel/trunk/components/camel-uface/pom.xml Tue Feb 12 08:06:52 2008
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-parent</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-uface</artifactId>
+ <packaging>bundle</packaging>
+ <name>Camel :: UFace</name>
+ <description>Camel UFace support</description>
+
+ <properties>
+ <camel.osgi.export.pkg>org.apache.camel.component.uface*</camel.osgi.export.pkg>
+ <uface-version>1.0-SNAPSHOT</uface-version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.ufacekit</groupId>
+ <artifactId>org.ufacekit.ui</artifactId>
+ <version>${uface-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.ufacekit</groupId>
+ <artifactId>org.ufacekit.ui.beanform</artifactId>
+ <version>${uface-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.ufacekit</groupId>
+ <artifactId>org.ufacekit.ui.swing</artifactId>
+ <version>${uface-version}</version>
+ </dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <!-- allows the example to be ran via 'mvn compile exec:java' -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.apache.camel.component.uface.swing.Main</mainClass>
+ <includePluginDependencies>false</includePluginDependencies>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
Propchange: activemq/camel/trunk/components/camel-uface/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java (added)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java Tue Feb 12 08:06:52 2008
@@ -0,0 +1,151 @@
+/**
+ *
+ * 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.camel.component.uface;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.DelegateLifecycleStrategy;
+import org.apache.camel.spi.BrowsableEndpoint;
+import org.apache.camel.util.CamelContextHelper;
+import org.apache.camel.util.ObjectHelper;
+import org.eclipse.core.databinding.observable.Realm;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.observable.value.WritableValue;
+import org.ufacekit.model.ModelHelper;
+import org.ufacekit.ui.AttributeDescriptor;
+import org.ufacekit.ui.UIComposite;
+import org.ufacekit.ui.UIFactory;
+import org.ufacekit.ui.beanform.BeanForm;
+import org.ufacekit.ui.controls.CellLabelProvider;
+import org.ufacekit.ui.controls.UITable;
+import org.ufacekit.ui.controls.UITableColumn;
+import org.ufacekit.ui.layouts.GridLayoutData;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class UFaceBrowser {
+ private final DefaultCamelContext camelContext;
+ private IObservableList endpoints;
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
+
+ public UFaceBrowser(DefaultCamelContext camelContext) {
+ ObjectHelper.notNull(camelContext, "camelContext");
+
+ this.camelContext = camelContext;
+ this.endpoints = new WritableList(Realm.getDefault());
+
+ // lets add any endpoints already added
+ List<BrowsableEndpoint> list = CamelContextHelper.getSingletonEndpoints(camelContext, BrowsableEndpoint.class);
+ for (BrowsableEndpoint endpoint : list) {
+ if (!endpoints.contains(endpoint)) {
+ endpoints.add(endpoint);
+ }
+ }
+
+ camelContext.setLifecycleStrategy(new DelegateLifecycleStrategy(camelContext.getLifecycleStrategy()) {
+ @Override
+ public void onEndpointAdd(Endpoint<? extends Exchange> endpoint) {
+ super.onEndpointAdd(endpoint);
+
+ if (endpoint instanceof BrowsableEndpoint) {
+ onBrowsableEndpoint((BrowsableEndpoint) endpoint);
+ }
+ }
+ });
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ public IObservableList getEndpoints() {
+ return endpoints;
+ }
+
+ public DefaultCamelContext getCamelContext() {
+ return camelContext;
+ }
+
+ public void createBrowserUI(UIComposite root) {
+ UIFactory ui = root.getFactory();
+ UIComposite splitter = ui.newHorizontalSplitPanel(root, new GridLayoutData(GridLayoutData.ALIGN_CENTER, GridLayoutData.ALIGN_CENTER));
+
+ UITable tree = createEndpointTableUI(splitter);
+
+ BeanForm selectionForm = new BeanForm();
+
+/*
+ UIComposite detailComposite = ui.newComposite(splitter, null, ui.newGridLayout(1));
+
+ ui.newLabel(detailComposite, new UILabel.LabelUIInfo(new GridLayoutData(GridLayoutData.ALIGN_END, GridLayoutData.ALIGN_CENTER))).setText("Exchanges");
+*/
+
+ UITable table = ui.newTable(splitter, new UITable.TableUIInfo(new GridLayoutData(GridLayoutData.ALIGN_FILL, GridLayoutData.ALIGN_FILL, true, true)),
+ new UITable.TableBindingInfo(selectionForm,
+ selectionForm.detailList("exchanges", Collection.class)));
+ ui.newTableColumn(table, new UITableColumn.TableColumnUIInfo(null, new CellLabelProvider() {
+ public String getLabel(Object object) {
+ Exchange exchange = (Exchange) object;
+ return exchange.getIn().getBody(String.class);
+ }
+ }));
+ ui.newTableColumn(table, new UITableColumn.TableColumnUIInfo(null, new CellLabelProvider() {
+ public String getLabel(Object object) {
+ Exchange exchange = (Exchange) object;
+ return exchange.getIn().getHeaders().toString();
+ }
+ }));
+
+ selectionForm.bind(tree.getSelectionObservable());
+ }
+
+ protected UITable createEndpointTableUI(UIComposite root) {
+ BeanForm form = new BeanForm();
+
+ UIFactory ui = root.getFactory();
+ AttributeDescriptor bindingData = form.detailList("endpoints", Collection.class);
+
+ UITable table = ui.newTable(root, new UITable.TableUIInfo(null), new UITable.TableBindingInfo(form, bindingData));
+ ui.newTableColumn(table, new UITableColumn.TableColumnUIInfo(null, new CellLabelProvider() {
+ public String getLabel(Object object) {
+ BrowsableEndpoint endpoint = (BrowsableEndpoint) object;
+ return endpoint.getEndpointUri();
+ }
+ }));
+
+ WritableValue value = ModelHelper.createWritableValue(this);
+ form.bind(value);
+ return table;
+ }
+
+ protected void onBrowsableEndpoint(BrowsableEndpoint endpoint) {
+ endpoints.add(endpoint);
+ }
+}
Propchange: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceBrowser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceComponent.java?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceComponent.java (added)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceComponent.java Tue Feb 12 08:06:52 2008
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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.camel.component.uface;
+
+import java.util.Map;
+
+import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.Endpoint;
+import org.apache.camel.component.list.ListEndpoint;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class UFaceComponent extends DefaultComponent {
+ protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+ return new UFaceEndpoint(uri, this);
+ }
+}
Propchange: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java (added)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java Tue Feb 12 08:06:52 2008
@@ -0,0 +1,40 @@
+/**
+ *
+ * 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.camel.component.uface;
+
+import java.util.List;
+
+import org.apache.camel.component.list.ListEndpoint;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Component;
+import org.apache.camel.Exchange;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class UFaceEndpoint extends ListEndpoint {
+ public UFaceEndpoint(String uri, UFaceComponent component) {
+ super(uri, component);
+ }
+
+ @Override
+ protected List<Exchange> createExchangeList() {
+ // TODO
+ return super.createExchangeList();
+ }
+}
Propchange: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/UFaceEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/Main.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/Main.java?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/Main.java (added)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/Main.java Tue Feb 12 08:06:52 2008
@@ -0,0 +1,47 @@
+/**
+ *
+ * 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.camel.component.uface.swing;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultCamelContext;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class Main extends org.apache.camel.spring.Main {
+
+ public static void main(String... args) {
+ new Main().run(args);
+ }
+
+ protected void postProcesCamelContext(CamelContext camelContext) {
+ super.postProcesCamelContext(camelContext);
+
+ // TODO hack!
+ camelContext.getEndpoint("mock:a");
+ try {
+ SwingBrowser browser = new SwingBrowser((DefaultCamelContext) camelContext);
+ browser.run();
+ }
+ catch (RuntimeException e) {
+ System.out.println("Caught: " + e);
+ e.printStackTrace();
+ throw e;
+ }
+ }
+}
Propchange: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/Main.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java (added)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java Tue Feb 12 08:06:52 2008
@@ -0,0 +1,57 @@
+/**
+ *
+ * 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.camel.component.uface.swing;
+
+import java.awt.*;
+
+import javax.swing.*;
+
+import org.apache.camel.component.uface.UFaceBrowser;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.spring.Main;
+import org.ufacekit.ui.UIComposite;
+import org.ufacekit.ui.swing.SwingComposite;
+import org.ufacekit.ui.swing.SwingFactory;
+import org.ufacekit.ui.swing.databinding.swing.SwingRealm;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class SwingBrowser extends UFaceBrowser {
+ static {
+ SwingRealm.createDefault();
+ }
+
+ public SwingBrowser(DefaultCamelContext camelContext) {
+ super(camelContext);
+ }
+
+ public void run() {
+ JFrame frame = new JFrame();
+ frame.setTitle("Camel Browser");
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ Container container = frame.getContentPane();
+ UIComposite composite = new SwingComposite(container, new SwingFactory().newFillLayout());
+
+ createBrowserUI(composite);
+
+ frame.pack();
+ frame.setSize(650, 500);
+ frame.setVisible(true);
+ }
+}
Propchange: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component.uface/swing/SwingBrowser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java (added)
+++ activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java Tue Feb 12 08:06:52 2008
@@ -0,0 +1,54 @@
+/**
+ *
+ * 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.camel.component.uface;
+
+import java.util.Date;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.EndpointInject;
+import org.springframework.beans.factory.InitializingBean;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class ExampleSender implements InitializingBean {
+ private int counter;
+ private int messageCount = 10;
+
+ @EndpointInject(uri = "mock:a")
+ private ProducerTemplate template;
+
+ public String ping() {
+ return "Message " + (++counter) + " at: " + new Date();
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ // lets send a bunch of messages...
+ for (int i = 0; i < messageCount; i++) {
+ template.sendBodyAndHeader(ping(), "messageCounter", i);
+ }
+ }
+
+ public int getMessageCount() {
+ return messageCount;
+ }
+
+ public void setMessageCount(int messageCount) {
+ this.messageCount = messageCount;
+ }
+}
Propchange: activemq/camel/trunk/components/camel-uface/src/test/java/org/apache/camel/component.uface/ExampleSender.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/spring/camel.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/spring/camel.xml?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/spring/camel.xml (added)
+++ activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/spring/camel.xml Tue Feb 12 08:06:52 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
+
+ <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
+ <route>
+ <from uri="list:a"/>
+ <to uri="list:b"/>
+ </route>
+
+ </camelContext>
+
+ <bean id="sender" class="org.apache.camel.component.uface.ExampleSender"/>
+</beans>
Propchange: activemq/camel/trunk/components/camel-uface/src/test/resources/META-INF/spring/camel.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties?rev=620839&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties (added)
+++ activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties Tue Feb 12 08:06:52 2008
@@ -0,0 +1,53 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=INFO, stdout
+
+log4j.logger.org.apache.activemq.spring=WARN
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/camel-test.log
+log4j.appender.out.append=true
+
Propchange: activemq/camel/trunk/components/camel-uface/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native