当前位置: 首页>>代码示例>>Java>>正文


Java StartException类代码示例

本文整理汇总了Java中org.jboss.msc.service.StartException的典型用法代码示例。如果您正苦于以下问题:Java StartException类的具体用法?Java StartException怎么用?Java StartException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


StartException类属于org.jboss.msc.service包,在下文中一共展示了StartException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public void start(StartContext startContext) throws StartException {

    Consul.Builder builder = Consul.builder();


    // pool because of multiple threads.
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();
    clientBuilder = clientBuilder.connectionPoolSize(20);

    builder.withClientBuilder(clientBuilder);
    builder.withUrl(this.url);

    try {
        this.consul = builder.build();
    } catch (Exception e) {
        throw new StartException("Failed to connect consul at " + url, e);
    }
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology-consul,代码行数:20,代码来源:ConsulService.java

示例2: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
    ServiceTarget target = context.getChildTarget();

    ClientService clientService = new ClientService();
    target.addService(ClientService.SERVICE_NAME, clientService)
            .install();

    NamespaceService namespaceService = new NamespaceService();
    target.addService(NamespaceService.SERVICE_NAME, namespaceService)
            .addDependency(ClientService.SERVICE_NAME, IClient.class, namespaceService.getClientInjector())
            .install();

    ServiceWatcher watcher = new ServiceWatcher();
    target.addService(ServiceWatcher.SERVICE_NAME, watcher)
            .addDependency(ClientService.SERVICE_NAME, IClient.class, watcher.getClientInjector())
            .addDependency(NamespaceService.SERVICE_NAME, String.class, watcher.getNamespaceInjector())
            .addDependency(TopologyManagerActivator.SERVICE_NAME, TopologyManager.class, watcher.getTopologyManagerInjector())
            .install();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:21,代码来源:OpenShiftTopologyConnector.java

示例3: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
    int port = Integer.getInteger(SwarmProperties.ARQUILLIAN_DAEMON_PORT, 12345);

    try {
        this.server = Server.create("localhost", port);
        this.server.start();
    } catch (Exception e) {
        // this shouldn't be possible per Java control flow rules, but there is a "sneaky throw" somewhere
        //noinspection ConstantConditions
        if (e instanceof BindException) {
            log.log(Level.SEVERE, "Couldn't bind Arquillian Daemon on localhost:" + port
                    + "; you can change the port using system property '"
                    + SwarmProperties.ARQUILLIAN_DAEMON_PORT + "'", e);
        }

        throw new StartException(e);
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:20,代码来源:DaemonService.java

示例4: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
    parser = new HCIDumpParser(cmdArgs);
    final ServiceContainer serviceContainer = context.getController().getServiceContainer();

    try {
        log.infof("Begin scanning");
        // Start the scanner parser handler threads other than the native stack handler
        parser.start();
        // Setup the native bluetooth stack integration, callbacks, and stack thread
        HCIDump.setRawEventCallback(parser::beaconEvent);
        HCIDump.initScanner(cmdArgs.hciDev);
        // Schedule a thread to wait for a shutdown marker
        Thread shutdownMonitor = new Thread(() -> awaitShutdown(serviceContainer), "ShutdownMonitor");
        shutdownMonitor.setDaemon(true);
        shutdownMonitor.start();
    } catch (Exception e) {
        log.error("Scanner exiting on exception", e);
        context.failed(new StartException(e));
    }
}
 
开发者ID:RHioTResearch,项目名称:SwarmBeaconScanner,代码行数:22,代码来源:ScannerService.java

示例5: startNest

import org.jboss.msc.service.StartException; //导入依赖的package包/类
protected void startNest() throws StartException {
        if (isStarted()) {
            return; // nothing to do, already started
        }

        msglog.infoNestName(getNestName());

//        // we don't necessarily need the broker, but if it is not started, log that fact.
//        BrokerService broker = this.brokerService.getValue();
//        if (broker.isBrokerStarted()) {
//            try {
//                setupMessaging(broker);
//            } catch (Exception e) {
//                throw new StartException("Cannot initialize messaging client", e);
//            }
//        } else {
//            msglog.infoBrokerServiceNotStarted();
//        }

        this.started = true;
    }
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:22,代码来源:NestService.java

示例6: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
    try {
        final String artifactName = System.getProperty(BootstrapProperties.APP_ARTIFACT);
        if (artifactName == null) {
            throw new StartException("Failed to find artifact name under " + BootstrapProperties.APP_ARTIFACT);
        }

        final ModuleLoader serviceLoader = this.serviceLoader.getValue();
        final String moduleName = "deployment." + artifactName;
        final Module module = serviceLoader.loadModule(ModuleIdentifier.create(moduleName));
        if (module == null) {
            throw new StartException("Failed to find deployment module under " + moduleName);
        }

        //TODO: allow overriding the default port?
        this.server = Server.create("localhost", 12345, module.getClassLoader());
        this.server.start();
    } catch (ModuleLoadException | ServerLifecycleException e) {
        throw new StartException(e);
    }
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:23,代码来源:DaemonServiceActivator.java

示例7: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public void start(StartContext startContext) throws StartException {

    Consul.Builder builder = Consul.builder();


    // pool because of multiple threads.
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();
    clientBuilder = clientBuilder.connectionPoolSize(20);

    builder.withClientBuilder(clientBuilder);
    builder.withUrl(this.url);

    try {
        this.consul = builder.build();
    } catch (Exception e) {
        throw new StartException("Failed to connect consul at "+url, e);
    }
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:20,代码来源:ConsulService.java

示例8: createConnectorManagers

import org.jboss.msc.service.StartException; //导入依赖的package包/类
private void createConnectorManagers(ConnectorManagerRepository cmr, final TranslatorRepository repo, final VDBMetaData deployment) throws StartException {
	final IdentityHashMap<Translator, ExecutionFactory<Object, Object>> map = new IdentityHashMap<Translator, ExecutionFactory<Object, Object>>();
	
	try {
		ConnectorManagerRepository.ExecutionFactoryProvider provider = new ConnectorManagerRepository.ExecutionFactoryProvider() {
			
			@Override
			public ExecutionFactory<Object, Object> getExecutionFactory(String name) throws ConnectorManagerException {
				return VDBService.getExecutionFactory(name, repo, getTranslatorRepository(), deployment, map, new HashSet<String>());
			}
		};
		cmr.setProvider(provider);
		cmr.createConnectorManagers(deployment, provider);
	} catch (ConnectorManagerException e) {
		if (e.getCause() != null) {
			throw new StartException(IntegrationPlugin.Event.TEIID50035.name()+" "+e.getMessage(), e.getCause()); //$NON-NLS-1$
		}
		throw new StartException(e.getMessage());
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:21,代码来源:VDBService.java

示例9: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
public void start(final StartContext startContext) throws StartException {
    startContext.asynchronous();
    this.active = true;
    this.thread = new Thread(new Runnable() {
        public void run() {
            startContext.complete();

            while (active) {
                System.err.println(message);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                	Thread.currentThread().interrupt();
                }
            }

        }
    });

    this.thread.start();
}
 
开发者ID:jbosschina,项目名称:wildfly-dev-cookbook,代码行数:22,代码来源:MyService.java

示例10: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
    ModelNode propertiesModel = _model.hasDefined(CommonAttributes.PROPERTIES) ? _model.get(CommonAttributes.PROPERTIES) : null;
    Properties securityProps = toProperties(propertiesModel);
    _securityConfig = new SecurityConfig(securityProps);
    DefaultSystemSecurity systemSecurity = (DefaultSystemSecurity)getSystemSecurity().getValue();
    if (SecurityContext.class.getName().equals(_moduleId)) {
        String timeoutMillis = Strings.trimToNull(securityProps.getProperty("timeoutMillis"));
        if (timeoutMillis != null) {
            systemSecurity.setSecurityContextTimeoutMillis(Long.valueOf(timeoutMillis));
        }
    }
    if (PrivateCrypto.class.getName().equals(_moduleId)) {
        systemSecurity.setPrivateCrypto(new PrivateCrypto(securityProps));
    }
    if (PublicCrypto.class.getName().equals(_moduleId)) {
        systemSecurity.setPublicCrypto(new PublicCrypto(securityProps));
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:20,代码来源:SwitchYardSecurityConfigService.java

示例11: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
    Class<?> componentClass;
    String className = _model.get(CommonAttributes.IMPLCLASS).asString();
    try {
        componentClass = Module.loadClassFromCallerModuleLoader(ModuleIdentifier.fromString(_moduleId), className);
        try {
            _component = (Component) componentClass.newInstance();
            ModelNode properties = _model.hasDefined(CommonAttributes.PROPERTIES) ? _model.get(CommonAttributes.PROPERTIES) : null;
            _component.init(createEnvironmentConfig(properties));
            LOG.debug("Initialized component " + _component);
            _component.addResourceDependency(_resourceAdapterRepository.getValue());
        } catch (InstantiationException ie) {
            ExtensionLogger.ROOT_LOGGER.unableToInstantiateClass(className, ie);
        } catch (IllegalAccessException iae) {
            ExtensionLogger.ROOT_LOGGER.unableToAccessConstructor(className, iae);
        }
    } catch (ClassNotFoundException cnfe) {
        ExtensionLogger.ROOT_LOGGER.unableToLoadClass(className, cnfe);
    } catch (ModuleLoadException mle) {
        ExtensionLogger.ROOT_LOGGER.unableToLoadModule(_moduleId, mle);
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:24,代码来源:SwitchYardComponentService.java

示例12: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void start(StartContext context) throws StartException {
    try {
        NamespaceContextSelector selector = _namespaceSelector.getValue();
        NamespaceContextSelector.pushCurrentSelector(selector);
        LOG.info("Starting SwitchYard service");
        List<Component> components = new ArrayList<Component>();
        for (InjectedValue<Component> component : _components) {
            components.add(component.getValue());
        }
        _switchyardDeployment.setNamespaceContextSelector(selector);
        _switchyardDeployment.start(components);
    } catch (Exception e) {
        try {
            _switchyardDeployment.stop();
        } catch (Exception ex) {
            LOG.error(ex);
        }
        throw new StartException(e);
    } finally {
        NamespaceContextSelector.popCurrentSelector();
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:25,代码来源:SwitchYardService.java

示例13: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
/**
 * @see org.jboss.msc.service.Service#start(org.jboss.msc.service.StartContext)
 */
@Override
public void start(StartContext context) throws StartException {
    try {
        log.debug("Creating model controller client");
        modelControllerClient = injectedModelController.getValue().createClient(managementOperationExecutor);

        log.debug("Adding model controller client to scheduler context");
        scheduler.getContext().put(MODEL_CONTROLLER_CLIENT, modelControllerClient);

        log.info("Starting metrics scheduler");
        scheduler.start();
    } catch(SchedulerException e) {
        throw new StartException("Error starting scheduler", e);
    }
}
 
开发者ID:ncdc,项目名称:jboss-openshift-metrics-module,代码行数:19,代码来源:MetricsService.java

示例14: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
public synchronized void start(final StartContext context) throws StartException {
    ServerEnvironment serverEnvironment = configuration.getServerEnvironment();
    Bootstrap.ConfigurationPersisterFactory configurationPersisterFactory = configuration.getConfigurationPersisterFactory();
    extensibleConfigurationPersister = configurationPersisterFactory.createConfigurationPersister(serverEnvironment, getExecutorServiceInjector().getOptionalValue());
    setConfigurationPersister(extensibleConfigurationPersister);
    rootResourceDefinition.setDelegate(
            new ServerRootResourceDefinition(injectedContentRepository.getValue(),
                    extensibleConfigurationPersister, configuration.getServerEnvironment(), processState,
                    runningModeControl, vaultReader, configuration.getExtensionRegistry(),
                    getExecutorServiceInjector().getOptionalValue() != null,
                    (PathManagerService)injectedPathManagerService.getValue(),
                    new DomainServerCommunicationServices.OperationIDUpdater() {
                        @Override
                        public void updateOperationID(final int operationID) {
                            DomainServerCommunicationServices.updateOperationID(operationID);
                        }
                    },
                    authorizer,
                    securityIdentitySupplier,
                    super.getAuditLogger(),
                    getMutableRootResourceRegistrationProvider(),
                    super.getBootErrorCollector(),
                    configuration.getCapabilityRegistry()));
    super.start(context);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:ServerService.java

示例15: start

import org.jboss.msc.service.StartException; //导入依赖的package包/类
@Override
public synchronized void start(StartContext context) throws StartException {
    try {
        this.jarFile = new JarFile(file);
    } catch (IOException e) {
        throw new StartException(e);
    }
    final ModuleSpec.Builder specBuilder = ModuleSpec.build(moduleIdentifier);
    addResourceRoot(specBuilder, jarFile);
    //TODO: We need some way of configuring module dependencies for external archives
    ModuleIdentifier javaee = ModuleIdentifier.create("javaee.api");
    specBuilder.addDependency(DependencySpec.createModuleDependencySpec(javaee));
    specBuilder.addDependency(DependencySpec.createLocalDependencySpec());
    // TODO: external resource need some kind of dependency mechanism
    ModuleSpec moduleSpec = specBuilder.create();
    this.moduleDefinition = new ModuleDefinition(moduleIdentifier, Collections.<ModuleDependency>emptySet(), moduleSpec);


    ServiceModuleLoader.installModuleResolvedService(context.getChildTarget(), moduleIdentifier);

}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:ExternalModuleSpecService.java


注:本文中的org.jboss.msc.service.StartException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。