Package org.apache.karaf.admin

Examples of org.apache.karaf.admin.InstanceSettings


        }
        if ("".equals(javaOpts)) {
            javaOpts = null;
        }

        InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts,
                parseStringList(featureURLs), parseStringList(features));

        Instance inst = adminService.createInstance(name, settings);
        if (inst != null) {
            return inst.getPid();
View Full Code Here


        }
        if ("".equals(javaOpts)) {
            javaOpts = null;
        }

        InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, null, null);
        adminService.cloneInstance(name, cloneName, settings);
    }
View Full Code Here

                p.store(os, "Test comment");
            } finally {
                os.close();
            }
           
            InstanceSettings s = new InstanceSettings(8122, 1122, 44444, null, null, null, Arrays.asList("test"));
            as.handleFeatures(f, s);
           
            Properties p2 = new Properties();
            InputStream is = new FileInputStream(f);
            try {
View Full Code Here

     */
    public void testConfigurationFiles() throws Exception {
        AdminServiceImpl service = new AdminServiceImpl();
        service.setStorageLocation(new File("target/instances/" + System.currentTimeMillis()));

        InstanceSettings settings = new InstanceSettings(8122, 1122, 44444, getName(), null, null, null);
        Instance instance = service.createInstance(getName(), settings);

        assertFileExists(instance.getLocation(), "etc/config.properties");
        assertFileExists(instance.getLocation(), "etc/users.properties");
        assertFileExists(instance.getLocation(), "etc/startup.properties");
View Full Code Here

     */
    public void testRenameInstance() throws Exception {
        AdminServiceImpl service = new AdminServiceImpl();
        service.setStorageLocation(new File("target/instances/" + System.currentTimeMillis()));

        InstanceSettings settings = new InstanceSettings(8122, 1122, 44444, getName(), null, null, null);
        Instance instance = service.createInstance(getName(), settings);

        service.renameInstance(getName(), getName() + "b");
        assertNotNull(service.getInstance(getName() + "b"));
    }
View Full Code Here

    public void testToSimulateRenameInstanceByExternalProcess() throws Exception {
        AdminServiceImpl service = new AdminServiceImpl();
        File storageLocation = new File("target/instances/" + System.currentTimeMillis());
        service.setStorageLocation(storageLocation);

        InstanceSettings settings = new InstanceSettings(8122, 1122, 44444, getName(), null, null, null);
        service.createInstance(getName(), settings);
       
        //to simulate the scenario that the instance name get changed by
        //external process, likely the admin command CLI tool, which cause
        //the instance storage file get updated, the AdminService should be
View Full Code Here

    @Argument(index = 0, name = "name", description="The name of the new container instance", required = true, multiValued = false)
    String instance = null;

    protected Object doExecute() throws Exception {
        InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, featureURLs, features);
        getAdminService().createInstance(instance, settings);
        return null;
    }
View Full Code Here

    @Argument(index = 1, name = "cloneName", description = "The name of the cloned container instance", required = true, multiValued = false)
    String cloneName;


    protected Object doExecute() throws Exception {
        InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, null, null);
        getAdminService().cloneInstance(name, cloneName, settings);
        return null;
    }
View Full Code Here

            int rmiServerPort = parsePortNumber(req.getParameter("rmiServerPort"));
            String location = parseString(req.getParameter("location"));
            String javaOpts = parseString(req.getParameter("javaOpts"));
            List<String> featureURLs = parseStringList(req.getParameter("featureURLs"));
            List<String> features = parseStringList(req.getParameter("features"));
            InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, featureURLs, features);
            success = createInstance(name, settings);
        } else if ("destroy".equals(action)) {
            success = destroyInstance(name);
        } else if ("start".equals(action)) {
            String javaOpts = req.getParameter("javaOpts");
View Full Code Here

        m.setAccessible(true);
        return (List<String>) m.invoke(ap, s);
    }
   
    public void testDoPostCreate() throws Exception {
        InstanceSettings is =
            new InstanceSettings(123, 456, 789,  null, null, Collections.singletonList("http://someURL"), Arrays.asList("abc", "def"));
        AdminService adminService = EasyMock.createMock(AdminService.class);
        EasyMock.expect(adminService.createInstance("instance1", is)).andReturn(null);
        EasyMock.expect(adminService.getInstances()).andReturn(new Instance[] {}).anyTimes();
        EasyMock.replay(adminService);
       
View Full Code Here

TOP

Related Classes of org.apache.karaf.admin.InstanceSettings

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.