Package org.apache.geronimo.gbean.runtime

Examples of org.apache.geronimo.gbean.runtime.GBeanInstance


    public Set listGBeans(ObjectName pattern) {
        Set gbeans = registry.listGBeans(pattern);

        Set result = new HashSet(gbeans.size());
        for (Iterator i = gbeans.iterator(); i.hasNext();) {
            GBeanInstance instance = (GBeanInstance) i.next();
            result.add(instance.getObjectNameObject());
        }
        return result;
    }
View Full Code Here


    public Set listGBeans(AbstractNameQuery query) {
        Set gbeans = registry.listGBeans(query);
        Set result = new HashSet(gbeans.size());
        for (Iterator i = gbeans.iterator(); i.hasNext();) {
            GBeanInstance instance = (GBeanInstance) i.next();
            result.add(instance.getAbstractName());
        }
        return result;
    }
View Full Code Here

        if (name != null) {
            return name;
        }

        // try the registry
        GBeanInstance gbeanInstance = registry.getGBeanInstanceByInstance(service);
        if (gbeanInstance != null) {
            return gbeanInstance.getAbstractName();
        }

        // didn't fing the name
        return null;
    }
View Full Code Here

    public boolean isRunning() {
        return running;
    }

    public ClassLoader getClassLoaderFor(AbstractName name) throws GBeanNotFoundException {
        GBeanInstance gbeanInstance = registry.getGBeanInstance(name);
        return gbeanInstance.getClassLoader();
    }
View Full Code Here

    public ClassLoader getClassLoaderFor(Class type) throws GBeanNotFoundException {
        return getClassLoaderFor(null, type);
    }

    public ClassLoader getClassLoaderFor(String shortName, Class type) throws GBeanNotFoundException {
        GBeanInstance gbeanInstance = registry.getGBeanInstance(shortName, type);
        return gbeanInstance.getClassLoader();
    }
View Full Code Here

    /**
     * @deprecated Experimental feature
     */
    public String getStateReason(AbstractName abstractName) {
        try {
            GBeanInstance gbeanInstance = registry.getGBeanInstance(abstractName);
            return gbeanInstance.getStateReason();
        } catch (GBeanNotFoundException e) {
            return null;
        }
    }
View Full Code Here

        infoRegistry.put(gbeanInstance.getAbstractName(), gbeanInstance);
        gbeanInstance.setInstanceRegistry(this);
    }

    public synchronized void unregister(AbstractName abstractName) throws GBeanNotFoundException {
        GBeanInstance gbeanInstance = (GBeanInstance) infoRegistry.remove(abstractName);
        if (gbeanInstance == null) {
            throw new GBeanNotFoundException(abstractName);
        }
        objectNameRegistry.remove(gbeanInstance.getObjectNameObject());
    }
View Full Code Here

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

        }
        return instance;
    }

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

                throw new GBeanNotFoundException("More then one GBean was found with type '" + type.getName() + "'", Collections.singleton(nameQuery));
            }
            throw new GBeanNotFoundException("More then one GBean was found with shortName '" + shortName + "' and type '" + type.getName() + "'", Collections.singleton(nameQuery));
        }

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

TOP

Related Classes of org.apache.geronimo.gbean.runtime.GBeanInstance

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.