Package org.glassfish.hk2.runlevel

Examples of org.glassfish.hk2.runlevel.ErrorInformation


       
        if (descriptor.getLocatorId() == null) {
            throw new IllegalArgumentException("The descriptor must have a specific locator ID");
        }
       
        return new SpecificFilterImpl(contract, name,
                descriptor.getServiceId(),
                descriptor.getLocatorId());
       
    }
View Full Code Here


            }
        }
       
        private void currentJobComplete(MultiException exception) {
            if (exception != null) {
                ErrorInformation info =
                        invokeOnError(future, exception, ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP, listeners);
               
                if (!ErrorInformation.ErrorAction.IGNORE.equals(info.getAction())) {
                    DownAllTheWay downer = new DownAllTheWay(workingOn - 1, null, null);
               
                    downer.run();
               
                    synchronized (lock) {                   
View Full Code Here

            myRunner.run();
        }
       
        private void fail(Throwable th) {
            synchronized (lock) {
                ErrorInformation info = invokeOnError(currentTaskFuture, th,
                        ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP, listeners);
               
                if (ErrorInformation.ErrorAction.IGNORE.equals(info.getAction())) return;
               
                if (exception == null) {
                    exception = new MultiException();
                }
               
View Full Code Here

                parent.setCurrentLevel(proceedingTo);
               
                // But we don't call the proceedTo until all those services are gone
                List<ActiveDescriptor<?>> toRemove = parent.getOrderedListOfServicesAtLevel(workingOn);
               
                ErrorInformation errorInfo = null;
                for (ActiveDescriptor<?> removeMe : toRemove) {
                    try {
                        locator.getServiceHandle(removeMe).destroy();
                    }
                    catch (Throwable th) {
                        if (future != null) {
                            errorInfo = invokeOnError(future, th, ErrorInformation.ErrorAction.IGNORE, listeners);
                        }
                    }
                   
                }
               
                if (errorInfo != null && ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP.equals(errorInfo.getAction())) {
                    goingTo = workingOn;
                }
               
                workingOn--;
               
View Full Code Here

            }
        }
       
        private void currentJobComplete(MultiException exception) {
            if (exception != null) {
                ErrorInformation info =
                        invokeOnError(future, exception, ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP, listeners);
               
                if (!ErrorInformation.ErrorAction.IGNORE.equals(info.getAction())) {
                    DownAllTheWay downer = new DownAllTheWay(workingOn - 1, null, null);
               
                    downer.run();
               
                    synchronized (lock) {                   
View Full Code Here

            myRunner.run();
        }
       
        private void fail(Throwable th) {
            synchronized (lock) {
                ErrorInformation info = invokeOnError(currentTaskFuture, th,
                        ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP, listeners);
               
                if (ErrorInformation.ErrorAction.IGNORE.equals(info.getAction())) return;
               
                if (exception == null) {
                    exception = new MultiException();
                }
               
View Full Code Here

                parent.setCurrentLevel(proceedingTo);
               
                // But we don't call the proceedTo until all those services are gone
                List<ActiveDescriptor<?>> toRemove = parent.getOrderedListOfServicesAtLevel(workingOn);
               
                ErrorInformation errorInfo = null;
                for (ActiveDescriptor<?> removeMe : toRemove) {
                    try {
                        locator.getServiceHandle(removeMe).destroy();
                    }
                    catch (Throwable th) {
                        if (future != null) {
                            errorInfo = invokeOnError(future, th, ErrorInformation.ErrorAction.IGNORE, listeners);
                        }
                    }
                   
                }
               
                if (errorInfo != null && ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP.equals(errorInfo.getAction())) {
                    goingTo = workingOn;
                }
               
                workingOn--;
               
View Full Code Here

       
        private void fail(Throwable th, Descriptor descriptor) {
            synchronized (lock) {
                if (hardCancelled) return;
               
                ErrorInformation info = invokeOnError(currentTaskFuture, th,
                        ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP,
                        listeners,
                        descriptor);
               
                if (ErrorInformation.ErrorAction.IGNORE.equals(info.getAction())) return;
               
                if (accumulatedExceptions == null) {
                    accumulatedExceptions = new MultiException();
                }
               
View Full Code Here

                        this.notifyAll();
                    }
                    queueWaiter = false;
                }
               
                ErrorInformation errorInfo = null;
                synchronized (queue) {
                    for (;;) {
                        DownQueueRunner currentRunner = new DownQueueRunner(queue, queue, this, locator);
                        executor.execute(currentRunner);
                   
                        lastError = null;
                        for (;;) {
                            while (!queue.isEmpty() && (lastError == null) && (downHardCancelled == false)) {
                                try {
                                    queue.wait();
                                }
                                catch (InterruptedException ie) {
                                    throw new RuntimeException(ie);
                                }
                            }
                           
                            if (downHardCancelled) {
                                currentRunner.caput = true;
                            }
                       
                            if ((lastError != null) && (future != null)) {
                                errorInfo = invokeOnError(future, lastError, ErrorInformation.ErrorAction.IGNORE, listeners, lastErrorDescriptor);
                            }
                            lastError = null;
                            lastErrorDescriptor = null;
                       
                            if (queue.isEmpty() || downHardCancelled) {
                                downHardCancelled = false;
                                break;
                            }
                        }
                       
                        if (queue.isEmpty()) {
                            if (hardCancelDownTimer != null) {
                                hardCancelDownTimer.cancel();
                            }
                           
                            break;
                        }
                    }
                }
               
                synchronized(this) {
                    queue = null;
                }
               
                if (errorInfo != null && ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP.equals(errorInfo.getAction())) {
                    synchronized (this) {
                        goingTo = workingOn;
                    }
                }
               
View Full Code Here

        injectionMgr.inject(result, injector);
        return result;
    }
   
    private void parseInHk2LocatorOrig(BufferedReader reader, Map<String, String> cliCommandNames) throws IOException {
        DescriptorImpl desc = new DescriptorImpl();
        while (desc.readObject(reader)) {
            if (StringUtils.ok(desc.getName()) && desc.getAdvertisedContracts().contains(CLICommand.class.getName())) {
                cliCommandNames.put(desc.getName(), desc.getImplementation());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.hk2.runlevel.ErrorInformation

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.