Package org.apache.geronimo.kernel

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


        }
        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


            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

        }
        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

            nameMap.put("J2EEApplication", dataSourceAppName);
            nameMap.put("j2eeType", "JCAConnectionManager");
            Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(null, nameMap));
            for (AbstractName name : set) {
                try {
                    dataSource = (DataSource) kernel.invoke(name, "createConnectionFactory");
                    break;
                } catch (GBeanNotFoundException e) {
                    // ignore... GBean was unregistered
                } catch (NoSuchOperationException e) {
View Full Code Here

            nameMap.put("J2EEApplication", dataSourceAppName);
            nameMap.put("j2eeType", "JCAConnectionManager");
            Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(null, nameMap));
            for (AbstractName name : set) {
                try {
                    dataSource = (DataSource) kernel.invoke(name, "createConnectionFactory");
                    break;
                } catch (GBeanNotFoundException e) {
                    // ignore... GBean was unregistered
                } catch (NoSuchOperationException 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

           
            consoleReader.printString(DeployUtils.reformat("String to encrypt: "+commandArgs.getArgs()[0], 4, 72));
            if (!isOffline(connection)) {
                // Online encryption           
                Kernel k = getKernel(connection);
                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

       
        Kernel kernel = KernelRegistry.getSingleKernel();
       
        try {
            if (SYSTEM_DATASOURCE_NAME!=null && ((String)SYSTEM_DATASOURCE_NAME.getName().get(NameFactory.J2EE_NAME)).equalsIgnoreCase(dsName)) {
              return (DataSource) kernel.invoke(
                  SYSTEM_DATASOURCE_NAME, "$getResource");
            }
           
            AbstractNameQuery query = new AbstractNameQuery(GenericConnectionManager.class.getName());
            Set<AbstractName> names = KernelRegistry.getSingleKernel().listGBeans(query);
View Full Code Here

            AbstractNameQuery query = new AbstractNameQuery(GenericConnectionManager.class.getName());
            Set<AbstractName> names = KernelRegistry.getSingleKernel().listGBeans(query);
            for (AbstractName name : names) {
                String nameProperty = name.getNameProperty("name");
                if (dsName.equals(nameProperty)) {
                    return (DataSource) kernel.invoke(name, "$getResource");
                }
            }
           
        } catch (Exception e) {
          log.error("Problem getting datasource " + dsName, 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

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.