Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()


                    }
                }
                @Override
                public void handleResultComplete() {
                    synchronized(failureResult) {
                        status.compareAndSet(0, 1);
                        failureResult.notify();
                    }
                }
                @Override
                public void handleFailed(ModelNode failureDescription) {
View Full Code Here


                }
                @Override
                public void handleFailed(ModelNode failureDescription) {
                    synchronized(failureResult) {
                        failureResult.set(failureDescription);
                        status.compareAndSet(0, 2);
                        failureResult.notify();
                    }
                }
                @Override
                public void handleCancellation() {
View Full Code Here

                    }
                }
                @Override
                public void handleCancellation() {
                    synchronized(failureResult) {
                        status.compareAndSet(0, 3);
                        failureResult.notify();
                    }
                }
            };
            final OperationResult result = BasicModelController.this.execute(resolveContext, resolveHandler, operationExecutionContext, false);
View Full Code Here

                            }
                        }
                        @Override
                        public void handleResultComplete() {
                            synchronized(failureResult) {
                                status.compareAndSet(0, 1);
                                if(count.decrementAndGet() == 0) {
                                    handleComplete();
                                }
                            }
                        }
View Full Code Here

                        public void handleFailed(ModelNode failureDescription) {
                            synchronized(failureResult) {
                                if(failureDescription != null)  {
                                    failureResult.add(failureDescription);
                                }
                                status.compareAndSet(0, 2);
                                if(count.decrementAndGet() == 0) {
                                    handleComplete();
                                }
                            }
                        }
View Full Code Here

                            }
                        }
                        @Override
                        public void handleCancellation() {
                            synchronized(failureResult) {
                                status.compareAndSet(0, 3);
                                if(count.decrementAndGet() == 0) {
                                    handleComplete();
                                }
                            }
                        }
View Full Code Here

            }

            @Override
            public void handleResultComplete() {
                synchronized (finalResult) {
                    status.compareAndSet(0, 1);
                    finalResult.notify();
                }
            }

            @Override
View Full Code Here

            }

            @Override
            public void handleFailed(final ModelNode failureDescription) {
                synchronized (finalResult) {
                    if (status.compareAndSet(0, 3)) {
                        if (failureDescription != null && failureDescription.isDefined()) {
                            finalResult.get(FAILURE_DESCRIPTION).set(failureDescription);
                        }
                    }
                    finalResult.notify();
View Full Code Here

            }

            @Override
            public void handleCancellation() {
                synchronized (finalResult) {
                    if (status.compareAndSet(0, 2)) {
                        finalResult.remove(RESULT);
                    }
                    finalResult.notify();
                }
            }
View Full Code Here

                }

                @Override
                public void handleResultComplete() {
                    clearAsynchronousOperation(asynchronousRequestId);
                    if(!status.compareAndSet(0, 1)) {
                        throw new RuntimeException("Result already set");
                    }
                    completeLatch.countDown();
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.