本文整理汇总了Java中com.hazelcast.logging.ILogger类的典型用法代码示例。如果您正苦于以下问题:Java ILogger类的具体用法?Java ILogger怎么用?Java ILogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILogger类属于com.hazelcast.logging包,在下文中一共展示了ILogger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SwarmAddressPicker
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
/**
* Constructor
*/
public SwarmAddressPicker(final ILogger iLogger) {
final String dockerNetworkNames = System.getProperty(PROP_DOCKER_NETWORK_NAMES);
final String dockerServiceLabels = System.getProperty(PROP_DOCKER_SERVICE_LABELS);
final String dockerServiceNames = System.getProperty(PROP_DOCKER_SERVICE_NAMES);
final Integer hazelcastPeerPort = Integer.valueOf(System.getProperty(PROP_HAZELCAST_PEER_PORT));
String swarmMgrUri = System.getProperty(PROP_SWARM_MGR_URI);
if (swarmMgrUri == null || swarmMgrUri.trim().isEmpty()) {
swarmMgrUri = System.getenv("DOCKER_HOST");
}
Boolean skipVerifySsl = false;
if (System.getProperty(PROP_SKIP_VERIFY_SSL) != null) {
skipVerifySsl = Boolean.valueOf(System.getProperty(PROP_SKIP_VERIFY_SSL));
}
initialize(iLogger, dockerNetworkNames, dockerServiceLabels, dockerServiceNames, hazelcastPeerPort, swarmMgrUri, skipVerifySsl);
}
示例2: discoveryStrategyFactory
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Bean
public DiscoveryStrategyFactory discoveryStrategyFactory () {
return new DiscoveryStrategyFactory() {
@Override
public Class<? extends DiscoveryStrategy> getDiscoveryStrategyType () {
return EurekaDiscoveryStrategy.class;
}
@Override
public DiscoveryStrategy newDiscoveryStrategy (DiscoveryNode discoveryNode,
ILogger logger,
Map<String, Comparable> properties
) {
val eurekaDiscoveryStrategy = new EurekaDiscoveryStrategy(logger, emptyMap());
eurekaDiscoveryStrategy.setDiscoveryClient(discoveryClient);
eurekaDiscoveryStrategy.setHaselcastNodeServiceId(applicationName);
return eurekaDiscoveryStrategy;
}
@Override
public Collection<PropertyDefinition> getConfigurationProperties () {
return null;
}
};
}
示例3: init
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Override
public void init(
String consulHost,
Integer consulPort,
String consulServiceName,
String[] consulServiceTags,
String consulAclToken,
boolean consulSslEnabled,
String consulSslServerCertFilePath,
String consulSslServerCertBase64,
boolean consulServerHostnameVerify,
DiscoveryNode localDiscoveryNode,
Map<String, Object> registratorConfig,
ILogger logger) {
}
示例4: run
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Override
public void run() throws Exception {
ILogger logger = getLogger();
JetService service = getService();
Address callerAddress = getCallerAddress();
logger.fine("Completing execution " + idToString(executionId) + " from caller: " + callerAddress
+ " with " + error);
Address masterAddress = getNodeEngine().getMasterAddress();
if (!callerAddress.equals(masterAddress)) {
throw new IllegalStateException("Caller " + callerAddress + " cannot complete execution of "
+ idToString(executionId) + " because it is not master. Master is: " + masterAddress);
}
service.getJobExecutionService().completeExecution(executionId, error);
}
示例5: init
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Override
public void init(@Nonnull Outbox outbox, @Nonnull Context context) {
logger = context.logger();
outbox = new LoggingOutbox(outbox, peekOutput, peekSnapshot);
// Fix issue #595: pass a logger with real class name to processor
// We do this only if context is ProcCtx (that is, not for tests where TestProcessorContext can be used
// and also other objects could be mocked or null, such as jetInstance())
if (context instanceof ProcCtx) {
ProcCtx c = (ProcCtx) context;
NodeEngine nodeEngine = ((HazelcastInstanceImpl) c.jetInstance().getHazelcastInstance()).node.nodeEngine;
ILogger newLogger = nodeEngine.getLogger(
createLoggerName(wrappedProcessor.getClass().getName(), c.vertexName(), c.globalProcessorIndex()));
context = new ProcCtx(c.jetInstance(), c.getSerializationService(), newLogger, c.vertexName(),
c.globalProcessorIndex(), c.processingGuarantee());
}
wrappedProcessor.init(outbox, context);
}
示例6: test
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Test
public void test() {
// Given
Processor p = supplierFrom(writeLoggerP()).get();
TestInbox inbox = new TestInbox();
Outbox outbox = mock(Outbox.class);
ILogger logger = mock(ILogger.class);
p.init(outbox, new TestProcessorContext().setLogger(logger));
// When
inbox.add(1);
p.process(0, inbox);
Watermark wm = new Watermark(2);
p.tryProcessWatermark(wm);
// Then
verifyZeroInteractions(outbox);
verify(logger).info("1");
verify(logger).info(wm.toString());
verifyZeroInteractions(logger);
}
示例7: before
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Before
public void before() {
inbox = new TestInbox();
inbox.add(MOCK_ITEM);
int[] capacities = new int[OUTBOX_BUCKET_COUNT];
Arrays.fill(capacities, 1);
outbox = new TestOutbox(capacities);
final Processor.Context ctx = mock(Processor.Context.class);
Mockito.when(ctx.logger()).thenReturn(mock(ILogger.class));
p = new RegisteringMethodCallsP();
p.init(outbox, ctx);
tryProcessP = new SpecializedByOrdinalP();
tryProcessP.init(outbox, ctx);
nothingOverriddenP = new NothingOverriddenP();
nothingOverriddenP.init(outbox, ctx);
}
示例8: createReadHandler
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Override
public ReadHandler createReadHandler(final TcpIpConnection connection) {
return new MemberReadHandler(connection, new PacketDispatcher() {
private ILogger logger = loggingService.getLogger("MockIOService");
@Override
public void dispatch(Packet packet) {
try {
if (packet.getPacketType() == Packet.Type.BIND) {
connection.getConnectionManager().handle(packet);
} else {
PacketHandler handler = packetHandler;
if (handler != null) {
handler.handle(packet);
}
}
} catch (Exception e) {
logger.severe(e);
}
}
});
}
示例9: createReadHandler
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Override
public ReadHandler createReadHandler(final TcpIpConnection connection) {
return new MemberReadHandler(connection, new PacketDispatcher() {
private ILogger logger = getLogger("MockIOService");
@Override
public void dispatch(Packet packet) {
try {
if (packet.isFlagSet(FLAG_BIND)) {
connection.getConnectionManager().handle(packet);
} else {
PacketHandler handler = packetHandler;
if (handler != null) {
handler.handle(packet);
}
}
} catch (Exception e) {
logger.severe(e);
}
}
});
}
示例10: process
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
public void process() {
final Address endPoint = conn.getEndPoint();
if (endPoint == null) {
return;
}
final ILogger logger = node.getLogger(MasterConfirmation.class.getName());
final ClusterManager clusterManager = node.clusterManager;
final MemberImpl member = clusterManager.getMember(endPoint);
if (member != null) {
if (getNode().isMaster()) {
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST, "MasterConfirmation has been received from " + member);
}
clusterManager.memberMasterConfirmationTimes.put(member, Clock.currentTimeMillis());
} else {
logger.log(Level.WARNING, endPoint + " has sent MasterConfirmation, but this node is not master!");
}
} else {
logger.log(Level.WARNING, "MasterConfirmation has been received from " + endPoint
+ ", but it is not a member of this cluster!");
clusterManager.sendProcessableTo(new MemberRemover(clusterManager.thisAddress), conn);
}
}
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:24,代码来源:ClusterManager.java
示例11: process
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
public void process() {
if (conn == null) {
return;
}
final Address endpoint = conn.getEndPoint();
final Address masterAddress = node.getMasterAddress();
final ILogger logger = node.loggingService.getLogger(this.getClass().getName());
if (endpoint == null || !endpoint.equals(masterAddress)) {
logger.log(Level.WARNING, "Merge instruction sent from non-master endpoint: " + endpoint);
return;
}
node.getExecutorManager().executeNow(new Runnable() {
public void run() {
logger.log(Level.WARNING, node.address + " is merging to " + newTargetAddress
+ ", because: instructed by master " + masterAddress);
node.getJoiner().setTargetAddress(newTargetAddress);
node.factory.restart();
}
});
}
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:23,代码来源:MergeClusters.java
示例12: SomeRestServiceDiscoveryStrategy
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
public SomeRestServiceDiscoveryStrategy(DiscoveryNode discoveryNode, ILogger logger, //
Map<String, Comparable> properties) {
super(logger, properties);
this.discoveryNode = discoveryNode;
this.baseUrl = getOrDefault("discovery.rest", DISCOVERY_URL, "http://localhost:12345/");
this.applicationScope = getOrDefault("discovery.rest", APPLICATION_SCOPE, "hazelcast-cluster");
logger.info("SomeRestService discovery strategy started {url=" //
+ baseUrl + ", scope=" + applicationScope + "}");
GsonConverterFactory converterFactory = GsonConverterFactory.create();
Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl).addConverterFactory(converterFactory).build();
this.someRestService = retrofit.create(SomeRestService.class);
}
开发者ID:noctarius,项目名称:hazelcast-discovery-spi-demonstration,代码行数:16,代码来源:SomeRestServiceDiscoveryStrategy.java
示例13: newDiscoveryStrategy
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
public DiscoveryStrategy newDiscoveryStrategy(DiscoveryNode discoveryNode, ILogger logger,
Map<String, Comparable> properties) {
EurekaOneDiscoveryStrategyBuilder builder = new EurekaOneDiscoveryStrategyBuilder();
builder.setDiscoveryNode(discoveryNode).setILogger(logger).setProperties(properties)
.setEurekaClient(eurekaClient);
return builder.build();
}
示例14: getLogger
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Override
public final ILogger getLogger() {
final String name = getClass().getName();
try {
return instance.getLoggingService().getLogger(name);
} catch (UnsupportedOperationException e) {
// HazelcastInstance is instance of HazelcastClient.
return Logger.getLogger(name);
}
}
示例15: setUp
import com.hazelcast.logging.ILogger; //导入依赖的package包/类
@Before
public void setUp() {
ILogger log = Logger.getLogger(ReadWriteAccessDelegateTest.class);
cache = mock(RegionCache.class);
HazelcastRegion region = mock(HazelcastRegion.class);
when(region.getLogger()).thenReturn(log);
when(region.getCache()).thenReturn(cache);
delegate = new ReadWriteAccessDelegate<HazelcastRegion>(region, null);
}