本文整理汇总了Java中com.hazelcast.config.NetworkConfig.setSSLConfig方法的典型用法代码示例。如果您正苦于以下问题:Java NetworkConfig.setSSLConfig方法的具体用法?Java NetworkConfig.setSSLConfig怎么用?Java NetworkConfig.setSSLConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.config.NetworkConfig
的用法示例。
在下文中一共展示了NetworkConfig.setSSLConfig方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HazelcastSessionDao
import com.hazelcast.config.NetworkConfig; //导入方法依赖的package包/类
public HazelcastSessionDao() {
log.info("Initializing Hazelcast Shiro session persistence..");
// configure Hazelcast instance
final Config cfg = new Config();
cfg.setInstanceName(hcInstanceName);
// group configuration
cfg.setGroupConfig(new GroupConfig(HC_GROUP_NAME, HC_GROUP_PASSWORD));
// network configuration initialization
final NetworkConfig netCfg = new NetworkConfig();
netCfg.setPortAutoIncrement(true);
netCfg.setPort(HC_PORT);
// multicast
final MulticastConfig mcCfg = new MulticastConfig();
mcCfg.setEnabled(false);
mcCfg.setMulticastGroup(HC_MULTICAST_GROUP);
mcCfg.setMulticastPort(HC_MULTICAST_PORT);
// tcp
final TcpIpConfig tcpCfg = new TcpIpConfig();
tcpCfg.addMember("127.0.0.1");
tcpCfg.setEnabled(false);
// network join configuration
final JoinConfig joinCfg = new JoinConfig();
joinCfg.setMulticastConfig(mcCfg);
joinCfg.setTcpIpConfig(tcpCfg);
netCfg.setJoin(joinCfg);
// ssl
netCfg.setSSLConfig(new SSLConfig().setEnabled(false));
// get map
map = Hazelcast.newHazelcastInstance(cfg).getMap(HC_MAP);
log.info("Hazelcast Shiro session persistence initialized.");
}
示例2: setNetwork
import com.hazelcast.config.NetworkConfig; //导入方法依赖的package包/类
private void setNetwork(NetworkConfig network) {
// network.setPublicAddress("11.22.33.44");
network.setPort(port);
network.setPortAutoIncrement(true);
network.setPortCount(100);
network.addOutboundPortDefinition("35000-35100");
// InterfacesConfig interfaces=new InterfacesConfig();
// interfaces.getInterfaces();
// network.setInterfaces(interfaces);
network.getInterfaces().setEnabled(true);
network.getInterfaces().addInterface("*.*.*.*");
network.setSSLConfig(getSslConfig());
setNetworkJoin(network.getJoin());
}
示例3: HazelcastSessionDao
import com.hazelcast.config.NetworkConfig; //导入方法依赖的package包/类
public HazelcastSessionDao() {
log.info("Initializating Hazelcast Shiro session persistence..");
// configure Hazelcast instance
hcInstanceName = UUID.randomUUID().toString();
Config cfg = new Config();
cfg.setInstanceName(hcInstanceName);
// group configuration
cfg.setGroupConfig(new GroupConfig(HC_GROUP_NAME, HC_GROUP_PASSWORD));
// network configuration initialization
NetworkConfig netCfg = new NetworkConfig();
netCfg.setPortAutoIncrement(true);
netCfg.setPort(HC_PORT);
// multicast
MulticastConfig mcCfg = new MulticastConfig();
mcCfg.setEnabled(true);
mcCfg.setMulticastGroup(HC_MULTICAST_GROUP);
mcCfg.setMulticastPort(HC_MULTICAST_PORT);
// tcp
TcpIpConfig tcpCfg = new TcpIpConfig();
tcpCfg.setEnabled(false);
// network join configuration
JoinConfig joinCfg = new JoinConfig();
joinCfg.setMulticastConfig(mcCfg);
joinCfg.setTcpIpConfig(tcpCfg);
netCfg.setJoin(joinCfg);
// ssl
netCfg.setSSLConfig(new SSLConfig().setEnabled(false));
// get map
map = Hazelcast.newHazelcastInstance(cfg).getMap(HC_MAP);
log.info("Hazelcast Shiro session persistence initialized.");
}
示例4: main
import com.hazelcast.config.NetworkConfig; //导入方法依赖的package包/类
public static void main(String[] args) throws InterruptedException {
final Config cfg = new Config();
cfg.setInstanceName(UUID.randomUUID().toString());
final Properties props = new Properties();
props.put("hazelcast.rest.enabled", false);
props.put("hazelcast.logging.type", "slf4j");
props.put("hazelcast.connect.all.wait.seconds", 45);
props.put("hazelcast.operation.call.timeout.millis", 30000);
// group configuration
cfg.setGroupConfig(new GroupConfig(args[0],
args[1]));
// network configuration initialization
final NetworkConfig netCfg = new NetworkConfig();
netCfg.setPortAutoIncrement(true);
netCfg.setPort(5701);
// multicast
final MulticastConfig mcCfg = new MulticastConfig();
mcCfg.setEnabled(false);
// tcp
final TcpIpConfig tcpCfg = new TcpIpConfig();
tcpCfg.addMember("127.0.0.1");
tcpCfg.setEnabled(true);
// network join configuration
final JoinConfig joinCfg = new JoinConfig();
joinCfg.setMulticastConfig(mcCfg);
joinCfg.setTcpIpConfig(tcpCfg);
netCfg.setJoin(joinCfg);
// ssl
netCfg.setSSLConfig(new SSLConfig().setEnabled(false));
// creating cassandra client
final CassandraClient dao = new CassandraClient();
dao.initialize(args[2]);
final HazelcastMapStore mapStore = new HazelcastMapStore(User.class);
mapStore.setDao(dao);
// Adding mapstore
final MapConfig mapCfg = cfg.getMapConfig("cassandra-map-store");
final MapStoreConfig mapStoreCfg = new MapStoreConfig();
mapStoreCfg.setImplementation(mapStore);
mapStoreCfg.setWriteDelaySeconds(1);
// to load all map at same time
mapStoreCfg.setInitialLoadMode(MapStoreConfig.InitialLoadMode.EAGER);
mapCfg.setMapStoreConfig(mapStoreCfg);
cfg.addMapConfig(mapCfg);
HazelcastInstance instance = Hazelcast.newHazelcastInstance(cfg);
// TERM signal processing
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
Hazelcast.shutdownAll();
}));
}
示例5: getConfig
import com.hazelcast.config.NetworkConfig; //导入方法依赖的package包/类
public Config getConfig() {
final Config cfg = new Config();
cfg.setInstanceName(instanceName);
final Properties props = new Properties();
props.put("hazelcast.rest.enabled", false);
props.put("hazelcast.logging.type", "slf4j");
props.put("hazelcast.connect.all.wait.seconds", 45);
props.put("hazelcast.operation.call.timeout.millis", 30000);
// group configuration
cfg.setGroupConfig(new GroupConfig(Constants.HC_GROUP_NAME,
Constants.HC_GROUP_PASSWORD));
// network configuration initialization
final NetworkConfig netCfg = new NetworkConfig();
netCfg.setPortAutoIncrement(true);
netCfg.setPort(Constants.HC_PORT);
// multicast
final MulticastConfig mcCfg = new MulticastConfig();
mcCfg.setEnabled(false);
// tcp
final TcpIpConfig tcpCfg = new TcpIpConfig();
tcpCfg.addMember("127.0.0.1");
tcpCfg.setEnabled(true);
// network join configuration
final JoinConfig joinCfg = new JoinConfig();
joinCfg.setMulticastConfig(mcCfg);
joinCfg.setTcpIpConfig(tcpCfg);
netCfg.setJoin(joinCfg);
// ssl
netCfg.setSSLConfig(new SSLConfig().setEnabled(false));
// Adding mapstore
final MapConfig mapCfg = cfg.getMapConfig(storeType);
final MapStoreConfig mapStoreCfg = new MapStoreConfig();
mapStoreCfg.setImplementation(store);
mapStoreCfg.setWriteDelaySeconds(1);
// to load all map at same time
mapStoreCfg.setInitialLoadMode(MapStoreConfig.InitialLoadMode.EAGER);
mapCfg.setMapStoreConfig(mapStoreCfg);
cfg.addMapConfig(mapCfg);
return cfg;
}