Package io.fabric8.service

Examples of io.fabric8.service.ContainerTemplate.execute()


    @Override
    public List<Installation> listInstallations(final ContainerInstallOptions options) {
        Container container = options.getContainer();
        ProcessManagerJmxTemplate jmxTemplate = getJmxTemplate(container, options.getUser(), options.getPassword());
        return jmxTemplate.execute(new ProcessManagerCallback<List<Installation>>() {
            @Override
            public List<Installation> doWithProcessManager(ProcessManagerServiceMBean processManagerService) throws Exception {
                return processManagerService.listInstallations();
            }
        });
View Full Code Here


    @Override
    public Installation install(final ContainerInstallOptions options, final InstallTask postInstall) throws Exception {
        Container container = options.getContainer();
        ProcessManagerJmxTemplate jmxTemplate = getJmxTemplate(container, options.getUser(), options.getPassword());
        return jmxTemplate.execute(new ProcessManagerCallback<Installation>() {
            @Override
            public Installation doWithProcessManager(ProcessManagerServiceMBean processManagerService) throws Exception {
                return processManagerService.install(options.asInstallOptions(), postInstall);
            }
        });
View Full Code Here

    @Override
    public Installation installJar(final ContainerInstallOptions options, final InstallTask postInstall) throws Exception {
        Container container = options.getContainer();
        ProcessManagerJmxTemplate jmxTemplate = getJmxTemplate(container, options.getUser(), options.getPassword());
        return jmxTemplate.execute(new ProcessManagerCallback<Installation>() {
            @Override
            public Installation doWithProcessManager(ProcessManagerServiceMBean processManagerService) throws Exception {
                return processManagerService.installJar(options.asInstallOptions(), postInstall);
            }
        });
View Full Code Here

    @Override
    public ImmutableMap<String, Installation> listInstallationMap(final ContainerInstallOptions options) {
        Container container = options.getContainer();
        ProcessManagerJmxTemplate jmxTemplate = getJmxTemplate(container, options.getUser(), options.getPassword());
        return jmxTemplate.execute(new ProcessManagerCallback<ImmutableMap<String, Installation>>() {
            @Override
            public ImmutableMap<String, Installation> doWithProcessManager(ProcessManagerServiceMBean processManagerService) throws Exception {
                return processManagerService.listInstallationMap();
            }
        });
View Full Code Here

        Command command = new Command(arguments).setDirectory(baseDir);
        Map<String,String> environment = getEnvironment();
        if (environment != null && environment.size() > 0) {
            command = command.addEnvironment(environment);
        }
        return command.execute(executor);
    }
}
View Full Code Here

    private String publicPort(String containerName, final String port) {
        FabricService fabric = fabricService.get();
        Container container = fabric.getContainer(containerName);

        ContainerTemplate containerTemplate = new ContainerTemplate(container, fabric.getZooKeeperUser(), fabric.getZookeeperPassword(), false);
        return containerTemplate.execute(new JmxTemplateSupport.JmxConnectorCallback<String>() {
            @Override
            public String doWithJmxConnector(JMXConnector connector) throws Exception {
                return connector.getMBeanServerConnection().invoke(new ObjectName("io.fabric8:type=Fabric"), "getPublicPortOnCurrentContainer", new Object[]{new Integer(port)}, new String[]{"int"}).toString();
            }
        });
View Full Code Here

            @Override
            public CreateChildContainerMetadata create(final CreateChildContainerOptions options, final CreationStateListener listener) {
                final Container parent = fabricService.get().getContainer(options.getParent());
                ContainerTemplate containerTemplate = new ContainerTemplate(parent, options.getJmxUser(), options.getJmxPassword(), false);

                return containerTemplate.execute(new ContainerTemplate.AdminServiceCallback<CreateChildContainerMetadata>() {
                    public CreateChildContainerMetadata doWithAdminService(AdminServiceMBean adminService) throws Exception {
                        return doCreateKaraf(adminService, options, listener, parent);
                    }
                });
            }
View Full Code Here

        confirm = confirm == null || confirm.trim().equals("") ? "Y" : confirm;

        if ("Y".equalsIgnoreCase(confirm)) {
            System.out.println("----------------------------------------------------------------------------");
            System.out.println(String.format("Creating project in directory: %s", childDir.getCanonicalPath()));
            helper.execute();
            System.out.println("Project created successfully");
            System.out.println("");
        } else {
            System.out.println("----------------------------------------------------------------------------");
            System.out.println("Creating project aborted!");
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.