[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: gyan10  XML
Profile for gyan10 -> Messages posted by gyan10 [682] Go to Page: Previous  1, 2, 3  ...  44, 45, 46
Author Message
This is very old thread.Please respond if issue is still not resolved.
Thanks
This is very old thread.Please respond if issue is still not resolved.
Thanks
This is very old thread.Please respond if issue is stil not resolved.
Thanks
To get clear idea about how to configure Ehcache.Please visit documentation given on Terracotta site:
http://www.terracotta.org/documentation/product-documentation-1page
If you do not want to use URL hard coded as in given sample code. You can set URL as a system property in Ehcache.xml and get the URL using CacheManager.
You can check the samle Ehcache.xml for more information.
Here is a sample code using ToolKit and ClusteredLock:

[code]
package Test;

import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;

import org.terracotta.api.*;
import org.terracotta.cluster.*;
import org.terracotta.locking.*;

public class ReadWriteLock {

/**
* @param args
*/
public static void main(String[] args) {

TerracottaClient client = new TerracottaClient("localhost:9510"); //start client
ClusteringToolkit toolkit = client.getToolkit(); //make the toolkit available to you application

ClusterInfo clusterinfo= toolkit.getClusterInfo();
System.out.println("Cluster Info" + toolkit.getClusterInfo());
ClusteredLock mylock = (ClusteredLock) toolkit.createLock("Mylock", LockType.WRITE); //create alock

mylock.lock();

try{

//Do some Clustered Operation.

}finally{
mylock.unlock();
}
}

}
[/code]
Please provide us the source code , configuration files and steps to reproduce the issue.
Thanks
 
Profile for gyan10 -> Messages posted by gyan10 [682] Go to Page: Previous  1, 2, 3  ...  44, 45, 46
Go to:   
Powered by JForum 2.1.7 © JForum Team