package xyz.test; import xyz.utilities.ejb.EjbLookup; import java.io.File; import org.apache.log4j.Logger; import org.switchyard.HandlerException; import org.switchyard.component.bean.Service; @Service(EjbTestFileConsumer.class) public class EjbTestFileConsumerBean implements xyz.test.EjbTestFileConsumer { private static final Logger log = Logger.getLogger(EjbTestFileConsumer.class); // Switchyard monitors the /mnt/INCOMING/TEST2 folder and passes file objects to be processed @Override public void process(File acceptedFile) throws HandlerException { log.info("EjbTestFileConsumer - Process file " + acceptedFile.getName()); try { try { @SuppressWarnings("unused") File xmlFile = new File("/mnt/INCOMING/TEST2/" + acceptedFile.getName().replace(".DONE","")); int testNum = 0; if (testNum == 0) { QueueHelperTestRemote qt = (QueueHelperTestRemote) EjbLookup.lookupEjbWithRetry(QueueHelperTest.class, QueueHelperTestRemote.class, 2); qt.testQHelper(); } } catch (Exception ex) { ex.printStackTrace(); } } catch (Exception e) { e.printStackTrace(); } } }