You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/03/16 19:21:22 UTC
svn commit: r519081 - in
/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip:
./ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/servicemix/
src/main/java/org/apache/servicemi...
Author: gnodet
Date: Fri Mar 16 11:21:20 2007
New Revision: 519081
URL: http://svn.apache.org/viewvc?view=rev&rev=519081
Log:
SM-875: truezip binding component provided by James Bradt, thx a lot!
Added:
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/ (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/pom.xml (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipComponent.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipEndpointType.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipPollerEndpoint.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipSenderEndpoint.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/package.html (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/jbi/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/resources/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/DynamicEndpointTest.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/PollDirectoryTest.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/SpringComponentTest.java (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j-tests.properties (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j.properties (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-no-endpoints.xml (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-polling.xml (with props)
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring.xml (with props)
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 16 11:21:20 2007
@@ -0,0 +1,3 @@
+.classpath
+.project
+.settings
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/pom.xml?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/pom.xml (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/pom.xml Fri Mar 16 11:21:20 2007
@@ -0,0 +1,111 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!--
+
+ 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.
+-->
+
+ <parent>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>bindingcomponents</artifactId>
+ <version>3.2-incubating-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-truezip</artifactId>
+ <packaging>jbi-component</packaging>
+ <name>ServiceMix :: TrueZIP</name>
+ <description>A File TrueZIP component</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>de.schlichtherle.io</groupId>
+ <artifactId>truezip</artifactId>
+ <version>6.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-shared</artifactId>
+ <version>${servicemix-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-core</artifactId>
+ <version>${servicemix-version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>jbi-maven-plugin</artifactId>
+ <version>${servicemix-version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <type>binding-component</type>
+ <component>org.apache.servicemix.truezip.TrueZipComponent</component>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>maven-xbean-plugin</artifactId>
+ <version>${xbean-version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>mapping</goal>
+ </goals>
+ <configuration>
+ <namespace>http://servicemix.apache.org/truezip/1.0</namespace>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*Test*</include>
+ </includes>
+ <excludes>
+ <exclude>**/PollDirectoryTest*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <!-- best lock down version of the plugin too -->
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipComponent.java?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipComponent.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipComponent.java Fri Mar 16 11:21:20 2007
@@ -0,0 +1,95 @@
+/*
+ * 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.servicemix.truezip;
+
+// import java.io.File;
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+
+import javax.jbi.servicedesc.ServiceEndpoint;
+
+import org.apache.servicemix.common.DefaultComponent;
+import org.apache.servicemix.common.Endpoint;
+import org.apache.servicemix.jbi.util.IntrospectionSupport;
+import org.apache.servicemix.jbi.util.URISupport;
+
+import de.schlichtherle.io.File;
+
+/**
+ * A file based component
+ *
+ * @version $Revision$
+ * @org.apache.xbean.XBean element="component" description="File Component"
+ */
+public class TrueZipComponent extends DefaultComponent {
+
+ private TrueZipEndpointType[] endpoints;
+
+ public TrueZipEndpointType[] getEndpoints() {
+ return endpoints;
+ }
+
+ public void setEndpoints(TrueZipEndpointType[] endpoints) {
+ this.endpoints = endpoints;
+ }
+
+ protected List getConfiguredEndpoints() {
+ return asList(getEndpoints());
+ }
+
+ protected Class[] getEndpointClasses() {
+ return new Class[] { TrueZipPollerEndpoint.class, TrueZipSenderEndpoint.class };
+ }
+
+ protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception {
+ // We receive an exchange for an EPR that has not been used yet.
+ // Register a provider endpoint and restart processing.
+ TrueZipSenderEndpoint fileEp = new TrueZipSenderEndpoint(this, ep);
+ URI uri = new URI(ep.getEndpointName());
+ String file = null;
+ String host = uri.getHost();
+ String path = uri.getPath();
+ if (host != null) {
+ if (path != null) {
+ // lets assume host really is a relative directory
+ file = host + File.separator + path;
+ } else {
+ file = host;
+ }
+ } else {
+ if (path != null) {
+ file = path;
+ } else {
+ // must be an absolute URI
+ file = uri.getSchemeSpecificPart();
+ }
+ }
+ Map map = URISupport.parseQuery(uri.getQuery());
+ if (IntrospectionSupport.setProperties(fileEp, map, "truezip.")) {
+ uri = URISupport.createRemainingURI(uri, map);
+ }
+ if (file != null) {
+ fileEp.setDirectory(new File(file));
+ } else {
+ throw new IllegalArgumentException("No file defined for URL: " + uri);
+ }
+ fileEp.activate();
+ return fileEp;
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipComponent.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipComponent.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipEndpointType.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipEndpointType.java?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipEndpointType.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipEndpointType.java Fri Mar 16 11:21:20 2007
@@ -0,0 +1,26 @@
+/*
+ * 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.servicemix.truezip;
+
+/**
+ * Marker interface for File endpoints
+ *
+ * @author gnodet
+ */
+public interface TrueZipEndpointType {
+
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipEndpointType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipEndpointType.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipEndpointType.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipPollerEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipPollerEndpoint.java?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipPollerEndpoint.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipPollerEndpoint.java Fri Mar 16 11:21:20 2007
@@ -0,0 +1,265 @@
+/*
+ * 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.servicemix.truezip;
+
+// import java.io.BufferedInputStream;
+// import java.io.File;
+// import java.io.FileFilter;
+// import java.io.FileInputStream;
+// import java.io.IOException;
+// import java.io.InputStream;
+
+import java.io.BufferedInputStream;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.jbi.management.DeploymentException;
+import javax.jbi.messaging.InOnly;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.common.DefaultComponent;
+import org.apache.servicemix.common.ServiceUnit;
+import org.apache.servicemix.common.endpoints.PollingEndpoint;
+import org.apache.servicemix.components.util.DefaultFileMarshaler;
+import org.apache.servicemix.components.util.FileMarshaler;
+import org.apache.servicemix.locks.LockManager;
+import org.apache.servicemix.locks.impl.SimpleLockManager;
+
+import de.schlichtherle.io.File;
+import de.schlichtherle.io.FileInputStream;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.Lock;
+
+/**
+ * A polling endpoint which looks for a file or files in a directory and sends
+ * the files into the JBI bus as messages, deleting the files by default when
+ * they are processed.
+ *
+ * @org.apache.xbean.XBean element="poller"
+ *
+ * @version $Revision$
+ */
+public class TrueZipPollerEndpoint extends PollingEndpoint implements TrueZipEndpointType {
+
+ private File file;
+
+ private FileFilter filter;
+
+ private boolean deleteFile = true;
+
+ private boolean recursive = true;
+
+ private boolean autoCreateDirectory = true;
+
+ private FileMarshaler marshaler = new DefaultFileMarshaler();
+
+ private LockManager lockManager;
+
+ public TrueZipPollerEndpoint() {
+ }
+
+ public TrueZipPollerEndpoint(ServiceUnit serviceUnit, QName service, String endpoint) {
+ super(serviceUnit, service, endpoint);
+ }
+
+ public TrueZipPollerEndpoint(DefaultComponent component, ServiceEndpoint endpoint) {
+ super(component, endpoint);
+ }
+
+ public void poll() throws Exception {
+ pollFileOrDirectory(file);
+ }
+
+ public void validate() throws DeploymentException {
+ super.validate();
+ if (file == null) {
+ throw new DeploymentException("You must specify a file property");
+ }
+ if (isAutoCreateDirectory() && !file.exists()) {
+ file.mkdirs();
+ }
+ if (lockManager == null) {
+ lockManager = createLockManager();
+ }
+ }
+
+ protected LockManager createLockManager() {
+ return new SimpleLockManager();
+ }
+
+ // Properties
+ // -------------------------------------------------------------------------
+ public java.io.File getFile() {
+ return file;
+ }
+
+ /**
+ * Sets the file to poll, which can be a directory or a file.
+ *
+ * @param file
+ */
+ public void setFile(java.io.File file) {
+ this.file = new File(file);
+ }
+
+ /**
+ * @return the lockManager
+ */
+ public LockManager getLockManager() {
+ return lockManager;
+ }
+
+ /**
+ * @param lockManager
+ * the lockManager to set
+ */
+ public void setLockManager(LockManager lockManager) {
+ this.lockManager = lockManager;
+ }
+
+ public FileFilter getFilter() {
+ return filter;
+ }
+
+ /**
+ * Sets the optional filter to choose which files to process
+ */
+ public void setFilter(FileFilter filter) {
+ this.filter = filter;
+ }
+
+ /**
+ * Returns whether or not we should delete the file when its processed
+ */
+ public boolean isDeleteFile() {
+ return deleteFile;
+ }
+
+ public void setDeleteFile(boolean deleteFile) {
+ this.deleteFile = deleteFile;
+ }
+
+ public boolean isRecursive() {
+ return recursive;
+ }
+
+ public void setRecursive(boolean recursive) {
+ this.recursive = recursive;
+ }
+
+ public boolean isAutoCreateDirectory() {
+ return autoCreateDirectory;
+ }
+
+ public void setAutoCreateDirectory(boolean autoCreateDirectory) {
+ this.autoCreateDirectory = autoCreateDirectory;
+ }
+
+ public FileMarshaler getMarshaler() {
+ return marshaler;
+ }
+
+ public void setMarshaler(FileMarshaler marshaler) {
+ this.marshaler = marshaler;
+ }
+
+ // Implementation methods
+ // -------------------------------------------------------------------------
+
+ protected void pollFileOrDirectory(File fileOrDirectory) {
+ pollFileOrDirectory(fileOrDirectory, true);
+ }
+
+ protected void pollFileOrDirectory(File fileOrDirectory, boolean processDir) {
+ if (!fileOrDirectory.isDirectory()) {
+ pollFile(fileOrDirectory); // process the file
+ } else if (processDir) {
+ logger.debug("Polling directory " + fileOrDirectory);
+ File[] files = (File[]) fileOrDirectory.listFiles(getFilter());
+ for (int i = 0; i < files.length; i++) {
+ pollFileOrDirectory(files[i], isRecursive()); // self-recursion
+ }
+ } else {
+ logger.debug("Skipping directory " + fileOrDirectory);
+ }
+ }
+
+ protected void pollFile(final File aFile) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Scheduling file " + aFile + " for processing");
+ }
+ getExecutor().execute(new Runnable() {
+ public void run() {
+ String uri = file.toURI().relativize(aFile.toURI()).toString();
+ Lock lock = lockManager.getLock(uri);
+ if (lock.tryLock()) {
+ try {
+ processFileAndDelete(aFile);
+ } finally {
+ lock.unlock();
+ }
+ } else {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Unable to acquire lock on " + aFile);
+ }
+ }
+ }
+ });
+ }
+
+ protected void processFileAndDelete(File aFile) {
+ try {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Processing file " + aFile);
+ }
+ if (aFile.exists()) {
+ processFile(aFile);
+ if (isDeleteFile()) {
+ if (!aFile.delete()) {
+ throw new IOException("Could not delete file " + aFile);
+ }
+ }
+ }
+ } catch (Exception e) {
+ logger.error("Failed to process file: " + aFile + ". Reason: " + e, e);
+ }
+ }
+
+ protected void processFile(File aFile) throws Exception {
+ String name = aFile.getCanonicalPath();
+ InputStream in = new BufferedInputStream(new FileInputStream(aFile));
+ InOnly exchange = getExchangeFactory().createInOnlyExchange();
+ configureExchangeTarget(exchange);
+ NormalizedMessage message = exchange.createMessage();
+ exchange.setInMessage(message);
+ marshaler.readMessage(exchange, message, in, name);
+ sendSync(exchange);
+ in.close();
+ }
+
+ public String getLocationURI() {
+ return file.toURI().toString();
+ }
+
+ public void process(MessageExchange exchange) throws Exception {
+ // Do nothing. In our case, this method should never be called
+ // as we only send synchronous InOnly exchange
+ }
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipPollerEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipPollerEndpoint.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipPollerEndpoint.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipSenderEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipSenderEndpoint.java?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipSenderEndpoint.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipSenderEndpoint.java Fri Mar 16 11:21:20 2007
@@ -0,0 +1,157 @@
+/*
+ * 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.servicemix.truezip;
+
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.jbi.management.DeploymentException;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.jbi.servicedesc.ServiceEndpoint;
+
+import org.apache.servicemix.common.endpoints.ProviderEndpoint;
+import org.apache.servicemix.components.util.DefaultFileMarshaler;
+import org.apache.servicemix.components.util.FileMarshaler;
+import org.apache.servicemix.id.IdGenerator;
+
+import de.schlichtherle.io.File;
+import de.schlichtherle.io.FileOutputStream;
+
+/**
+ * An endpoint which receives a message and writes the content to a file.
+ *
+ * @org.apache.xbean.XBean element="sender"
+ *
+ * @version $Revision$
+ */
+public class TrueZipSenderEndpoint extends ProviderEndpoint implements TrueZipEndpointType {
+
+ private File directory;
+
+ private FileMarshaler marshaler = new DefaultFileMarshaler();
+
+ private String tempFilePrefix = "servicemix-";
+
+ private String tempFileSuffix = ".xml";
+
+ private boolean autoCreateDirectory = true;
+
+ private IdGenerator idGenerator;
+
+ public TrueZipSenderEndpoint() {
+ }
+
+ public TrueZipSenderEndpoint(TrueZipComponent component, ServiceEndpoint endpoint) {
+ super(component, endpoint);
+ }
+
+ public void validate() throws DeploymentException {
+ super.validate();
+ if (directory == null) {
+ throw new DeploymentException("You must specify the directory property");
+ }
+ if (isAutoCreateDirectory()) {
+ directory.mkdirs();
+ }
+ if (!directory.isDirectory()) {
+ throw new DeploymentException("The directory property must be a directory but was: " + directory);
+ }
+ }
+
+ protected void processInOnly(MessageExchange exchange, NormalizedMessage in) throws Exception {
+ OutputStream out = null;
+ try {
+ String name = marshaler.getOutputName(exchange, in);
+ File newFile = null;
+ if (name == null) {
+ newFile = new File(directory, getNewTempName());
+ } else {
+ newFile = new File(directory, name);
+ }
+ if (logger.isDebugEnabled()) {
+ logger.debug("Writing to file: " + newFile.getCanonicalPath());
+ }
+ out = new BufferedOutputStream(new FileOutputStream(newFile));
+ marshaler.writeMessage(exchange, in, out, name);
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ logger.error("Caught exception while closing stream on error: " + e, e);
+ }
+ }
+ }
+ }
+
+ protected String getNewTempName() {
+ if (idGenerator == null) {
+ idGenerator = new IdGenerator(tempFilePrefix);
+ }
+ return idGenerator.generateSanitizedId() + tempFileSuffix;
+ }
+
+ protected void processInOut(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws Exception {
+ /** TODO list the files? */
+ super.processInOut(exchange, in, out);
+ }
+
+ // Properties
+ // -------------------------------------------------------------------------
+ public java.io.File getDirectory() {
+ return directory;
+ }
+
+ public void setDirectory(java.io.File directory) {
+ this.directory = new File(directory);
+ }
+
+ public FileMarshaler getMarshaler() {
+ return marshaler;
+ }
+
+ public void setMarshaler(FileMarshaler marshaler) {
+ this.marshaler = marshaler;
+ }
+
+ public String getTempFilePrefix() {
+ return tempFilePrefix;
+ }
+
+ public void setTempFilePrefix(String tempFilePrefix) {
+ this.tempFilePrefix = tempFilePrefix;
+ }
+
+ public String getTempFileSuffix() {
+ return tempFileSuffix;
+ }
+
+ public void setTempFileSuffix(String tempFileSuffix) {
+ this.tempFileSuffix = tempFileSuffix;
+ }
+
+ public boolean isAutoCreateDirectory() {
+ return autoCreateDirectory;
+ }
+
+ public void setAutoCreateDirectory(boolean autoCreateDirectory) {
+ this.autoCreateDirectory = autoCreateDirectory;
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipSenderEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipSenderEndpoint.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/TrueZipSenderEndpoint.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/package.html
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/package.html?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/package.html (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/package.html Fri Mar 16 11:21:20 2007
@@ -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.
+
+-->
+<html>
+<head>
+</head>
+<body>
+
+A component for working with zipped files such as writing to a zip or polling a zip for files.
+
+</body>
+</html>
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/package.html
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/main/java/org/apache/servicemix/truezip/package.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/DynamicEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/DynamicEndpointTest.java?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/DynamicEndpointTest.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/DynamicEndpointTest.java Fri Mar 16 11:21:20 2007
@@ -0,0 +1,73 @@
+/**
+ *
+ * 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.servicemix.truezip;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.servicedesc.ServiceEndpoint;
+
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.client.ServiceMixClient;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+import de.schlichtherle.io.File;
+
+public class DynamicEndpointTest extends SpringTestSupport {
+ protected String dynamicURI = "truezip://target/dynamicEndpoint.zip?truezip.tempFilePrefix=dynamicEp-";
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ new File("target/dynamicEndpoint.zip").mkdirs();
+ }
+
+ public void testSendingToDynamicEndpoint() throws Exception {
+ ServiceMixClient client = new DefaultServiceMixClient(jbi);
+
+ ServiceEndpoint se = client.resolveEndpointReference(dynamicURI);
+ assertNotNull("We should find a service endpoint!", se);
+
+ InOnly exchange = client.createInOnlyExchange();
+ exchange.setEndpoint(se);
+ exchange.getInMessage().setContent(new StringSource("<hello>world</hello>"));
+ client.sendSync(exchange);
+
+ assertExchangeWorked(exchange);
+ }
+
+ protected void assertExchangeWorked(MessageExchange me) throws Exception {
+ if (me.getStatus() == ExchangeStatus.ERROR) {
+ if (me.getError() != null) {
+ throw me.getError();
+ } else {
+ fail("Received ERROR status");
+ }
+ } else if (me.getFault() != null) {
+ fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
+ }
+ }
+
+ protected AbstractXmlApplicationContext createBeanFactory() {
+ return new ClassPathXmlApplicationContext("spring-no-endpoints.xml");
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/DynamicEndpointTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/DynamicEndpointTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/DynamicEndpointTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/PollDirectoryTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/PollDirectoryTest.java?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/PollDirectoryTest.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/PollDirectoryTest.java Fri Mar 16 11:21:20 2007
@@ -0,0 +1,74 @@
+/**
+ *
+ * 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.servicemix.truezip;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.components.util.DefaultFileMarshaler;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.Receiver;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class PollDirectoryTest extends SpringTestSupport {
+
+ private int NUMBER = 10;
+
+ public void testSendToWriterSoItCanBePolled() throws Exception {
+ // now lets make a request on this endpoint
+ DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
+
+ // lets send a request to be written to a file
+ // which should then be polled
+ for (int i = 0; i < NUMBER; i++) {
+ InOnly me = client.createInOnlyExchange();
+ me.setService(new QName("urn:test", "service"));
+ NormalizedMessage message = me.getInMessage();
+ message.setProperty(DefaultFileMarshaler.FILE_NAME_PROPERTY, "test" + i + ".xml");
+ message.setContent(new StringSource("<hello>world</hello>"));
+ client.sendSync(me);
+ }
+
+ Receiver receiver = (Receiver) getBean("receiver");
+ receiver.getMessageList().assertMessagesReceived(NUMBER);
+ }
+
+ protected void assertExchangeWorked(MessageExchange me) throws Exception {
+ if (me.getStatus() == ExchangeStatus.ERROR) {
+ if (me.getError() != null) {
+ throw me.getError();
+ } else {
+ fail("Received ERROR status");
+ }
+ } else if (me.getFault() != null) {
+ fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
+ }
+ }
+
+ protected AbstractXmlApplicationContext createBeanFactory() {
+ return new ClassPathXmlApplicationContext("spring-polling.xml");
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/PollDirectoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/PollDirectoryTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/PollDirectoryTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/SpringComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/SpringComponentTest.java?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/SpringComponentTest.java (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/SpringComponentTest.java Fri Mar 16 11:21:20 2007
@@ -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.servicemix.truezip;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class SpringComponentTest extends SpringTestSupport {
+
+ public void testSendingToStaticEndpoint() throws Exception {
+ DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
+ InOnly me = client.createInOnlyExchange();
+ me.setService(new QName("urn:test", "service"));
+ NormalizedMessage message = me.getInMessage();
+
+ message.setProperty("name", "cheese");
+ message.setContent(new StringSource("<hello>world</hello>"));
+
+ client.sendSync(me);
+ assertExchangeWorked(me);
+ }
+
+ protected void assertExchangeWorked(MessageExchange me) throws Exception {
+ if (me.getStatus() == ExchangeStatus.ERROR) {
+ if (me.getError() != null) {
+ throw me.getError();
+ } else {
+ fail("Received ERROR status");
+ }
+ } else if (me.getFault() != null) {
+ fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
+ }
+ }
+
+ protected AbstractXmlApplicationContext createBeanFactory() {
+ return new ClassPathXmlApplicationContext("spring.xml");
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/SpringComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/SpringComponentTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/java/org/apache/servicemix/truezip/SpringComponentTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j-tests.properties
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j-tests.properties?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j-tests.properties (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j-tests.properties Fri Mar 16 11:21:20 2007
@@ -0,0 +1,42 @@
+#
+# 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=DEBUG, out
+
+log4j.logger.org.springframework=INFO
+log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq.spring=WARN
+log4j.logger.org.apache.activemq.store.journal=INFO
+log4j.logger.org.activeio.journal=INFO
+
+# 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/servicemix-test.log
+log4j.appender.out.append=true
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j-tests.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j-tests.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j-tests.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j.properties?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j.properties (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j.properties Fri Mar 16 11:21:20 2007
@@ -0,0 +1,41 @@
+#
+# 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.springframework=INFO
+log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq.spring=WARN
+log4j.logger.org.apache.servicemix=DEBUG
+
+# CONSOLE appender
+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/servicemix-test.log
+log4j.appender.out.append=true
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-no-endpoints.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-no-endpoints.xml?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-no-endpoints.xml (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-no-endpoints.xml Fri Mar 16 11:21:20 2007
@@ -0,0 +1,37 @@
+<?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:sm="http://servicemix.apache.org/config/1.0"
+ xmlns:file="http://servicemix.apache.org/truezip/1.0"
+ xmlns:test="urn:test">
+
+ <sm:container id="jbi" embedded="true" createMBeanServer="false">
+
+ <sm:activationSpecs>
+
+ <sm:activationSpec>
+ <sm:component>
+ <file:component/>
+ </sm:component>
+ </sm:activationSpec>
+
+ </sm:activationSpecs>
+ </sm:container>
+
+</beans>
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-no-endpoints.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-no-endpoints.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-no-endpoints.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-polling.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-polling.xml?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-polling.xml (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-polling.xml Fri Mar 16 11:21:20 2007
@@ -0,0 +1,54 @@
+<?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:sm="http://servicemix.apache.org/config/1.0"
+ xmlns:file="http://servicemix.apache.org/truezip/1.0"
+ xmlns:test="urn:test">
+
+ <sm:container id="jbi" embedded="true" createMBeanServer="false">
+
+ <sm:activationSpecs>
+
+ <sm:activationSpec>
+ <sm:component>
+ <file:component>
+ <file:endpoints>
+ <file:sender service="test:service"
+ endpoint="endpoint"
+ directory="file:target/pollerFiles.zip" />
+
+ <file:poller service="test:poller"
+ endpoint="poller"
+ targetService="test:receiver"
+ file="file:target/pollerFiles.zip" />
+ </file:endpoints>
+ </file:component>
+ </sm:component>
+ </sm:activationSpec>
+
+ <sm:activationSpec id="receiver" service="test:receiver">
+ <sm:component>
+ <bean class="org.apache.servicemix.tck.ReceiverComponent" />
+ </sm:component>
+ </sm:activationSpec>
+
+ </sm:activationSpecs>
+ </sm:container>
+
+</beans>
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-polling.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-polling.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring-polling.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring.xml?view=auto&rev=519081
==============================================================================
--- incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring.xml (added)
+++ incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring.xml Fri Mar 16 11:21:20 2007
@@ -0,0 +1,53 @@
+<?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:sm="http://servicemix.apache.org/config/1.0"
+ xmlns:file="http://servicemix.apache.org/truezip/1.0"
+ xmlns:test="urn:test">
+
+ <sm:container id="jbi" embedded="true" createMBeanServer="false">
+
+ <sm:activationSpecs>
+
+ <sm:activationSpec>
+ <sm:component>
+ <file:component>
+ <file:endpoints>
+ <file:sender service="test:service"
+ endpoint="endpoint"
+ directory="file:target/componentOutput.zip">
+ <file:marshaler>
+ <sm:defaultFileMarshaler>
+ <sm:fileName>
+ <!-- lets use a header from the message -->
+ <sm:xpathString
+ xpath="concat($name, '.xml')" />
+ </sm:fileName>
+ </sm:defaultFileMarshaler>
+ </file:marshaler>
+ </file:sender>
+ </file:endpoints>
+ </file:component>
+ </sm:component>
+ </sm:activationSpec>
+
+ </sm:activationSpecs>
+ </sm:container>
+
+</beans>
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-truezip/src/test/resources/spring.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml