Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.GBeanNotFoundException


     * @throws GBeanNotFoundException if there is no GBean registered with the supplied name
     */
    public synchronized GBeanInstance getGBeanInstance(ObjectName name) throws GBeanNotFoundException {
        GBeanInstance instance = objectNameRegistry.get(normalizeObjectName(name));
        if (instance == null) {
            throw new GBeanNotFoundException(name);
        }
        return instance;
    }
View Full Code Here


    }

    public synchronized GBeanInstance getGBeanInstance(AbstractName abstractName) throws GBeanNotFoundException {
        GBeanInstance instance = infoRegistry.get(abstractName);
        if (instance == null) {
            throw new GBeanNotFoundException(abstractName);
        }
        return instance;
    }
View Full Code Here

            nameQuery = new AbstractNameQuery(null, Collections.singletonMap("name", shortName), type.getName());
        }
        Set<GBeanInstance> instances = listGBeans(nameQuery);

        if (instances.size() == 0) {
            throw new GBeanNotFoundException("No GBeans found", Collections.singleton(nameQuery), null);
        }

        if (instances.size() > 1) {
            if (type == null) {
                throw new GBeanNotFoundException("More then one GBean was found with shortName '" + shortName + "'", Collections.singleton(nameQuery), mapToNames(instances));
            }
            if (shortName == null) {
                throw new GBeanNotFoundException("More then one GBean was found with type '" + type.getName() + "'", Collections.singleton(nameQuery), mapToNames(instances));
            }
            throw new GBeanNotFoundException("More then one GBean was found with shortName '" + shortName + "' and type '" + type.getName() + "'", Collections.singleton(nameQuery), mapToNames(instances));
        }

        return instances.iterator().next();
    }
View Full Code Here

    public void die() throws GBeanNotFoundException {
        synchronized (this) {
            if (dead) {
                // someone beat us to the punch... this instance should have never been found in the first place
                throw new GBeanNotFoundException(abstractName);
            }
            dead = true;
        }

        // if the bean is already stopped or failed, this will do nothing; otherwise it will shutdown the bean
View Full Code Here

                if (intf.equals(TomcatWebConnector.class.getName())) {
                    found = true;
                }
            }
            if (!found) {
                throw new GBeanNotFoundException(connectorName);
            }
            String searchingFor = info.getName();
            for (Entry<ConnectorType, GBeanInfo> entry : CONNECTOR_GBEAN_INFOS.entrySet() ) {
                String candidate = entry.getValue().getName();
                if (candidate.equals(searchingFor)) {
View Full Code Here

        if (gbeanAbName == null) {
            Set<AbstractName> results = getKernel().listGBeans(abstractNameQueries);
            if (results.size() == 1) {
                return results.iterator().next();
            } else {
                throw new GBeanNotFoundException("ConfigurationAwareReference", abstractNameQueries, results);
            }
        }
        return gbeanAbName;
    }
View Full Code Here

                 if (child.getId().equals(configId[i])) {
                     configuration = child;
                     break next;
                 }
             }
             throw new GBeanNotFoundException("No configuration found for id: " + configId[i], null);
         }
         return configuration;
     }
View Full Code Here

         } catch (GBeanNotFoundException e) {
             Set results = kernel.listGBeans(abstractNameQueries);
             if (results.size() == 1) {
                 return (AbstractName) results.iterator().next();
             }
             throw new GBeanNotFoundException("Name query " + abstractNameQueries + " not satisfied in kernel, matches: " + results, e);
         }
     }
View Full Code Here

    public void die() throws GBeanNotFoundException {
        synchronized (this) {
            if (dead) {
                // someone beat us to the punch... this instance should have never been found in the first place
                throw new GBeanNotFoundException(objectName);
            }
            dead = true;
        }

        // if the bean is already stopped or failed, this will do nothing; otherwise it will shutdown the bean
View Full Code Here

        storeCurrentGBeans();
    }

    public synchronized void removeGBean(ObjectName name) throws GBeanNotFoundException {
        if(!objectNames.contains(name)) {
            throw new GBeanNotFoundException(name);
        }
        kernel.getDependencyManager().removeDependency(name, this.objectName);
        try {
            if(kernel.getGBeanState(name) == State.RUNNING_INDEX) {
                kernel.stopGBean(name);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.GBeanNotFoundException

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.