Examples of GBeanQuery


Examples of org.apache.geronimo.gbean.GBeanQuery

    public ActiveMQManagerGBean(Kernel kernel) {
        this.kernel = kernel;
    }

    public String[] getBrokers() {
        GBeanQuery query = new GBeanQuery(null, ActiveMQBroker.class.getName());
        Set set = kernel.listGBeans(query);
        String[] results = new String[set.size()];
        int i=0;
        for (Iterator it = set.iterator(); it.hasNext();) {
            ObjectName name = (ObjectName) it.next();
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

        // see files in modules/core/src/conf/META-INF/services/org/activemq/transport/server/
        return new String[]{"activeio","jabber","multicast","openwire","peer","tcp","ttmp","udp","vm",};
    }

    public String[] getConnectors() {
        GBeanQuery query = new GBeanQuery(null, ActiveMQConnector.class.getName());
        Set set = kernel.listGBeans(query);
        String[] results = new String[set.size()];
        int i=0;
        for (Iterator it = set.iterator(); it.hasNext();) {
            ObjectName name = (ObjectName) it.next();
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

    public String[] getConnectors(String protocol) {
        if(protocol == null) {
            return getConnectors();
        }
        GBeanQuery query = new GBeanQuery(null, ActiveMQConnector.class.getName());
        Set set = kernel.listGBeans(query);
        List results = new ArrayList();
        for (Iterator it = set.iterator(); it.hasNext();) {
            ObjectName name = (ObjectName) it.next();
            try {
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

            ObjectName brokerName = ObjectName.getInstance(broker);
// Aaron: this doesn't work so well because it doesn't show stopped GBeans -- using all the code after this instead
//            return (String[]) kernel.getAttribute(brokerName, "connectors");
            List results = new ArrayList();
            String target = brokerName.getKeyProperty("name");
            GBeanQuery query = new GBeanQuery(null, ActiveMQConnector.class.getName());
            Set set = kernel.listGBeans(query);
            for (Iterator it = set.iterator(); it.hasNext();) {
                ObjectName name = (ObjectName) it.next(); // a connector
                String test = name.getKeyProperty("broker");
                if(test != null && test.equals(target)) {
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

//                } catch (Exception e) {
//                    log.error("Unable to look up protocol for connector '"+name+"'", e);
//                }
//            }
            String target = brokerName.getKeyProperty("name");
            GBeanQuery query = new GBeanQuery(null, ActiveMQConnector.class.getName());
            Set set = kernel.listGBeans(query);
            for (Iterator it = set.iterator(); it.hasNext();) {
                ObjectName name = (ObjectName) it.next(); // a connector
                String test = name.getKeyProperty("broker");
                if(test != null && test.equals(target)) {
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

        }
        return null;
    }

    public Object[] findByInterface(Class iface) {
        Set set = kernel.listGBeans(new GBeanQuery(null, iface.getName()));
        Object[] result = new Object[set.size()];
        int i=0;
        for (Iterator it = set.iterator(); it.hasNext();) {
            ObjectName name = (ObjectName) it.next();
            result[i++] = kernel.getProxyManager().createProxy(name, iface.getClassLoader());
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

     * @return The ConfigurationManager
     *
     * @throws IllegalStateException Occurs if a ConfigurationManager cannot be identified
     */
    public static ConfigurationManager getConfigurationManager(Kernel kernel) {
        Set names = kernel.listGBeans(new GBeanQuery(null, ConfigurationManager.class.getName()));
        for (Iterator iterator = names.iterator(); iterator.hasNext();) {
            ObjectName objectName = (ObjectName) iterator.next();
            try {
                if (kernel.getGBeanState(objectName) != State.RUNNING_INDEX) {
                    iterator.remove();
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

     * @return The EdtiableConfigurationManager, or none if there is not one available.
     *
     * @throws IllegalStateException Occurs if there are multiple EditableConfigurationManagers in the kernel.
     */
    public static EditableConfigurationManager getEditableConfigurationManager(Kernel kernel) {
        Set names = kernel.listGBeans(new GBeanQuery(null, EditableConfigurationManager.class.getName()));
        for (Iterator iterator = names.iterator(); iterator.hasNext();) {
            ObjectName objectName = (ObjectName) iterator.next();
            try {
                if (kernel.getGBeanState(objectName) != State.RUNNING_INDEX) {
                    iterator.remove();
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

     * root for the web application.
     *
     * @return The URL that clients should use for deployment file uploads.
     */
    public String getRemoteDeployUploadURL() {
        Set set = kernel.listGBeans(new GBeanQuery(null, "org.apache.geronimo.deployment.remote.RemoteDeployToken"));
        if(set.size() == 0) {
            return null;
        }
        ObjectName token = (ObjectName) set.iterator().next();
        set = kernel.getDependencyManager().getParents(token);
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanQuery

     * Given a web container ObjectName, constructs a URL to point to it.
     * Currently favors HTTP then HTTPS and ignores AJP (since AJP
     * means it goes through a web server listening on an unknown port).
     */
    private String getURLFor(String containerName) throws Exception {
        Set set = kernel.listGBeans(new GBeanQuery(null, "org.apache.geronimo.management.geronimo.WebManager"));
        for (Iterator it = set.iterator(); it.hasNext();) {
            ObjectName mgrName = (ObjectName) it.next();
            String[] cntNames = (String[]) kernel.getAttribute(mgrName, "containers");
            for (int i = 0; i < cntNames.length; i++) {
                String cntName = cntNames[i];
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.