本文整理汇总了Java中org.vertx.java.platform.PlatformLocator类的典型用法代码示例。如果您正苦于以下问题:Java PlatformLocator类的具体用法?Java PlatformLocator怎么用?Java PlatformLocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlatformLocator类属于org.vertx.java.platform包,在下文中一共展示了PlatformLocator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startProxy
import org.vertx.java.platform.PlatformLocator; //导入依赖的package包/类
private static void startProxy()
{
if (pm == null)
{
pm = PlatformLocator.factory.createPlatformManager();
JsonObject config;
try
{
config = new JsonObject(Resources.toString(Resources.getResource("ramlvalidation_config.json"), Charsets.UTF_8));
}
catch (Exception e)
{
config = null;
}
pm.deployVerticle(ProxyServerApplication.class.getCanonicalName(), config,
((URLClassLoader) ProxyServerApplication.class.getClassLoader()).getURLs(), 1, null, null);
}
}
开发者ID:marekasf,项目名称:raml-validation-proxy,代码行数:21,代码来源:ProxyServerApplication.java
示例2: main
import org.vertx.java.platform.PlatformLocator; //导入依赖的package包/类
/** It starts vertx and deploys this project module */
public static void main(String[] args) throws InterruptedException, IOException {
PlatformManager pm = PlatformLocator.factory.createPlatformManager(5558,"localhost");
pm.deployModule("com.chuidiang.examples~vertx~1.0.0", null, 1, new Handler<AsyncResult<String>>() {
@Override
public void handle(AsyncResult<String> arg0) {
System.out.println("module deploying result "+arg0.result());
}
});
}
开发者ID:chuidiang,项目名称:chuidiang-ejemplos,代码行数:14,代码来源:MainVerticle.java
示例3: createPlatform
import org.vertx.java.platform.PlatformLocator; //导入依赖的package包/类
private void createPlatform(final YamlDocument conf) {
//
// Create platform manager only once (configuration change doesn't matter)
//
if (m_manager == null) {
YamlDocument confCluster = conf.getDocument(CONF_KEY_CLUSTER);
if (confCluster.getValue(CONF_KEY_ENABLED, DEF_CLUSTERED)) {
//
// Create clustered platform
//
m_logger.info("Starting in clustered mode");
YamlDocument confHazelcast = conf.getDocument(CONF_KEY_HAZELCAST);
int hostPort = confHazelcast.getValue(CONF_KEY_HOST_PORT);
List<String> hostAddrs = confHazelcast.getList(CONF_KEY_HOST_ADDRESS);
m_manager = PlatformLocator.factory.createPlatformManager(hostPort, hostAddrs.get(0));
//
// Retrieve hazelcast used by Vert.x (first instance)
//
Set<HazelcastInstance> hzInstances = Hazelcast.getAllHazelcastInstances();
HazelcastInstance hzInstance = hzInstances.iterator().next();
Config hzConfig = hzInstance.getConfig();
hzConfig.getNetworkConfig().getInterfaces().clear();
String clusterName = confCluster.getValue(CONF_KEY_NAME);
String clusterPasswd = confCluster.getValue(CONF_KEY_PASSWORD);
//
// Sanity checks
//
Preconditions.checkNotNull(clusterName, "No cluster name "
+ "defined in configuration file");
Preconditions.checkNotNull(clusterPasswd, "No cluster password "
+ "defined in configuration file");
hzConfig.getGroupConfig().setName(clusterName);
hzConfig.getGroupConfig().setPassword(clusterPasswd);
boolean autoIncrement = confHazelcast.getValue(CONF_KEY_HOST_PORT_AUTO_INCR);
int portCount = confHazelcast.getValue(CONF_KEY_HOST_PORT_COUNT);
hzConfig.getNetworkConfig().setPort(hostPort);
hzConfig.getNetworkConfig().setPortAutoIncrement(autoIncrement);
hzConfig.getNetworkConfig().setPortCount(portCount);
// Enable interfaces
hzConfig.getNetworkConfig().getInterfaces().setInterfaces(hostAddrs);
} else {
//
// Create non-clustered platform
//
m_logger.info("Starting in non-clustered mode");
m_manager = PlatformLocator.factory.createPlatformManager();
}
}
}
开发者ID:clidev,项目名称:spike.x,代码行数:58,代码来源:Main.java
示例4: start
import org.vertx.java.platform.PlatformLocator; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
this.platformManager = PlatformLocator.factory.createPlatformManager();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:5,代码来源:PlatformManagerService.java
注:本文中的org.vertx.java.platform.PlatformLocator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论