Package javax.resource.spi.work

Examples of javax.resource.spi.work.Work


        try {
            FTPFile[] files = ftp.listFiles(getWorkingPath());
            for (int i = 0; i < files.length; i++) {
                final FTPFile file = files[i];
                workingSet.add(file);
                getWorkManager().scheduleWork(new Work() {
                    public void run() {
                        processFile(file);
                    }

                    public void release() {
View Full Code Here


        if (!workingSet.contains(aFile)) {
            workingSet.add(aFile);
            if (log.isDebugEnabled()) {
                log.debug("Scheduling file " + aFile + " for processing");
            }
            getWorkManager().scheduleWork(new Work() {
                public void run() {
                    processFileAndDelete(aFile);
                }

                public void release() {
View Full Code Here

                        started.wait(500);
                    }
                }
                me = (MessageExchangeImpl) queue.poll(1000);
                if (me != null) {
                    flow.getBroker().getWorkManager().scheduleWork(new Work() {
                        public void release() {
                        }
                        public void run() {
                            try {
                                if (log.isDebugEnabled()) {
View Full Code Here

            if (files != null) {
                for (int i = 0;i < files.length;i++) {
                    if (files[i].isDirectory()) {
                        final File directory = files[i];
                        try {
                            container.getWorkManager().doWork(new Work() {
                                public void release() {
                                }

                                public void run() {
                                    try {
View Full Code Here

                            Transaction tx = (Transaction) me.getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME);
                            if (tx == mgr.getTransaction()) {
                                mgr.suspend();
                            }
                        }
                        AbstractComponent.this.workManager.scheduleWork(new Work() {
                            public void release() {
                            }
                            public void run() {
                                try {
                                    if (me.isTransacted()) {
View Full Code Here

        }
        for (int i = 0; i < files.length; i++) {
            final FileObject file = files[i];
            if (!workingSet.contains(file)) {
                workingSet.add(file);
                getWorkManager().scheduleWork(new Work() {
                    public void run() {
                        processFileAndDelete(file);
                    }

                    public void release() {
View Full Code Here

                    final File file = files[i];
                    tmpList.add(file.getAbsolutePath());
                    if ((file.getPath().endsWith(".jar") || file.getPath().endsWith(".zip"))
                            && (!descriptorMap.containsKey(file.getAbsolutePath()) || file.lastModified() > lastMonitorTime)) {
                        try {
                            container.getWorkManager().doWork(new Work() {
                                public void run() {
                                    log.info("Directory: " + root.getName() + ": Archive changed: processing "
                                            + file.getName() + " ...");
                                    try {
                                        updateArchive(file.getAbsolutePath(), true);
View Full Code Here

  {
    log.info("WorkResource[] starting");

    WorkManager workManager = ctx.getWorkManager();
   
    Work work = new WorkTask(this);

    try {
      // Submits the work, but does not wait for the result.
      // In other words, it spawns a new thread
      workManager.startWork(work);
View Full Code Here

            this.transacted = endpointFactory.isDeliveryTransacted(ON_MESSAGE_METHOD);
        } catch (NoSuchMethodException e) {
            throw new ResourceException("Endpoint does not implement the onMessage method.");
        }

        connectWork = new Work() {
            long currentReconnectDelay = INITIAL_RECONNECT_DELAY;

            public void release() {
                //
            }
View Full Code Here

        }
        catch (NoSuchMethodException e) {
            throw new ResourceException("Endpoint does not implement the onMessage method.");
        }
       
        connectWork = new Work() {

            public void release() {
            }

            synchronized public void run() {
View Full Code Here

TOP

Related Classes of javax.resource.spi.work.Work

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.