Package org.jboss.gravia.runtime

Examples of org.jboss.gravia.runtime.ModuleContext


            remaining = startedAt + timeout - System.currentTimeMillis();
        }
    }

    public static Boolean profileAvailable(String profile, String version, Long timeout) throws Exception {
        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        FabricService fabricService = ServiceLocator.awaitService(moduleContext, FabricService.class);
        ProfileRegistry profileRegistry = fabricService.adapt(ProfileRegistry.class);
        for (long t = 0; (!profileRegistry.hasProfile(version, profile&& t < timeout); t += 2000L) {
            Thread.sleep(2000L);
        }
View Full Code Here


    }

    private static CommandSession getCommandSession(PrintStream printStream) {
        CommandSession commandSession;
        if (RuntimeType.getRuntimeType() == RuntimeType.KARAF) {
            ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
            CommandProcessor commandProcessor = ServiceLocator.awaitService(moduleContext, CommandProcessor.class);
            commandSession = commandProcessor.createSession(System.in, printStream, printStream);
            commandSession.put("APPLICATION", System.getProperty("runtime.id"));
            commandSession.put("USER", "karaf");
        } else {
View Full Code Here

        System.out.println(CommandSupport.executeCommand("fabric:create --force --clean -n"));
        //System.out.println(executeCommand("shell:info"));
        //System.out.println(executeCommand("fabric:info"));
        //System.out.println(executeCommand("fabric:profile-list"));

        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(moduleContext, FabricService.class);
        try {
            FabricService fabricService = fabricProxy.getService();
            System.out.println(CommandSupport.executeCommand("fabric:version-create"));
View Full Code Here

        System.out.println(CommandSupport.executeCommand("fabric:create --force --clean -n"));
        //System.out.println(executeCommand("shell:info"));
        //System.out.println(executeCommand("fabric:info"));
        //System.out.println(executeCommand("fabric:profile-list"));

        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(moduleContext, FabricService.class);
        try {
            FabricService fabricService = fabricProxy.getService();
            Set<Container> containers = ContainerBuilder.child(1).withName("basic_cnt_d").assertProvisioningResult().build(fabricService);
            try {
View Full Code Here

    private final FabricService fabricService;
    private final Long provisionTimeOut;
    private final String container;

    public WaitForContainerCreationTask(String container, Long provisionTimeOut) {
        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        this.fabricService = ServiceLocator.awaitService(moduleContext, FabricService.class);
        this.provisionTimeOut = provisionTimeOut;
        this.container = container;
    }
View Full Code Here

    private final AdminService adminService;
    private final Long provisionTimeOut;
    private final String name;

    public WaitForInstanceStartedTask(String name, Long provisionTimeOut) {
        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        this.adminService = ServiceLocator.awaitService(moduleContext, AdminService.class);
        this.provisionTimeOut = provisionTimeOut;
        this.name = name;
    }
View Full Code Here

    public ExecutorService getExecutorService() {
        return executorService;
    }

    public Future<Set<Container>> prepareAsync(B builder) {
        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(moduleContext, FabricService.class);
        try {
            FabricService fabricService = fabricProxy.getService();
            CompletionService<Set<Container>> completionService = new ExecutorCompletionService<Set<Container>>(executorService);
            return completionService.submit(new CreateContainerTask(fabricService, builder));
View Full Code Here

     */
    @Test
    @SuppressWarnings("unchecked")
    public void testContainerUpgradeAndRollback() throws Exception {
        CommandSupport.executeCommand("fabric:create --force --clean -n");
        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(moduleContext, FabricService.class);
        try {
            FabricService fabricService = fabricProxy.getService();
            Set<Container> containers = ContainerBuilder.create().withName("smoke_camel").withProfiles("feature-camel").assertProvisioningResult().build(fabricService);
            try {
View Full Code Here

    }

    @Test
  public void testJoin() throws Exception {
        System.err.println(CommandSupport.executeCommand("fabric:create --force --clean -n"));
        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();;
        ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(moduleContext, FabricService.class);
        try {
            FabricService fabricService = fabricProxy.getService();

            AdminService adminService = ServiceLocator.awaitService(moduleContext, AdminService.class);
View Full Code Here

    }

    @Test
    public void testCreateChildContainer() throws Exception {
        System.err.println(CommandSupport.executeCommand("fabric:create --force --clean -n"));
        ModuleContext moduleContext = RuntimeLocator.getRequiredRuntime().getModuleContext();
        ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(moduleContext, FabricService.class);
        try {
            FabricService fabricService = fabricProxy.getService();
            Set<Container> containers = ContainerBuilder.child(1).withName("smoke_child_a").build(fabricService);
            try {
View Full Code Here

TOP

Related Classes of org.jboss.gravia.runtime.ModuleContext

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.