Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.Kernel.invoke()


            // load the configuration
            config.setAttribute("baseURL", unpackedDir.toURL());
            kernel.loadGBean(config, cl);
            kernel.startGBean(configName);
            kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
            kernel.invoke(configName, "startRecursiveGBeans");
            Set gb = kernel.listGBeans(JMXUtil.getObjectName("test:*"));
            for (Iterator iterator = gb.iterator(); iterator.hasNext();) {
                ObjectName name = (ObjectName) iterator.next();
                if (State.RUNNING_INDEX != kernel.getGBeanState(name)) {
View Full Code Here


            // load the configuration
            config.setAttribute("baseURL", unpackedDir.toURL());
            kernel.loadGBean(config, cl);
            kernel.startGBean(configName);
            kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
            kernel.invoke(configName, "startRecursiveGBeans");
            Set gb = kernel.listGBeans(JMXUtil.getObjectName("test:*"));
            for (Iterator iterator = gb.iterator(); iterator.hasNext();) {
                ObjectName name = (ObjectName) iterator.next();
                if (State.RUNNING_INDEX != kernel.getGBeanState(name)) {
                    System.out.println("Not running: " + name);
View Full Code Here

        if (inVMCall) {
            oldConfigurationDir = configurationData.getConfigurationDir();
        }
        Object[] params = new Object[] {configurationData, configurationDataFile};
        try {
            kernel.invoke(clusterConfigurationStoreName, "install", params, METHOD_SIGNATURE_INSTALL);
        } catch (Exception e) {
            throw (IOException) new IOException("See nested").initCause(e);
        } finally {
            if (inVMCall) {
                configurationData.setConfigurationDir(oldConfigurationDir);
View Full Code Here

       
        AbstractName clusterConfigurationStoreName = searchClusterConfigurationStore(kernel);
       
        Object[] params = new Object[] {configId};
        try {
            kernel.invoke(clusterConfigurationStoreName, "uninstall", params, METHOD_SIGNATURE_UNINSTALL);
        } catch (Exception e) {
            throw (IOException) new IOException("See nested").initCause(e);
        }
    }
   
View Full Code Here

    }

    public void deployPlan(File moduleFile, File planFile) {
        try {
            Kernel kernel = KernelRegistry.getSingleKernel();
            List list = (List) kernel.invoke(ObjectNameConstants.DEPLOYER_OBJECT_NAME, DEPLOY_METHOD,
                    new Object[] {moduleFile, planFile}, DEPLOYER_ARGS);
            ConfigurationManager configurationManager = ConfigurationUtil
                    .getConfigurationManager(kernel);
            for (Iterator iterator = list.iterator(); iterator.hasNext();) {
                Artifact configID = Artifact.create((String)iterator.next());
View Full Code Here

            consoleReader.printString(DeployUtils.reformat("String to encrypt: "+commandArgs.getArgs()[0], 4, 72));
            DeploymentManager dm = connection.getDeploymentManager();
            if (dm instanceof RemoteDeploymentManager) {
                // Online encryption
                Kernel k = ((RemoteDeploymentManager)dm).getKernel();
                Object ret = k.invoke(EncryptionManagerWrapperGBean.class, "encrypt", new Object[] {commandArgs.getArgs()[0]}, new String[] {"java.io.Serializable"});
                consoleReader.printString(DeployUtils.reformat("Online encryption result: "+ret, 4, 72));
            } else {
                // Offline encryption
                Object ret = EncryptionManager.encrypt(commandArgs.getArgs()[0]);
                consoleReader.printString(DeployUtils.reformat("Offline encryption result: "+ret, 4, 72));
View Full Code Here

            if (configs.isEmpty()) {
                // nothing explicit, see what was running before
                if (kernel.isLoaded(PersistentConfigurationList.OBJECT_NAME)) {
                    try {
                        configs = (List) kernel.invoke(PersistentConfigurationList.OBJECT_NAME, "restore");
                    } catch (IOException e) {
                        System.err.println("Unable to restore last known configurations");
                        e.printStackTrace();
                        kernel.shutdown();
                        System.exit(3);
View Full Code Here

            }

            log.info("Server startup completed");

            // invoke the main method
            kernel.invoke(
                    manifest.getMainGBean(),
                    manifest.getMainMethod(),
                    new Object[]{args},
                    new String[]{String[].class.getName()});
View Full Code Here

        AbstractNameQuery nameQuery = new AbstractNameQuery("org.apache.geronimo.monitoring.MasterRemoteControlJMX");
        Set<AbstractName> it = kernel.listGBeans(nameQuery);
        AbstractName gbeanName = (AbstractName) it.iterator().next();
        Integer running = 0;
        try {
            running = (Integer) kernel.invoke(gbeanName, "SnapshotStatus");
            if("disable".equals(args[0])) {
                if(running == 1) {
                    Boolean status = (Boolean) kernel.invoke(gbeanName, "stopSnapshot");
                    consoleReader.printString(DeployUtils.reformat(status ? "Stats query snapshot is now disabled." : "Disabling Stats query snapashot failed.", 4, 72));
                } else {
View Full Code Here

        Integer running = 0;
        try {
            running = (Integer) kernel.invoke(gbeanName, "SnapshotStatus");
            if("disable".equals(args[0])) {
                if(running == 1) {
                    Boolean status = (Boolean) kernel.invoke(gbeanName, "stopSnapshot");
                    consoleReader.printString(DeployUtils.reformat(status ? "Stats query snapshot is now disabled." : "Disabling Stats query snapashot failed.", 4, 72));
                } else {
                    consoleReader.printString(DeployUtils.reformat("Stats query snapshot is not running.", 4, 72));
                }
            } else if("enable".equals(args[0])) {
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.