本文整理汇总了Java中org.apache.geode.LogWriter.fine方法的典型用法代码示例。如果您正苦于以下问题:Java LogWriter.fine方法的具体用法?Java LogWriter.fine怎么用?Java LogWriter.fine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.geode.LogWriter
的用法示例。
在下文中一共展示了LogWriter.fine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConnection
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
public Object getConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
if (DEBUG) {
try {
throw new NullPointerException("Asif:JCAManagedConnection:getConnection");
} catch (NullPointerException npe) {
npe.printStackTrace();
}
}
try {
if (!this.initDone || this.cache.isClosed()) {
init();
}
LogWriter logger = this.cache.getLogger();
if (logger.fineEnabled()) {
logger.fine("JCAManagedConnection:getConnection. Returning new Connection");
}
GFConnectionImpl conn = new GFConnectionImpl(this);
this.connections.add(conn);
return conn;
} catch (SystemException e) {
this.onError(e);
throw new ResourceException("GemFire Resource unavailable", e);
}
}
示例2: executeFunctionReexecuteExceptionOnServer
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
private synchronized void executeFunctionReexecuteExceptionOnServer(FunctionContext context) {
if (context.isPossibleDuplicate()) {
retryCount++;
} else {
firstExecutionCount++;
}
DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
LogWriter logger = ds.getLogWriter();
logger.fine("Executing executeException in TestFunction on Member : "
+ ds.getDistributedMember() + "with Context : " + context);
if (retryCount >= 5) {
logger.fine("Tried Function Execution 5 times. Now Returning after 5 attempts");
context.getResultSender().sendResult(new Integer(firstExecutionCount));
context.getResultSender().lastResult(new Integer(retryCount));
firstExecutionCount = 0;
retryCount = 0;
return;
}
if (context.getArguments() instanceof Boolean) {
logger.fine("MyFunctionExecutionException Exception is intentionally thrown");
throw new InternalFunctionInvocationTargetException(
new MyFunctionExecutionException("I have been thrown from TestFunction"));
}
}
示例3: getMetaData
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
public ManagedConnectionMetaData getMetaData() throws ResourceException {
if (DEBUG) {
try {
throw new NullPointerException("Asif:JCAManagedConnection:getMetaData");
} catch (NullPointerException npe) {
npe.printStackTrace();
}
}
if (this.initDone && !this.cache.isClosed()) {
LogWriter logger = this.cache.getLogger();
if (logger.fineEnabled()) {
logger.fine("JCAManagedConnection:getMetaData");
}
}
return new JCAManagedConnectionMetaData(this.factory.getProductName(),
this.factory.getVersion(), this.factory.getUserName());
}
示例4: createPerformanceLogger
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
@Override
protected PerformanceLogger createPerformanceLogger() {
final LogWriter logWriter = createLogWriter();
final PerformanceLogger perfLogger = new PerformanceLogger() {
@Override
public void log(final String message) {
logWriter.fine(message);
}
@Override
public boolean isEnabled() {
return logWriter.fineEnabled();
}
};
return perfLogger;
}
示例5: testBug35358
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
/**
* This test does the following<br>
* 1)Create client cache and region<br>
* 2)Call registerInterest with specific keys (having extra keys other than those pre-populated on
* server cache) and policy:KEYS<br>
* 3)At the end of registerInterest call, verify that only prepolulated entries are created in the
* client cache with null values (entries for keys in the keylist which are not on the server
* should not be created on the client as a result of registerInterest call)<br>
*/
@Test
public void testBug35358() {
Host host = Host.getHost(0);
LogWriter logger = getSystem().getLogWriter();
logger.fine("testBug35358 BEGIN");
Object[] objArr = new Object[2];
objArr[0] = InterestResultPolicy.KEYS;
/* registering for 5 extra keys */
objArr[1] = new Integer(PREPOPULATED_ENTRIES + 5);
vm1.invoke(() -> InterestResultPolicyDUnitTest
.createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT)));
vm1.invoke(InterestResultPolicyDUnitTest.class, "registerInterest", objArr);
vm1.invoke(InterestResultPolicyDUnitTest.class, "verifyResult", objArr);
Integer cnt = (Integer) vm0.invoke(() -> InterestResultPolicyDUnitTest.getEntryCount());
assertEquals(cnt.intValue(), PREPOPULATED_ENTRIES);
logger.fine("testBug35358 END");
}
示例6: registerInterest
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
/**
* Registers the test region on client with a keylist containing all keys pre-populated on server
* and a given {@link InterestResultPolicy} type.
*
* @param interestPolicy - InterestResultPolicy type specified (NONE,KEYS,KEY_VALUES or DEFAULT)
*/
public static void registerInterest(Object interestPolicy, Object totalKeysToRegister) {
InterestResultPolicy policy = (InterestResultPolicy) interestPolicy;
int totalKeys = ((Integer) totalKeysToRegister).intValue();
Region region1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
LogWriter logger = cache.getLogger();
logger.fine("Registering interest in " + totalKeys + " keys");
List keylist = new ArrayList();
for (int i = 0; i < totalKeys; i++) {
keylist.add("key-" + i);
}
try {
region1.registerInterest(keylist, policy);
} catch (CacheWriterException e) {
Assert.fail("failed to register interestlist for the client", e);
}
}
示例7: executeWithThrowException
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
private void executeWithThrowException(FunctionContext context) {
DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
RegionFunctionContext rfContext = (RegionFunctionContext) context;
LogWriter logger = ds.getLogWriter();
logger.fine("Executing executeWithThrowException in TestFunction on Member : "
+ ds.getDistributedMember() + "with Context : " + context);
if (context.getArguments() instanceof Boolean) {
logger.fine("MyFunctionExecutionException Exception is intentionally thrown");
throw new MyFunctionExecutionException("I have been thrown from TestFunction");
} else if (rfContext.getArguments() instanceof Set) {
Set origKeys = (Set) rfContext.getArguments();
for (Iterator i = origKeys.iterator(); i.hasNext();) {
Region r = PartitionRegionHelper.getLocalDataForContext(rfContext);
Object key = i.next();
Object val = r.get(key);
if (val != null) {
throw new MyFunctionExecutionException("I have been thrown from TestFunction");
}
}
} else {
logger.fine("Result sent back :" + Boolean.FALSE);
rfContext.getResultSender().lastResult(Boolean.FALSE);
}
}
示例8: commit
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
public void commit() throws ResourceException {
if (DEBUG) {
try {
throw new NullPointerException("Asif:JCALocalTransaction:commit");
} catch (NullPointerException npe) {
npe.printStackTrace();
}
}
LogWriter logger = cache.getLogger();
if (logger.fineEnabled()) {
logger.fine("JCALocalTransaction:invoked commit");
}
TXStateProxy tsp = this.gfTxMgr.getTXState();
if (tsp != null && this.tid != tsp.getTransactionId()) {
throw new IllegalStateException("Local Transaction associated with Tid = " + this.tid
+ " attempting to commit a different transaction");
}
try {
this.gfTxMgr.commit();
this.tid = null;
} catch (Exception e) {
throw new LocalTransactionException(e.toString());
}
// Iterator<ConnectionEventListener> itr = this.listeners.iterator();
// ConnectionEvent ce = new
// ConnectionEvent(this,ConnectionEvent.LOCAL_TRANSACTION_COMMITTED);
// while( itr.hasNext()) {
// itr.next().localTransactionCommitted(ce);
// }
}
示例9: init
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
private void init() throws SystemException {
this.cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
LogWriter logger = this.cache.getLogger();
if (logger.fineEnabled()) {
logger.fine("JCAManagedConnection:init. Inside init");
}
gfTxMgr = cache.getTxManager();
this.initDone = true;
}
示例10: testPolicyNone
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
/**
* This test does the following<br>
* 1)Create client cache and region<br>
* 2)Call registerInterest with all keys pre-populated on server and policy:NONE<br>
* 3)At the end of registerInterest call, verify that no entries are created in the client
* cache<br>
*/
@Test
public void testPolicyNone() {
LogWriter logger = getSystem().getLogWriter();
logger.fine("testPolicyNone BEGIN");
Object[] objArr = new Object[2];
objArr[0] = InterestResultPolicy.NONE;
objArr[1] = new Integer(PREPOPULATED_ENTRIES);
Host host = Host.getHost(0);
vm1.invoke(() -> InterestResultPolicyDUnitTest
.createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT)));
vm1.invoke(InterestResultPolicyDUnitTest.class, "registerInterest", objArr);
vm1.invoke(InterestResultPolicyDUnitTest.class, "verifyResult", objArr);
logger.fine("testPolicyNone END");
}
示例11: testPolicyKeys
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
/**
* This test does the following<br>
* 1)Create client cache and region<br>
* 2)Call registerInterest with all keys pre-populated on server and policy:KEYS<br>
* 3)At the end of registerInterest call, verify that entries are created in the client cache with
* value null<br>
*/
@Test
public void testPolicyKeys() {
LogWriter logger = getSystem().getLogWriter();
logger.fine("testPolicyKeys BEGIN");
Object[] objArr = new Object[2];
objArr[0] = InterestResultPolicy.KEYS;
objArr[1] = new Integer(PREPOPULATED_ENTRIES);
Host host = Host.getHost(0);
vm1.invoke(() -> InterestResultPolicyDUnitTest
.createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT)));;
vm1.invoke(InterestResultPolicyDUnitTest.class, "registerInterest", objArr);
vm1.invoke(InterestResultPolicyDUnitTest.class, "verifyResult", objArr);
logger.fine("testPolicyKeys END");
}
示例12: testPolicyKeysValues
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
/**
* This test does the following<br>
* 1)Create client cache and region<br>
* 2)Call registerInterest with all keys pre-populated on server and policy:KEYS_VALUES<br>
* 3)At the end of registerInterest call, verify that all entries are created in the client cache
* with values<br>
*/
@Test
public void testPolicyKeysValues() {
LogWriter logger = getSystem().getLogWriter();
logger.fine("testPolicyKeyValues BEGIN");
Object[] objArr = new Object[2];
objArr[0] = InterestResultPolicy.KEYS_VALUES;
objArr[1] = new Integer(PREPOPULATED_ENTRIES);
Host host = Host.getHost(0);
vm1.invoke(() -> InterestResultPolicyDUnitTest
.createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT)));
vm1.invoke(InterestResultPolicyDUnitTest.class, "registerInterest", objArr);
vm1.invoke(InterestResultPolicyDUnitTest.class, "verifyResult", objArr);
logger.fine("testPolicyKeyValues END");
}
示例13: verifyResult
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
/**
* Verifies the number of entries (including values) created on the test region at the end of
* {@link Region#registerInterest} call depending on the type of {@link InterestResultPolicy}
* registered for the region.
*
* @param interestPolicy - {@link InterestResultPolicy} registered for the region
*/
public static void verifyResult(Object interestPolicy, Object totalKeysRegistered) {
Region region1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
int entriesSize = region1.entrySet(false).size();
int keysSize = region1.keySet().size();
int valuesSize = region1.values().size();
InterestResultPolicy policy = (InterestResultPolicy) interestPolicy;
LogWriter logger = cache.getLogger();
logger.fine("policy = " + policy + " ==> entries = " + entriesSize + " ;keys = " + keysSize
+ ";values = " + valuesSize);
if (policy.isNone()) {
// nothing should be created on client cache
assertEquals(0, entriesSize);
assertEquals(0, keysSize);
assertEquals(0, valuesSize);
} else if (policy.isKeys()) {
// all keys should be created with values null
assertEquals(PREPOPULATED_ENTRIES, entriesSize);
assertEquals(PREPOPULATED_ENTRIES, keysSize);
assertEquals(0, valuesSize);
} else if (policy.isKeysValues()) {
// all the keys and values should be created
assertEquals(PREPOPULATED_ENTRIES, entriesSize);
assertEquals(PREPOPULATED_ENTRIES, keysSize);
assertEquals(PREPOPULATED_ENTRIES, valuesSize);
}
}
示例14: executeException
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
private void executeException(FunctionContext context) {
DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
LogWriter logger = ds.getLogWriter();
logger.fine("Executing executeException in TestFunction on Member : "
+ ds.getDistributedMember() + "with Context : " + context);
if (context.getArguments() instanceof Boolean) {
logger.fine("MyFunctionExecutionException Exception is intentionally thrown");
throw new MyFunctionExecutionException("I have been thrown from TestFunction");
} else if (context.getArguments() instanceof String) {
String key = (String) context.getArguments();
logger.fine("Result sent back :" + key);
context.getResultSender().lastResult(key);
} else if (context.getArguments() instanceof Set) {
Set origKeys = (Set) context.getArguments();
ArrayList vals = new ArrayList();
for (Iterator i = origKeys.iterator(); i.hasNext();) {
Object val = i.next();
if (val != null) {
vals.add(val);
}
}
logger.fine("Result sent back :" + vals);
context.getResultSender().lastResult(vals);
} else {
logger.fine("Result sent back :" + Boolean.FALSE);
context.getResultSender().lastResult(Boolean.FALSE);
}
}
示例15: executeWithSendException
import org.apache.geode.LogWriter; //导入方法依赖的package包/类
private void executeWithSendException(FunctionContext context) {
DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
LogWriter logger = ds.getLogWriter();
logger.fine("Executing executeWithSendException in TestFunction on Member : "
+ ds.getDistributedMember() + "with Context : " + context);
if (context.getArguments() instanceof Boolean) {
context.getResultSender()
.sendException(new MyFunctionExecutionException("I have been send from TestFunction"));
} else if (context.getArguments() instanceof String) {
String arg = (String) context.getArguments();
if (arg.equals("Multiple")) {
logger.fine("Sending Exception First time");
context.getResultSender()
.sendException(new MyFunctionExecutionException("I have been send from TestFunction"));
logger.fine("Sending Exception Second time");
context.getResultSender()
.sendException(new MyFunctionExecutionException("I have been send from TestFunction"));
}
} else if (context.getArguments() instanceof Set) {
Set args = (Set) context.getArguments();
for (int i = 0; i < args.size(); i++) {
context.getResultSender().sendResult(new Integer(i));
}
context.getResultSender().sendException(
new MyFunctionExecutionException("I have been thrown from TestFunction with set"));
} else {
logger.fine("Result sent back :" + Boolean.FALSE);
context.getResultSender().lastResult(Boolean.FALSE);
}
}