Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.Kernel$KernelReference


        File targetServerPath = serverInfo.resolveServer(relativeTargetServerPath);
        if (targetServerPath.exists()) {
          FileUtils.forceDelete(targetServerPath);
        }
        String targetServerPathName = targetServerPath.getAbsolutePath();
        Kernel kernel = new BasicKernel("assembly");

        try {
//            kernel.boot();
            PluginInstallerGBean installer = new PluginInstallerGBean(
                    targetRepositoryPath,
                    targetServerPathName,
                    serverInstanceDatas,
                    kernel,
                    classLoader);

            installer.install(pluginList, localSourceRepository, true, null, null, downloadPoller);
        } finally {
            kernel.shutdown();
        }
        return downloadPoller;
    }
View Full Code Here


    private AbstractName nameA;
    private AbstractName nameB;

    @Override
    protected void setUp() throws Exception {
        Kernel kernel = (Kernel) mock(Kernel.class);
       
        ManageableAttributeStore attributeStore = (ManageableAttributeStore) mock(ManageableAttributeStore.class);
        PersistentConfigurationList configurationList = (PersistentConfigurationList) mock(PersistentConfigurationList.class);
        ArtifactManager artifactManager = (ArtifactManager) mock(ArtifactManager.class);
        ArtifactResolver artifactResolver = (ArtifactResolver) mock(ArtifactResolver.class);
View Full Code Here

        try {
            if (port == null) {
                port = DEFAULT_PORT;
            }
            System.out.print("Locating server on port " + port + "... ");
            Kernel kernel = null;
            try {
                kernel = getRunningKernel();
            } catch (IOException e) {
                System.out.println("\nCould not communicate with the server.  The server may not be running or the port number may be incorrect.");
            }
            if (kernel != null) {
                System.out.println("Server found.");
                System.out.println("Server shutdown started");
                kernel.shutdown();
                System.out.println("Server shutdown completed");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return 1;
View Full Code Here

  }

  public Kernel getRunningKernel() throws IOException {
    Map map = new HashMap();
    map.put("jmx.remote.credentials", new String[] { user, password });
    Kernel kernel = null;
    try {
      JMXServiceURL address = new JMXServiceURL(
          "service:jmx:rmi:///jndi/rmi://localhost" + ":" + port + "/JMXConnector");
      JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
      MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
View Full Code Here

        String[] credentials = new String[]{user, password};
        environment.put(javax.management.remote.JMXConnector.CREDENTIALS, credentials);
        javax.management.remote.JMXServiceURL address = new javax.management.remote.JMXServiceURL("service:" + uri);
        javax.management.remote.JMXConnector jmxConnector = javax.management.remote.JMXConnectorFactory.connect(address, environment);
        javax.management.MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
        Kernel kernel = new org.apache.geronimo.system.jmx.KernelDelegate(mbServerConnection);
        return new KernelManagementHelper(kernel);
    }
View Full Code Here

        String configId = request.getParameter("configId");
        if(configId == null) {
            throw new ServletException("No configId specified for CAR download");
        }
        Artifact artifact = Artifact.create(configId);
        Kernel kernel = KernelRegistry.getSingleKernel();
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
        ConfigurationStore store = mgr.getStoreForConfiguration(artifact);
        try {
            response.setContentType("application/zip");
            String filename = artifact.getArtifactId() + "-" + artifact.getVersion() + "." + artifact.getType();
View Full Code Here

            }
        }
    }
   
    protected void install(NodeInfo nodeInfo, ConfigurationData configurationData) throws IOException {
        Kernel kernel = nodeInfo.newKernel();

        AbstractName clusterConfigurationStoreName = searchClusterConfigurationStore(kernel);

        File configurationDataFile = uploadConfiguration(kernel, nodeInfo, configurationData);

        boolean inVMCall = nodeInfo.getConnectorInfo().isLocal();
        File oldConfigurationDir = null;
        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

            }
        }
    }

    protected void uninstall(NodeInfo nodeInfo, Artifact configId) throws IOException {
        Kernel kernel = nodeInfo.newKernel();
       
        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

        RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/sampleNotInstalled.jsp");
        dispatcher.forward(request, response);
    }

    private void doInstall(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Kernel kernel = KernelRegistry.getSingleKernel();
        PluginInstaller installer = getPluginInstaller(kernel);
        String moduleIdName = getInitParameter("moduleId");
        moduleIdName = moduleIdName.replaceAll("SERVER", getServerType());
        URL repo = getFirstPluginRepository(kernel);
        PluginType target = new PluginType();
View Full Code Here

            throws IOException, DDBeanCreateException, InvalidModuleException, ConfigurationException, DeploymentManagerCreationException {
        WebDeployable webDeployable = new WebDeployable(WarUrl);
        DDBeanRoot ddBeanRoot = webDeployable.getDDBeanRoot();
        DDBean ddBean = ddBeanRoot.getChildBean("web-app")[0];

        Kernel kernel = PortletManager.getKernel();
        DeploymentFactory factory = new DeploymentFactoryWithKernel(kernel);
        DeploymentManager deploymentManager = factory.getDeploymentManager("deployer:geronimo:inVM", null, null);
        DeploymentConfiguration deploymentConfiguration = deploymentManager.createConfiguration(webDeployable);
        WebAppDConfigRoot configRoot = (WebAppDConfigRoot) deploymentConfiguration.getDConfigBeanRoot(ddBeanRoot);
        WebAppDConfigBean webApp = (WebAppDConfigBean) configRoot.getDConfigBean(ddBean);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.Kernel$KernelReference

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.