Package org.apache.karaf.instance.core.internal

Examples of org.apache.karaf.instance.core.internal.InstanceServiceImpl


        if (!dap.prepare(command, null, params)) {
            return;
        }

        InstanceServiceImpl instanceService = new InstanceServiceImpl();
        instanceService.setStorageLocation(storageFile);
        command.setInstanceService(instanceService);
        command.execute(null);
    }
View Full Code Here


        try {
            InstanceCommandSupport mockCommand = EasyMock.createStrictMock(InstanceCommandSupport.class);
            mockCommand.setInstanceService((InstanceService) EasyMock.anyObject());
            EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
                public Object answer() throws Throwable {
                    InstanceServiceImpl instanceService = (InstanceServiceImpl) EasyMock.getCurrentArguments()[0];
                    assertEquals(tempFile, instanceService.getStorageLocation());
                    instanceServices.add(instanceService);
                    return null;
                }
            });
           
            EasyMock.expect(mockCommand.execute(null)).andAnswer(new IAnswer<Object>() {
                public Object answer() throws Throwable {
                    // The Instances Service should be initialized at this point.
                    // One way to find this out is by reading out the port number
                    InstanceServiceImpl instanceService = instanceServices.get(0);
                    Field sshField = InstanceServiceImpl.class.getDeclaredField("defaultSshPortStart");
                    sshField.setAccessible(true);
                    assertEquals(1302, sshField.get(instanceService));
                    Field rmiRegistryField = InstanceServiceImpl.class.getDeclaredField("defaultRmiRegistryPortStart");
                    rmiRegistryField.setAccessible(true);
View Full Code Here

        if (!dap.prepare(command, null, params)) {
            return;
        }
               
        InstanceServiceImpl instanceService = new InstanceServiceImpl();
        instanceService.setStorageLocation(storageFile);
        instanceService.init();
        command.setInstanceService(instanceService);
        command.execute(null);
    }
View Full Code Here

@Services(provides = @ProvideService(InstanceService.class))
public class Activator extends BaseActivator {

    @Override
    protected void doStart() throws Exception {
        InstanceService instanceService = new InstanceServiceImpl();
        register(InstanceService.class, instanceService);

        InstancesMBeanImpl mbean = new InstancesMBeanImpl(instanceService);
        registerMBean(mbean, "type=instance");
    }
View Full Code Here

        if (!dap.prepare(command, null, params)) {
            return;
        }

        InstanceServiceImpl instanceService = new InstanceServiceImpl();
        instanceService.setStorageLocation(storageFile);
        command.setInstanceService(instanceService);
        command.execute();
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.instance.core.internal.InstanceServiceImpl

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.