Package javax.resource.spi.work

Examples of javax.resource.spi.work.Work


        while (started.get()) {
            final MessageExchangeImpl me;
            try {
                me = (MessageExchangeImpl) queue.poll(1000);
                if (me != null) {
                    flow.getBroker().getContainer().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{
                                        buildComponent(directory);
View Full Code Here

                            try{
                              final ArchiveEntry entry = new ArchiveEntry();
                              entry.location = file.getName();
                              entry.lastModified = new Date(file.lastModified());
                              fileMap.put(file.getName(), entry);
                                container.getWorkManager().doWork(new Work(){
                                    public void run(){
                                        log.info("Directory: "+root.getName()+": Archive changed: processing "
                                                        +file.getName()+" ...");
                                        try{
                                            updateArchive(file.getAbsolutePath(), entry, true);
View Full Code Here

        }
    }

    protected void doStart() throws Exception {
        synchronized (this.polling) {
            workManager.startWork(new Work() {
                public void release() { }
                public void run() {
                    poller = Thread.currentThread();
                    pollDeliveryChannel();
                }
View Full Code Here

                        if (transactionManager == null) {
                            throw new IllegalStateException("Exchange is enlisted in a transaction, but no transaction manager is available");
                        }
                        transactionManager.suspend();
                    }
                    workManager.scheduleWork(new Work() {
                        public void release() {
                        }
                        public void run() {
                            processExchangeInTx(exchange, tx);
                        }
View Full Code Here

    public void onMessage(final Message message) {
        try {
            if (log.isDebugEnabled()) {
                log.debug("Received jms message " + message);
            }
            endpoint.getServiceUnit().getComponent().getWorkManager().scheduleWork(new Work() {
                public void release() {
                }
                public void run() {
                    try {
                        if (log.isDebugEnabled()) {
View Full Code Here

    public void onMessage(final Message message) {
        try {
            if (log.isDebugEnabled()) {
                log.debug("Received jms message " + message);
            }
            endpoint.getServiceUnit().getComponent().getWorkManager().scheduleWork(new Work() {
                public void release() {
                }
                public void run() {
                    try {
                        if (log.isDebugEnabled()) {
View Full Code Here

                throw new IllegalStateException("No destination provided");
            }
        }
        channel = endpoint.getServiceUnit().getComponent().getComponentContext().getDeliveryChannel();
        synchronized (running) {
            endpoint.getServiceUnit().getComponent().getWorkManager().startWork(new Work() {
                public void release() {
                }
                public void run() {
                    StandardConsumerProcessor.this.poll();
                }
View Full Code Here

    /* (non-Javadoc)
     * @see javax.resource.spi.work.WorkManager#startWork(javax.resource.spi.work.Work)
     */
    public long startWork(final Work work) throws WorkException {
        final CountDownLatch latch = new CountDownLatch(1);
        executor.execute(new Work() {
            public void release() {
                work.release();
            }
            public void run() {
                latch.countDown();
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.