Package org.apache.geronimo.kernel

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


                    return;
                }
                Long snapshotDuration = Integer.parseInt(args[1]) * 60000L;
                Long prevSnapshotDuration;
                if(running == 1) {
                    prevSnapshotDuration = (Long) kernel.invoke(gbeanName, "getSnapshotDuration");
                    if(prevSnapshotDuration.equals(snapshotDuration)) {
                        consoleReader.printString(DeployUtils.reformat("Stats query snapshot is already running with duration of " + snapshotDuration/60000 + " min.", 4, 72));
                    } else {
                        kernel.invoke(gbeanName, "setSnapshotDuration", new Object[] {snapshotDuration}, new String[]{Long.class.getName()});
                        consoleReader.printString(DeployUtils.reformat("Stats query snapshot was already running with duration of " + prevSnapshotDuration/60000 + " min. Now it is changed to "+ snapshotDuration/60000 + " min.", 4, 72));
View Full Code Here


                if(running == 1) {
                    prevSnapshotDuration = (Long) kernel.invoke(gbeanName, "getSnapshotDuration");
                    if(prevSnapshotDuration.equals(snapshotDuration)) {
                        consoleReader.printString(DeployUtils.reformat("Stats query snapshot is already running with duration of " + snapshotDuration/60000 + " min.", 4, 72));
                    } else {
                        kernel.invoke(gbeanName, "setSnapshotDuration", new Object[] {snapshotDuration}, new String[]{Long.class.getName()});
                        consoleReader.printString(DeployUtils.reformat("Stats query snapshot was already running with duration of " + prevSnapshotDuration/60000 + " min. Now it is changed to "+ snapshotDuration/60000 + " min.", 4, 72));
                    }
                } else {
                    Boolean status = (Boolean) kernel.invoke(gbeanName, "startSnapshot", new Object[] {snapshotDuration}, new String[]{Long.class.getName()});
                    consoleReader.printString(DeployUtils.reformat(status ? "Stats query snapshot started successfully with snapshot duration of " + snapshotDuration/60000 + " min.": "Enabling Stats query snapshot failed.", 4, 72));
View Full Code Here

                    } else {
                        kernel.invoke(gbeanName, "setSnapshotDuration", new Object[] {snapshotDuration}, new String[]{Long.class.getName()});
                        consoleReader.printString(DeployUtils.reformat("Stats query snapshot was already running with duration of " + prevSnapshotDuration/60000 + " min. Now it is changed to "+ snapshotDuration/60000 + " min.", 4, 72));
                    }
                } else {
                    Boolean status = (Boolean) kernel.invoke(gbeanName, "startSnapshot", new Object[] {snapshotDuration}, new String[]{Long.class.getName()});
                    consoleReader.printString(DeployUtils.reformat(status ? "Stats query snapshot started successfully with snapshot duration of " + snapshotDuration/60000 + " min.": "Enabling Stats query snapshot failed.", 4, 72));
                }
            }
        } catch (GBeanNotFoundException e) {
            throw new DeploymentException("Unable to find the gbean associated with monitoring.", e);
View Full Code Here

        }
        AbstractNameQuery anq= new AbstractNameQuery("org.apache.geronimo.management.geronimo.KeystoreManager");
        Set<AbstractName> it=kernel.listGBeans(anq);
        AbstractName an = (AbstractName) it.iterator().next();
        try {
            kernel.invoke(an, "initializeKeystores");
        } catch (GBeanNotFoundException e1) {
            throw new DeploymentException("Unable to find the gbean associated with initializeKeystores");
        } catch (NoSuchOperationException e1) {
            throw new DeploymentException("Operation initializeKeystores does not exist");
        } catch (InternalKernelException e1) {
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

        }
        Kernel kernel = getKernel();
        Object proxy;
        try {
            //TODO configid objectname might well be wrong kind of thing.
            proxy = kernel.invoke(containerName, "getHome", new Object[]{nsCorbaloc, objectName}, new String[]{URI.class.getName(), String.class.getName()});
        } catch (Exception e) {
            log.error("Could not get proxy from " + containerName, e);
            throw (IllegalStateException) new IllegalStateException("Could not get proxy").initCause(e);
        }
        if (proxy == null) {
View Full Code Here

    }

    private void connectInternalProxy() throws Throwable {
        Kernel kernel = KernelRegistry.getKernel(kernelName);
        try {
            internalProxy = kernel.invoke(targetName, "$getConnectionFactory");
        } catch (Exception e) {
            throw new IllegalStateException("Could not connect proxy to ManagedConnectionFactoryWrapper").initCause(e);
        }
    }
}
View Full Code Here

                // nothing explicit, see what was running before
                Set configLists = kernel.listGBeans(PERSISTENT_CONFIGURATION_LIST_NAME_QUERY);
                for (Iterator i = configLists.iterator(); i.hasNext();) {
                    ObjectName configListName = (ObjectName) i.next();
                    try {
                        configs.addAll((List) kernel.invoke(configListName, "restore"));
                    } catch (IOException e) {
                        System.err.println("Unable to restore last known configurations");
                        e.printStackTrace();
                        kernel.shutdown();
                        System.exit(3);
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.