RE: [jira] Created: (SM-1004) File poller deletes files, even if errors occur while processing

2007-07-16 Thread rabi.mishra

Gret,

Are you working on this patch? I had fixed it sometime back and
attaching the patch..

-Original Message-
From: Gert Vanthienen (JIRA) [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 1:17 PM
To: servicemix-dev@geronimo.apache.org
Subject: [jira] Created: (SM-1004) File poller deletes files, even if
errors occur while processing

File poller deletes files, even if errors occur while processing


 Key: SM-1004
 URL: https://issues.apache.org/activemq/browse/SM-1004
 Project: ServiceMix
  Issue Type: Bug
  Components: servicemix-file
Affects Versions: 3.1.1
Reporter: Gert Vanthienen


Other poller components (e.g. FTP poller) leave the message where it is
in case of error/fault, so it can be retried afterwards (e.g. services
unavailable, XML message content not yet complete, ...).

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.




The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.
 
www.wipro.comIndex: 
E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
===
--- 
E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
(revision 555678)
+++ 
E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicemix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
(working copy)
@@ -41,217 +41,229 @@
 import 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.
- *
+ * 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 FilePollerEndpoint extends PollingEndpoint implements 
FileEndpointType {
+public class FilePollerEndpoint extends PollingEndpoint implements
+   FileEndpointType {
 
-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;
+   private File file;
 
-public FilePollerEndpoint() {
-}
+   private FileFilter filter;
 
-public FilePollerEndpoint(ServiceUnit serviceUnit, QName service, String 
endpoint) {
-super(serviceUnit, service, endpoint);
-}
+   private boolean deleteFile = true;
 
-public FilePollerEndpoint(DefaultComponent component, ServiceEndpoint 
endpoint) {
-super(component, endpoint);
-}
+   private boolean recursive = true;
 
-public void poll() throws Exception {
-pollFileOrDirectory(file);
-}
+   private boolean autoCreateDirectory = true;
 
-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();
-}
+   private FileMarshaler marshaler = new DefaultFileMarshaler();
 
+   private LockManager lockManager;
 
-// Properties
-//-
-public File getFile() {
-return file;
-}
+   public FilePollerEndpoint() {
+   }
 
-/**
- * Sets the file to poll, which can be a directory or a file.
- *
- * @param file
- */
-public void setFile(File file) {
-this.file = file;
-}
+   public FilePollerEndpoint(ServiceUnit 

RE: [jira] Created: (SM-1004) File poller deletes files, even iferrors occur while processing

2007-07-16 Thread rabi.mishra

Yes,

It is the lock handling... 

1. Every polling therad creates lock with the file uri and then
processes the file..
2. Lock is released once the file is processed and deleted. (Managed by
unlock flag)
3. If there is any exception in processing the file the lock is not
released.

I have just changed it in similar lines with FtpPoller.



Regards,
Rabi Mishra, 
http://rabisblog.blogspot.com/
c++; /* this makes c bigger but returns the old value */ 
-Original Message-
From: Gert Vanthienen [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 2:05 PM
To: servicemix-dev@geronimo.apache.org
Subject: Re: [jira] Created: (SM-1004) File poller deletes files, even
iferrors occur while processing

Rabi,


Thank you for helping out with this!  A lot of this patch seems to be
formatting changes, but it already saves me the time/effort to figure
things out.  You mainly changed the lock handling, right?

Can you explain what you have changed?  Just curious to know how things
work...


Gert

[EMAIL PROTECTED] wrote:
 Gret,
 
 Are you working on this patch? I had fixed it sometime back and
 attaching the patch..
 
 -Original Message-
 From: Gert Vanthienen (JIRA) [mailto:[EMAIL PROTECTED] 
 Sent: Monday, July 16, 2007 1:17 PM
 To: servicemix-dev@geronimo.apache.org
 Subject: [jira] Created: (SM-1004) File poller deletes files, even if
 errors occur while processing
 
 File poller deletes files, even if errors occur while processing
 
 
  Key: SM-1004
  URL:
https://issues.apache.org/activemq/browse/SM-1004
  Project: ServiceMix
   Issue Type: Bug
   Components: servicemix-file
 Affects Versions: 3.1.1
 Reporter: Gert Vanthienen
 
 
 Other poller components (e.g. FTP poller) leave the message where it
is
 in case of error/fault, so it can be retried afterwards (e.g. services
 unavailable, XML message content not yet complete, ...).
 
 --
 This message is automatically generated by JIRA.
 -
 You can reply to this email to add a comment to the issue online.
 
 
 
 
 The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
addressee(s) and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately and destroy all copies of this message and any attachments. 
 
 WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
  
 www.wipro.com
 
 


 
 Index:
E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicem
ix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
 ===
 ---
E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicem
ix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
(revision 555678)
 +++
E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicem
ix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
(working copy)
 @@ -41,217 +41,229 @@
  import 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.
 - *
 + * 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 FilePollerEndpoint extends PollingEndpoint implements
FileEndpointType {
 +public class FilePollerEndpoint extends PollingEndpoint implements
 + FileEndpointType {
  
 -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;
 + private File file;
  
 -public FilePollerEndpoint() {
 -}
 + private FileFilter filter;
  
 -public FilePollerEndpoint(ServiceUnit serviceUnit, QName service,
String endpoint) {
 -super(serviceUnit, service, endpoint);
 -}
 + private boolean deleteFile = true;
  
 -public FilePollerEndpoint(DefaultComponent component,
ServiceEndpoint endpoint) {
 -super(component, endpoint);
 -}
 + private boolean recursive = true;
  
 -public void poll() throws 

RE: [jira] Created: (SM-1004) File poller deletes files, even iferrorsoccur while processing

2007-07-16 Thread rabi.mishra

Yes you are right Gret.. We need to throw the exception based on the
sendsync results...

Regards,
Rabi Mishra, 
http://rabisblog.blogspot.com/
c++; /* this makes c bigger but returns the old value */ 
-Original Message-
From: Gert Vanthienen [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 2:58 PM
To: servicemix-dev@geronimo.apache.org
Subject: Re: [jira] Created: (SM-1004) File poller deletes files, even
iferrorsoccur while processing

Rabi,


Shouldn't we add something like
if (exchange.getStatus() == ExchangeStatus.ERROR) {
 Exception e = exchange.getError();
 if (e == null) {
 e = new JBIException(Unkown error);
 }
 throw e;
 }
in the processFile() method as well, to make sure that an exception is
thrown for every MessageExchange that ends in error?


Gert

[EMAIL PROTECTED] wrote:
 Yes,
 
 It is the lock handling... 
 
 1. Every polling therad creates lock with the file uri and then
 processes the file..
 2. Lock is released once the file is processed and deleted. (Managed
by
 unlock flag)
 3. If there is any exception in processing the file the lock is not
 released.
 
 I have just changed it in similar lines with FtpPoller.
 
 
 
 Regards,
 Rabi Mishra, 
 http://rabisblog.blogspot.com/
 c++; /* this makes c bigger but returns the old value */ 
 -Original Message-
 From: Gert Vanthienen [mailto:[EMAIL PROTECTED] 
 Sent: Monday, July 16, 2007 2:05 PM
 To: servicemix-dev@geronimo.apache.org
 Subject: Re: [jira] Created: (SM-1004) File poller deletes files, even
 iferrors occur while processing
 
 Rabi,
 
 
 Thank you for helping out with this!  A lot of this patch seems to be
 formatting changes, but it already saves me the time/effort to figure
 things out.  You mainly changed the lock handling, right?
 
 Can you explain what you have changed?  Just curious to know how
things
 work...
 
 
 Gert
 
 [EMAIL PROTECTED] wrote:
 Gret,

 Are you working on this patch? I had fixed it sometime back and
 attaching the patch..

 -Original Message-
 From: Gert Vanthienen (JIRA) [mailto:[EMAIL PROTECTED] 
 Sent: Monday, July 16, 2007 1:17 PM
 To: servicemix-dev@geronimo.apache.org
 Subject: [jira] Created: (SM-1004) File poller deletes files, even if
 errors occur while processing

 File poller deletes files, even if errors occur while processing
 

  Key: SM-1004
  URL:
 https://issues.apache.org/activemq/browse/SM-1004
  Project: ServiceMix
   Issue Type: Bug
   Components: servicemix-file
 Affects Versions: 3.1.1
 Reporter: Gert Vanthienen


 Other poller components (e.g. FTP poller) leave the message where it
 is
 in case of error/fault, so it can be retried afterwards (e.g.
services
 unavailable, XML message content not yet complete, ...).

 --
 This message is automatically generated by JIRA.
 -
 You can reply to this email to add a comment to the issue online.




 The information contained in this electronic message and any
 attachments to this message are intended for the exclusive use of the
 addressee(s) and may contain proprietary, confidential or privileged
 information. If you are not the intended recipient, you should not
 disseminate, distribute or copy this e-mail. Please notify the sender
 immediately and destroy all copies of this message and any
attachments. 
 WARNING: Computer viruses can be transmitted via email. The recipient
 should check this email and any attachments for the presence of
viruses.
 The company accepts no liability for any damage caused by any virus
 transmitted by this email.
  
 www.wipro.com





 Index:

E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicem

ix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
 ===
 ---

E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicem

ix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
 (revision 555678)
 +++

E:/Rabi/work/workspace/servicemix/deployables/bindingcomponents/servicem

ix-file/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
 (working copy)
 @@ -41,217 +41,229 @@
  import 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.
 - *
 + * 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 FilePollerEndpoint extends PollingEndpoint 

RE: checkstyle on the se-archectype

2007-07-10 Thread rabi.mishra

While trying to build from the source from the trunk.. Meven 2 JBI Plugin 
failed fo me ith check style errors..
 
GraphArtifactCollector.java:58:37: More than 7 parameters
JbiComponentDescriptorWriter.java:37:15: More than 7 parameters
 
Do you have the same errors?
 
Regards, 
Rabi Mishra 
http://rabisblog.blogspot.com/



From: [EMAIL PROTECTED] on behalf of Brian O'Neill
Sent: Tue 7/10/2007 11:52 PM
To: servicemix-dev@geronimo.apache.org
Subject: checkstyle on the se-archectype



Following the se tutorial:
http://incubator.apache.org/servicemix/hello-world-se.html

The code produced from the mvn archetype failed the checkstyle check
(with errors).

Has anyone else experienced this?

(I also had to go in and update the version in the pom.xml, so it
would pull a current release of sm)

-brian

--
Brian ONeill
Source Equity (http://www.sourceequity.com http://www.sourceequity.com/ )
jBIZint (http://www.jbizint.org http://www.jbizint.org/ )
Technical Architect, Gestalt LLC (http://www.gestalt-llc.com 
http://www.gestalt-llc.com/ )
mobile:215.588.6024





The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.
 
www.wipro.com