"read through" unmodifiable Collections

I'm seeking clarification on the following clause extracted from the Collections.unmodifiableSet() JavaDoc (1.5): 'Query operations on the returned set "read through" to the specified set'.
Does "read through" mean/imply that using the following definitions
private Set d_rwSet = new HashSet();
private Set d_roSet = Collections.unmodifiableSet(d_rwSet);Any subsequent change to d_rwSet will be automatically reflected in d_roSet?
Thanks ... Matt

Any subsequent change to d_rwSet will be
automatically reflected in d_roSet?Yes that's correct.
Kaj

Similar Messages

  • Can you loop through a collection of entites to read a given attribute?

    I got an entity called <b>the applicant</b>. and this entity has an attribute called <b>the full name of the applicant</b>.
    I want to go through the collection of <b>the applicants</b> and get the <b>full name</b> for each applicant and assign it to a text variable with comma seperated. Is it possible to do this in OPA?
    this is what i want to do
    <b>"the names" </b>is the variable that I want to store the list of names
    read the collection of applicants
    the names = the concatenation of the names & " " & the full name of the applicant & ","
    end
    so it will give me an output like <b>James Blunt, David Brown, Julia Guilard</b>
    Edited by: Davin Fifield on Oct 16, 2011 10:57 PM - removed inappropriate "moderation" edit

    Wow harsh moderation there by rukbat! I don't know who he/she is but I apologise and assure you most people on this forum are not so mean.
    To answer your question, there's no built-in way to do what you want. Normally displaying something like this would be considered an application problem rather than a rule-level problem, however if you really want it done in a rule, you could do it with a custom function.

  • Reading through a text file and then sorting

    I'm having a lot of problems with this.
    I have to read through a text file and I have to split the string up so that it is seperated into individual tokens. A line from the text file looks like this. addEvent(new Bell(tm + 9000)). I have to grab the addEvent, new, Bell, tm and 9000 and store it in a linkedlist. After reading through the whole text file I have to sort the the linked list based on the number. ie: 9000. Is there any way to do this? I currently break up the text file using a StringTokenizer object but then i am uncertain on how to add it to a linked list and then sort each line based on the number. Any help would be appreciated.
    Joe

    Sorry to bother you Ben but I just can't get my head wrapped around this. Here is exactly what I have to do:
    After reading, Events must be stored in the EventSet according to the time they are to occur. Assume that no time number is more than 8 digits long. Restart() must be able to deal appropriately with any order of the Events. To accomplish this have Restart() save the relevant Event information in an LinkedList of strings and sort the Events by time before adding each event to EventSet. Use the <list>.add() to set up your linked list. This is shown in c09:List1.java and Collections.sort(<list>) shown in c09:ListSortSearch. Modify the Bell() to output a single "Bing!". When you read in a Bell event generate the appropriate number of Bell events as indicated by rings. These must be set to the correct times. This is an alternative to generating the new Bell events within Bell(). It will allow them be sorted into their correct time sequence. At this point the output of the program should be identical the original program.
    After the intitial start, when restarting Restart() must provide to the user the option to recreate the EventSet from the linked list or read in a new file (supplied by the user). This must be achieved by prompting the user at the console. Please also allow the user the option to quit the program at this stage.
    Main Program Code:
    public class GreenhouseControls extends Controller
    private boolean light = false;
    private boolean water = false;
    private String thermostat = "Day";
    private boolean fans = false;
         private class FansOn extends Event
              public FansOn(long eventTime)
                   super(eventTime);
              public void action()
              // Put hardware control code here to
              // physically turn on the Fans.
              fans = true;
              public String description()
                   return "Fan is On";
         private class FansOff extends Event
              public FansOff(long eventTime)
                   super(eventTime);
              public void action()
              // Put hardware control code here to
              // physically turn off the Fans.
              fans = false;
              public String description()
                   return "Fans are Off";
         private class LightOn extends Event
              public LightOn(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here to
                   // physically turn on the light.
                   light = true;
              public String description()
                   return "Light is on";
         private class LightOff extends Event
              public LightOff(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here to
                   // physically turn off the light.
                   light = false;
              public String description()
                   return "Light is off";
         private class WaterOn extends Event
              public WaterOn(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here
                   water = true;
              public String description()
                   return "Greenhouse water is on";
         private class WaterOff extends Event
              public WaterOff(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here
                   water = false;
              public String description()
                   return "Greenhouse water is off";
         private class ThermostatNight extends Event
              public ThermostatNight(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here
                   thermostat = "Night";
              public String description()
                   return "Thermostat on night setting";
         private class ThermostatDay extends Event
              public ThermostatDay(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here
                   thermostat = "Day";
              public String description()
                   return "Thermostat on day setting";
         // An example of an action() that inserts a
         // new one of itself into the event list:
         private int rings;
         private class Bell extends Event
              public Bell(long eventTime)
                   super(eventTime);
              public void action()
                   // Ring every 2 seconds, 'rings' times:
                   System.out.println("Bing!");
                   if(--rings > 0)
              addEvent(new Bell(System.currentTimeMillis() + 2000));
              public String description()
                   return "Ring bell";
         private class Restart extends Event
              public Restart(long eventTime)
                   super(eventTime);
              public void action()      
                   long tm = System.currentTimeMillis();
                   // Instead of hard-wiring, you could parse
                   // configuration information from a text
                   // file here:
              try
              BufferedReader in = new BufferedReader(new FileReader("Event Config.txt"));
              String str;
                   String[] l1 = new String[5];
                   LinkedList l2 = new LinkedList();
              while((str = in.readLine()) != null )
                        StringTokenizer st = new StringTokenizer(str, "(+); ");
                        int nIndex = 0;
                        while (st.hasMoreTokens())
                             l1[nIndex] = st.nextToken();
                        //System.out.println(st.nextToken());
                             nIndex++;
                        l2.add(l1);
                   String[] s1 = (String[])l2.get(1);
                   for(int i = 0; i < s1.length; i++)
                        System.out.println(s1);
                   Comparator comp = s1[4];
                   Collections.sort(l2, comp);
              in.close();
              catch (IOException e)
    rings = 5;
    addEvent(new ThermostatNight(tm));
    addEvent(new LightOn(tm + 1000));
    addEvent(new LightOff(tm + 2000));
    addEvent(new WaterOn(tm + 3000));
    addEvent(new WaterOff(tm + 8000));
    addEvent(new Bell(tm + 9000));
    addEvent(new ThermostatDay(tm + 10000));
    // Can even add a Restart object!
    addEvent(new Restart(tm + 20000));*/
    public String description() {
    return "Restarting system";
    public static void main(String[] args) {
    GreenhouseControls gc =
    new GreenhouseControls();
    long tm = System.currentTimeMillis();
    gc.addEvent(gc.new Restart(tm));
    gc.run();
    } ///:~
    Examples File:
    addEvent(new ThermostatNight(tm));
    addEvent(new Bell(tm + 9000));
    addEvent(new Restart(tm + 20000));
    addEvent(new LightOn(tm + 1000));
    addEvent(new WaterOn(tm + 3000));
    rings = 5;
    addEvent(new FansOn(tm + 4000));
    addEvent(new LightOff(tm + 2000));
    addEvent(new FansOff(tm + 6000));
    addEvent(new WaterOff(tm + 8000));
    addEvent(new WindowMalfunction(tm + 15000));
    addEvent(new ThermostatDay(tm + 10000));
    EventSet.java Code:
    // This is just a way to hold Event objects.
    class EventSet {
    private Event[] events = new Event[100];
    private int index = 0;
    private int next = 0;
    public void add(Event e) {
    if(index >= events.length)
    return; // (In real life, throw exception)
    events[index++] = e;
    public Event getNext() {
    boolean looped = false;
    int start = next;
    do {
    next = (next + 1) % events.length;
    // See if it has looped to the beginning:
    if(start == next) looped = true;
    // If it loops past start, the list
    // is empty:
    if((next == (start + 1) % events.length)
    && looped)
    return null;
    } while(events[next] == null);
    return events[next];
    public void removeCurrent() {
    events[next] = null;
    public class Controller {
    private EventSet es = new EventSet();
    public void addEvent(Event c) { es.add(c); }
    public void run() {
    Event e;
    while((e = es.getNext()) != null) {
    if(e.ready()) {
    e.action();
    System.out.println(e.description());
    es.removeCurrent();
    } ///:~
    Event.java Code
    abstract public class Event {
    private long evtTime;
    public Event(long eventTime) {
    evtTime = eventTime;
    public boolean ready() {
    return System.currentTimeMillis() >= evtTime;
    abstract public void action();
    abstract public String description();
    } ///:~
    Is this problem easier than I think it is? I just don't know what to add to the linkedList. A LinkedList within a linkedList? I find this problem pretty difficult. Any help is muchly appreciated.
    Joe

  • Iterate through 2 collections

    Hi,
    I have two collections. One collection (A) has "Item" objects. Next collection (B) has Strings, these Strings are ids of Items.
    class Item{
        String id;
        String ....
    }All the ids in Collection B matches with Item object's id field in Collection A.
    ie: Collection B does not have a single id where you can't find an item object in Collection A.
    So Collection A is larger than Collection B.
    I have to iterate through the Collections and I want to separate the Items in Collection A into separate collections depending on whether Item's id was found in Collection B or not.
    My question is; which one is good in Big-O.
    1. for(Item i: A){
       for(String id: B){
    }2. for(String id: B){
       for(Item i: A){
    }Could you explain pls?

    So, do you want someone to agree on ejp's explanation? Shall I repeat?
    |A| = N
    |B| = M
    1. f.a. a in A: (f.a. b in B: b.id = a => retain(b))
    2. f.a. b in B: (f.a. a in A: b.id = a => retain(b))
    Without any "optimization" you get O(N*M) in both cases.
    In both cases, you could break the inner loop once you found a match. I'd say that WLOG one will have to scan half the inner collection in average to find a match, so we have:
    1. O(A * B/2)
    2. O(B * A/2)
    Which, obviously, is the same.
    If one of the collections is sorted, the sorted one should be the inner loop, as it only takes O(log2(X)) instead O(X/2) to search for a match.
    If one of the collections is hashed, the hashed one should be the inner loop, as it takes O(1) to search for a match (depending on the distribution of hash values).

  • HT5622 Sorry but I can't order any tunes for my ipod nano because a new trems and agreement statement keeps coming up sooooo where is the agree or disagree ( to check ) located? Read through the info twice even though it is langthy . ????

    Sorry I can't order any new itunes for my nano because a new terms and agreement comes up after I press buy . It asks to click on agree or disagree? What I would like to know is where are these 2 terms located. Read through this twice and couldn't find any place to answer this question. So can't order any more music!!!

    Hey briannagrace96,
    Welcome to Apple Support Communities! I'd check out the following article, it looks like it applies to your situation:
    iPod: Appears in Windows but not in iTunes
    http://support.apple.com/kb/ts1363
    You'll want to go through the following troubleshooting steps, and for more detail on each step follow the link to the article above:
    Try the iPod troubleshooting assistant:
    If you have not already done so, try the steps in the iPod Troubleshooting Assistant (choose your iPod model from the list).
    If the issue remains after following your iPod's troubleshooting assistant, follow the steps below to continue troubleshooting your issue.
    Restart the iPod Service
    Restart the Apple Mobile Device Service
    Empty your Temp directory and restart
    Verify that the Apple Mobile Device USB Driver is installed
    Change your iPod's drive letter
    Remove and reinstall iTunes
    Disable conflicting System Services and Startup Items
    Update, Reconfigure, Disable, or Remove Security Software
    Deleting damaged or incorrect registry keys
    Take care,
    David

  • In the privacy policy, it states that percentages and durations of books read are being collected to ensure that publishers can have a metered price model, prices depending on how the book was read. Give me an example of a company with such a price model?

    In your privacy policy, you state that the percentages and durations of books read are being collected to ensure that publishers can choose a metered price model. Prices which depends on the duration for which the book was read.
    Give me an example of a company with such a price model? Are the information being collected even where the companies have not asked for the information, even when the metered price models are not being used?
    Here is an extract från the privacy policy:
    What information does Adobe Digital Editions collect and how is it used?
    The following information may be collected when an eBook with DRM is opened in Adobe Digital Editions software. If an eBook does not have any DRM associated with it, then no information is collected.
    User GUID: The User GUID is a unique value assigned in place of your User ID and is used to authenticate you.
    Device GUID: The Device GUID is a unique value generated to identify your device. It is used to ensure that the eBook may be viewed on your device and that the number of devices permitted by the license is not exceeded.
    Certified App ID: This ID represents the application that is being used to view the eBook, in this case Adobe Digital Editions. It is necessary to ensure that only a certified application may display an eBook. This helps to minimize piracy and theft of eBooks.
    Device IP (Internet Protocol): This identifies the country you are located in when you purchase an eBook.  It is used by eBook providers for the enablement of localized pricing models. Only the country identifier of the Device IP is stored.
    Duration for Which the Book was Read: This information may be collected to facilitate limited or metered pricing models entered into between eBook providers, such as publishers and distributors. These models are based on how long a reader has read an eBook. For example, you may borrow an eBook for a period of 30 days. While some publishers and distributors may charge libraries and resellers for 30 days from the date of the download, others may follow a metered pricing model and charge them for the actual time you read the eBook.
    Percentage of the eBook Read: The percentage of the eBook read may be collected to allow eBook providers such as publishers to implement subscription pricing models where they charge based on the percentage of the eBook read.
    Information provided by eBook providers relating to the eBook you have purchased: The following information is provided by the eBook provider to enable the delivery of the eBook to your device:Date of eBook purchase/download
    Distributor ID and Adobe Content Server Operator URL
    Metadata of the eBook, such as title, author, language, publisher list price, ISBN number
    How is the information transmitted?
    The data is sent periodically to Adobe via a secure transmission using HTTPS.
    How is the information used?
    Adobe uses the information collected about the eBook you have opened in Adobe Digital Editions software to ensure it is being viewed in accordance with the type of DRM license that accompanies that eBook. The type of license is determined by the eBook provider. For more information on how each piece of data is used, please see above.

    In your privacy policy, you state that the percentages and durations of books read are being collected to ensure that publishers can choose a metered price model. Prices which depends on the duration for which the book was read.
    Give me an example of a company with such a price model? Are the information being collected even where the companies have not asked for the information, even when the metered price models are not being used?
    Here is an extract från the privacy policy:
    What information does Adobe Digital Editions collect and how is it used?
    The following information may be collected when an eBook with DRM is opened in Adobe Digital Editions software. If an eBook does not have any DRM associated with it, then no information is collected.
    User GUID: The User GUID is a unique value assigned in place of your User ID and is used to authenticate you.
    Device GUID: The Device GUID is a unique value generated to identify your device. It is used to ensure that the eBook may be viewed on your device and that the number of devices permitted by the license is not exceeded.
    Certified App ID: This ID represents the application that is being used to view the eBook, in this case Adobe Digital Editions. It is necessary to ensure that only a certified application may display an eBook. This helps to minimize piracy and theft of eBooks.
    Device IP (Internet Protocol): This identifies the country you are located in when you purchase an eBook.  It is used by eBook providers for the enablement of localized pricing models. Only the country identifier of the Device IP is stored.
    Duration for Which the Book was Read: This information may be collected to facilitate limited or metered pricing models entered into between eBook providers, such as publishers and distributors. These models are based on how long a reader has read an eBook. For example, you may borrow an eBook for a period of 30 days. While some publishers and distributors may charge libraries and resellers for 30 days from the date of the download, others may follow a metered pricing model and charge them for the actual time you read the eBook.
    Percentage of the eBook Read: The percentage of the eBook read may be collected to allow eBook providers such as publishers to implement subscription pricing models where they charge based on the percentage of the eBook read.
    Information provided by eBook providers relating to the eBook you have purchased: The following information is provided by the eBook provider to enable the delivery of the eBook to your device:Date of eBook purchase/download
    Distributor ID and Adobe Content Server Operator URL
    Metadata of the eBook, such as title, author, language, publisher list price, ISBN number
    How is the information transmitted?
    The data is sent periodically to Adobe via a secure transmission using HTTPS.
    How is the information used?
    Adobe uses the information collected about the eBook you have opened in Adobe Digital Editions software to ensure it is being viewed in accordance with the type of DRM license that accompanies that eBook. The type of license is determined by the eBook provider. For more information on how each piece of data is used, please see above.

  • How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap?

    How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap? Currently my program reads the data from several text files in a directory and the saves that information in a text file called output.txt. I would like to cache this data in order to use it later. How can I do this using the TreeMap Class? These are the keys,values: TreeMap The data I'd like to Cache is (date from the file, time of the file, current time).
    import java.io.*;
    public class CacheData {
      public static void main(String[] args) throws IOException {
      String target_dir = "C:\\Files";
      String output = "C:\\Files\output.txt";
      File dir = new File(target_dir);
      File[] files = dir.listFiles();
      // open the Printwriter before your loop
      PrintWriter outputStream = new PrintWriter(output);
      for (File textfiles : files) {
      if (textfiles.isFile() && textfiles.getName().endsWith(".txt")) {
      BufferedReader inputStream = null;
      // close the outputstream after the loop
      outputStream.close();
      try {
      inputStream = new BufferedReader(new FileReader(textfiles));
      String line;
      while ((line = inputStream.readLine()) != null) {
      System.out.println(line);
      // Write Content
      outputStream.println(line);
      } finally {
      if (inputStream != null) {
      inputStream.close();

    How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap? Currently my program reads the data from several text files in a directory and the saves that information in a text file called output.txt. I would like to cache this data in order to use it later. How can I do this using the TreeMap Class?
    I don't understand your question.
    If you don't know how to use TreeMap why do you think a TreeMap is the correct solution for what you want to do?
    If you are just asking how to use TreeMap then there are PLENTY of tutorials on the internet and the Java API provides the methods that area available.
    TreeMap (Java Platform SE 7 )
    Are you sure you want a map and not a tree instead?
    https://docs.oracle.com/javase/tutorial/uiswing/components/tree.html

  • Hi help unlock the phone happened after we installed a new programa we can not get the activation password and ID, I know and still does not stop the phone bought in Israel and what documents should be sent to confirm that my phone Please read through the

    hi help unlock the phone happened after we installed a new programa we can not get the activation password and ID, I know and still does not stop the phone bought in Israel and what documents should be sent to confirm that my phone Please read through the help

    What I am saying is ..........
    The iPhone HAS to be active making calls on the UK carrier network for the carrier to identify as "theirs" and therefore eligible for the Carrier to unlock
    The way to achieve this is to use a PAYG sim making and receiving calls to establish a customer relationship  with the Carrier and then follow the Carrier's process to unlock
    With a PAYG it usually means adding a specified (by the carrier ) amount  usually £15 /£20 depending on the carrier
    This is how O2 function and according to Gemma  this is how Vodafone work

  • Hide navigation pane of adobe reader through scripting

    Hi.. I'm looking for a script to hide the navigation pane of the adobe reader through scripting, is there any way I can achieve that?
    my main objective is to restrict user from attaching a file by using navigation pane because I'm already giving buttons to attach a file on the pdf and I want user to attach a file ONLY using buttons on the pdf. Can I achieve this by any other way?
    Thanks in advance.
    Sunaif

    Hi,
    you can hide all panes with this script in the docReady:event.
         event.target.viewState = {overViewMode:1};
    More examples:
    http://thelivecycle.blogspot.com/2010/04/xfa-form-control-view-settings.html

  • Strange read-through operation after entry processor work

    Hi.
    We use the combination cache listener - entry processor to do some actions when the data comes to coherence. We use Oracle Coherence Version 3.5.3/465.
    Just after the entry processor has set the new value for the entry, the new "get" operation is called for the cache and jdbc hit is done for this key.
    Here is the entry processor:
    public Object process(Entry entry) {       
            if (!entry.isPresent()) {
                // No entities exist for this CoreMatchingString - creating new Matching unit
                MatchingUnit newUnit = new MatchingUnit(newTrade);
                entry.setValue(newUnit, true);
                return null;
            ((MatchingUnit)entry.getValue()).processMatching(newTrade);
            return null;
        }Very interesting, that if I use entry.setValue(value) without second parameter - I recieve the db hit just on setValue method. According to docs, setValue() with one parameter returns the previous value and its logical, that the cache hit (and therefore the db hit) is done just on set. But I use the overloaded version void setValue(java.lang.Object oValue, boolean fSynthetic), which is said to be light and should not fetch previous version of the object. But this is done anyway! Not on setValue itself, but just after the process() method called.
    Actually it's strange, that coherence tries to fetch the previous value in the case it didn't exist! The cache.invoke(matchingStr, new CCPEntryProcessor(ccp)) is invoked on not existing record and it is created just on invokation. May be it's the bug or the place for optimization.
    Thanks

    bitec wrote:
    Thanks, Robert, for such detailed answer.
    Still not clear for me, why synthetic inserts are debatable. There are lots of cases, when the client simply updates/inserts the record (using setValue()) and does not need to recieve the previous value. If he needs, he will launch the method:Hi Anton,
    it is debatable because the purpose of the fSynthetic flag is NOT so that you can optimize a cache store operation away. Synthetic event means that this is not real change in the data set triggered by the user, it is something Coherence has done on the backing map / on the cache for its own reasons and decisions to be able to provide high-availability to the data, and it only changes that particular Coherence node's subset of data but does not have a meaning related to the actually existing full data set. Such reasons are partition movement and cache eviction (or possibly any other reasons why Coherence would want to change the content of the backing map without telling the user that anything has changed).
    If you set the synthetic flag, you are trying to masquerade a real data change as an event which Coherence decided to trigger. This is why it is debatable. Also, synthetic backing map events may not always lead to dispatching cache events (for partition rebalance they definitely not). This optimization may also be extended to synthetic cache events.
    java.lang.Object setValue(java.lang.Object oValue)and recieve the previous value. If he doesn't, he calls:
    void setValue(java.lang.Object oValue, boolean fSynthetic)and DOESN'T recieve the previous value as method is marked void. Thus he cannot get the previous value anyhow using this API, except of the direct manual db call. Yep, because Coherence is not interested in the old value in case of a synthetic event. The synthetic methods exist so that some entry can be changed in Coherence (usually by Coherence itself) in a way that it indicates a synthetic event so that listeners are not notified.
    Some valid uses for such functionality for setValue invoked by user code could be compacting some cached value and replacing the value the backing map stores with the compacted representation, which does not mean a change in the meaning of the actual cached value, only the representation changes. Of course if the setValue(2) method does not actually honor the synthetic flag, then such functionality will still incur all the costs of a normal setValue(1) call.
    But the previous value is anyway fetched by Coherence itself just after process() and client anyway doesn't get it! But any listeners on the cache may need to get it due to cache semantics reasons.
    In this case I regard this as the bug, cause the client, which uses this API doesn't expect the cache hit to take place (no return value for this overloaded setValue() method), but it takes and leads to some extra problems, resulting from read-through mechanizm.
    I would not regard it as a bug, it is probably the case of documenting a possible optimization too early, when it ultimately did not get implemented. I definitely would not try to abuse it to set a value without triggering a db fetch, as again, the intention of the synthetic flag is related not only to the cache loader functionality, but also to events and marking that a change indicates a real data change or a Coherence data management action.
    Now I understand why coherence does not know, whether this is inserted or updated value, thanks for details.
    Anton.
    *Edited: I thought about this problem from the point of the oracle user, but may be this additional hit is necessary for event producers, which need to make the events, containing old/new values. In this case this seems to be the correct behaviour.... Seems that I need some other workaround to avoid db hit. The best workaround is the empty load() method for cachestore...You can try to find a workaround, but it is an ugly can of worms, because of the scenario when more than one thread tries to load the same entry, and some of them try to load it with a reason.
    You may try to put some data into thread-local to indicate that you don't really want to load that particular key. The problem is that depending on configuration and race conditions your cache loader may not be called to clean up that thread-local as some other thread may just be invoked right now and in that case its return value is going to be returned to all other threads, too, so you may end up with a polluted thread.
    Best regards,
    Robert
    Edited by: robvarga on Oct 15, 2010 4:25 PM

  • Read-through configuration problems

    Hi!
    I have problem with read-through example. The DataLoader object is created (somewhere in Coherence) but method load(Object key) is never called. Please help.
    public class DataLoader extends AbstractCacheLoader {
        private static HashMap<String, String> hashMap = new HashMap<String, String>();
        static {
            hashMap.put("A", "a");
            hashMap.put("B", "b");
            hashMap.put("C", "c");
            hashMap.put("D", "d");
            hashMap.put("E", "f");
            hashMap.put("F", "g");
        public DataLoader() {
            System.out.println("Instance of DataLoader");
        public Object load(Object key) {
            return hashMap.get(key);
    }Config files:
    <cache-config>
        <caching-scheme-mapping>
            <cache-mapping>
                <cache-name>ABC</cache-name>
                <scheme-name>SamplePartitionedDatabaseScheme</scheme-name>
            </cache-mapping>
        </caching-scheme-mapping>
        <caching-schemes>
            <distributed-scheme>
                <scheme-name>SamplePartitionedDatabaseScheme</scheme-name>
                <backing-map-scheme>
                    <read-write-backing-map-scheme>
                        <scheme-ref>SampleDatabaseScheme</scheme-ref>
                    </read-write-backing-map-scheme>
                </backing-map-scheme>
            </distributed-scheme>
            <read-write-backing-map-scheme>
                <scheme-name>SampleDatabaseScheme</scheme-name>
                <internal-cache-scheme>
                    <local-scheme>
                        <scheme-ref>SampleMemoryScheme</scheme-ref>
                    </local-scheme>
                </internal-cache-scheme>
                <cachestore-scheme>
                    <class-scheme>
                        <class-name>com.example.DataLoader</class-name>
                    </class-scheme>
                </cachestore-scheme>
            </read-write-backing-map-scheme>
            <local-scheme>
                <scheme-name>SampleMemoryScheme</scheme-name>
            </local-scheme>
        </caching-schemes>
    </cache-config>and
    <coherence>
        <cluster-config>
            <member-identity>
                <cluster-name>thecluster</cluster-name>
            </member-identity>
            <multicast-listener>
                <port>9100</port>
                <time-to-live>0</time-to-live>
            </multicast-listener>
        </cluster-config>
    </coherence>Starting server
    package com.example;
    import com.tangosol.net.DefaultCacheServer;
    import com.tangosol.net.DefaultConfigurableCacheFactory;
    public class Server {
        public static void main(String[] args) {
            DefaultConfigurableCacheFactory factory;
            factory = new DefaultConfigurableCacheFactory();
            DefaultCacheServer dcs = new DefaultCacheServer(factory);
            dcs.startAndMonitor(5000);
    }Getting data
    package com.example;
    import com.tangosol.net.CacheFactory;
    import com.tangosol.net.NamedCache;
    public class Reader {
        public static void main(String[] args) {
            CacheFactory.ensureCluster();
            NamedCache cache = CacheFactory.getCache("ABC");
            System.out.println("Value in cache is: " + cache.get("A"));
            System.out.println("Value in cache is: " + cache.get("B"));
            System.out.println("Value in cache is: " + cache.get("C"));
            System.out.println("Value in cache is: " + cache.get("D"));
    }Result
    Value in cache is: null
    Value in cache is: null
    Value in cache is: null
    Value in cache is: null

    Hi St,
    Actually, looking at the code again, your server will not be using your custom configuration.
    I'm not sure why you have written the code like that but there is no need to create a DefaultConfigurableCacheFactory instance; Coherence will take care of that. As you have used the default constructor for DefaultConfigurableCacheFactory it will be using a configuration file called coherence-cache-config.xml; is that what your file is called?
    All your Server main method needs to do is this...
    package com.example;
    import com.tangosol.net.DefaultCacheServer;
    public class Server {
        public static void main(String[] args) {
            DefaultCacheServer.main(args);
    }Which is actually nothing more than running DefaultCacheServer, so you do not even need a custom Server class.
    JK

  • Set a new expiry delay for entries added in the cache by a read through

    Hi,
    I have an application that uses an Oracle Coherence cache backed by a database. Each item that is added in the cache must have a custom expiry delay computed from its content.
    Is it possible to set a new expiry delay for the entries loaded in the cache from the database by a read through operation?
    I tried setting a new expiry delay in the load method of the BinaryEntryStore, but it is ignored and the default expiry of the corresponding cache is used instead. Also I tried using a MapTrigger, but the entries added in the cache by a read through operation are not intercepted by the MapTrigger.
    Thanks,
    Adrian

    What we do (not sure if it proper way, but it worked for us) is extend the LocalCache and override the put method.
    public Object put(
    Object oKey,
    Object oValue,
    long expiry)
    long newexpiry = xxxxx;
    return super.put(oKey, oValue, newexpiry);
    }

  • TS3221 ipod touch not reading through my computer and downloaded new I tunes already help

    ipod touch not reading through my computer and downloaded new I tunes still nothing help

    Try here:
    iOS: Device not recognized in iTunes for Windows

  • Can anyone read through this and tell me whats wrong?

    I recently installed a SSD and moved my original HD to the dvd-rom area with an adapter and ever since my mac reboots like crazy at least once an hour when im using it can anyone read through this and tell me whats wrong?  Thanks!
    Interval Since Last Panic Report:  42225 sec
    Panics Since Last Report:          4
    Anonymous UUID:                    7979315A-3803-0C18-8DAE-7253B08C2354
    Sat Nov 10 10:57:33 2012
    panic(cpu 0 caller 0xffffff800a88a97a): "vm_page_reactivate_local: found vm_page_t(0xffffff801381f1a0) with wrong cpuid"@/SourceCache/xnu/xnu-2050.18.24/osfmk/vm/vm_resident.c:3184
    Backtrace (CPU 0), Frame : Return Address
    0xffffff80fac8bc20 : 0xffffff800a81d626
    0xffffff80fac8bc90 : 0xffffff800a88a97a
    0xffffff80fac8bcf0 : 0xffffff800a8618f4
    0xffffff80fac8bdb0 : 0xffffff800a862abb
    0xffffff80fac8bf40 : 0xffffff800a8b7fa9
    0xffffff80fac8bfb0 : 0xffffff800a8ce411
    BSD process name corresponding to current thread: Call of Duty 4 M
    Mac OS version:
    12C60
    Kernel version:
    Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64
    Kernel UUID: 69A5853F-375A-3EF4-9247-478FD0247333
    Kernel slide:     0x000000000a600000
    Kernel text base: 0xffffff800a800000
    System model name: MacBookPro8,3 (Mac-942459F5819B171B)
    System uptime in nanoseconds: 7880590116460
    last loaded kext at 5381976964593: com.apple.driver.AppleUSBCDC          4.1.22 (addr 0xffffff7f8cbf2000, size 16384)
    last unloaded kext at 5443414503687: com.apple.driver.AppleUSBCDC          4.1.22 (addr 0xffffff7f8cbf2000, size 12288)
    loaded kexts:
    com.apple.filesystems.smbfs          1.8
    com.apple.filesystems.ntfs          3.10
    com.apple.driver.AppleHWSensor          1.9.5d0
    com.apple.driver.AudioAUUC          1.60
    com.apple.driver.IOBluetoothSCOAudioDriver          4.0.9f33
    com.apple.driver.IOBluetoothA2DPAudioDriver          4.0.9f33
    com.apple.iokit.IOBluetoothSerialManager          4.0.9f33
    com.apple.filesystems.autofs          3.0
    com.apple.driver.AGPM          100.12.69
    com.apple.driver.AppleMikeyHIDDriver          122
    com.apple.driver.AppleHDA          2.3.1f2
    com.apple.driver.AppleMikeyDriver          2.3.1f2
    com.apple.iokit.BroadcomBluetoothHCIControllerUSBTransport          4.0.9f33
    com.apple.driver.AppleSMCPDRC          1.0.0
    com.apple.driver.ACPI_SMC_PlatformPlugin          1.0.0
    com.apple.iokit.IOUserEthernet          1.0.0d1
    com.apple.driver.AppleLPC          1.6.0
    com.apple.driver.AppleIntelHD3000Graphics          8.0.0
    com.apple.driver.AppleMuxControl          3.2.11
    com.apple.driver.SMCMotionSensor          3.0.2d6
    com.apple.driver.AppleSMCLMU          2.0.2d0
    com.apple.driver.AppleUpstreamUserClient          3.5.10
    com.apple.kext.AMDFramebuffer          8.0.0
    com.apple.AMDRadeonAccelerator          1.0.0
    com.apple.driver.AppleMCCSControl          1.0.33
    com.apple.driver.AppleIntelSNBGraphicsFB          8.0.0
    com.apple.Dont_Steal_Mac_OS_X          7.0.0
    com.apple.driver.ApplePolicyControl          3.2.11
    com.apple.driver.AppleUSBTCButtons          235.4
    com.apple.iokit.SCSITaskUserClient          3.5.1
    com.apple.driver.AppleUSBTCKeyboard          235.4
    com.apple.driver.AppleIRController          320.15
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless          1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib          1.0.0d1
    com.apple.BootCache          34
    com.apple.driver.XsanFilter          404
    com.apple.iokit.IOAHCIBlockStorage          2.2.2
    com.apple.driver.AppleUSBHub          5.2.5
    com.apple.iokit.AppleBCM5701Ethernet          3.2.5b3
    com.apple.driver.AppleFWOHCI          4.9.6
    com.apple.driver.AirPort.Brcm4331          602.15.22
    com.apple.driver.AppleAHCIPort          2.4.1
    com.apple.driver.AppleUSBEHCI          5.4.0
    com.apple.driver.AppleEFINVRAM          1.6.1
    com.apple.driver.AppleSmartBatteryManager          161.0.0
    com.apple.driver.AppleACPIButtons          1.6
    com.apple.driver.AppleRTC          1.5
    com.apple.driver.AppleHPET          1.7
    com.apple.driver.AppleSMBIOS          1.9
    com.apple.driver.AppleACPIEC          1.6
    com.apple.driver.AppleAPIC          1.6
    com.apple.driver.AppleIntelCPUPowerManagementClient          196.0.0
    com.apple.nke.applicationfirewall          4.0.39
    com.apple.security.quarantine          2
    com.apple.driver.AppleIntelCPUPowerManagement          196.0.0
    com.apple.iokit.IOSerialFamily          10.0.6
    com.apple.kext.triggers          1.0
    com.apple.driver.DspFuncLib          2.3.1f2
    com.apple.iokit.IOAudioFamily          1.8.9fc10
    com.apple.kext.OSvKernDSPLib          1.6
    com.apple.iokit.AppleBluetoothHCIControllerUSBTransport          4.0.9f33
    com.apple.driver.IOPlatformPluginLegacy          1.0.0
    com.apple.iokit.IOSurface          86.0.3
    com.apple.iokit.IOFireWireIP          2.2.5
    com.apple.driver.AppleSMBusPCI          1.0.10d0
    com.apple.driver.IOPlatformPluginFamily          5.2.0d16
    com.apple.driver.AppleBacklightExpert          1.0.4
    com.apple.driver.AppleHDAController          2.3.1f2
    com.apple.iokit.IOHDAFamily          2.3.1f2
    com.apple.iokit.IOAcceleratorFamily          19.0.26
    com.apple.kext.AMD6000Controller          8.0.0
    com.apple.kext.AMDSupport          8.0.0
    com.apple.driver.AppleSMBusController          1.0.10d0
    com.apple.iokit.IOBluetoothFamily          4.0.9f33
    com.apple.driver.AppleSMC          3.1.4d2
    com.apple.driver.AppleGraphicsControl          3.2.11
    com.apple.iokit.IONDRVSupport          2.3.5
    com.apple.iokit.IOGraphicsFamily          2.3.5
    com.apple.driver.AppleThunderboltDPInAdapter          1.8.5
    com.apple.driver.AppleThunderboltDPAdapterFamily          1.8.5
    com.apple.driver.AppleThunderboltPCIDownAdapter          1.2.5
    com.apple.driver.AppleUSBMultitouch          235.7
    com.apple.iokit.IOSCSIBlockCommandsDevice          3.5.1
    com.apple.iokit.IOUSBMassStorageClass          3.5.0
    com.apple.iokit.IOSCSIArchitectureModelFamily          3.5.1
    com.apple.iokit.IOUSBHIDDriver          5.2.5
    com.apple.driver.AppleUSBMergeNub          5.2.5
    com.apple.driver.AppleUSBComposite          5.2.5
    com.apple.driver.AppleThunderboltNHI          1.6.0
    com.apple.iokit.IOThunderboltFamily          2.1.1
    com.apple.iokit.IOUSBUserClient          5.2.5
    com.apple.iokit.IOEthernetAVBController          1.0.2b1
    com.apple.iokit.IOFireWireFamily          4.5.5
    com.apple.iokit.IO80211Family          500.15
    com.apple.iokit.IONetworkingFamily          3.0
    com.apple.iokit.IOAHCIFamily          2.2.1
    com.apple.iokit.IOUSBFamily          5.4.0
    com.apple.driver.AppleEFIRuntime          1.6.1
    com.apple.iokit.IOHIDFamily          1.8.0
    com.apple.iokit.IOSMBusFamily          1.1
    com.apple.security.sandbox          220
    com.apple.kext.AppleMatch          1.0.0d1
    com.apple.security.TMSafetyNet          7
    com.apple.driver.DiskImages          344
    com.apple.iokit.IOStorageFamily          1.8
    com.apple.driver.AppleKeyStore          28.21
    com.apple.driver.AppleACPIPlatform          1.6
    com.apple.iokit.IOPCIFamily          2.7.2
    com.apple.iokit.IOACPIFamily          1.4
    com.apple.kec.corecrypto          1.0
    Model: MacBookPro8,3, BootROM MBP81.0047.B27, 4 processors, Intel Core i7, 2.2 GHz, 8 GB, SMC 1.70f5
    Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 512 MB
    Graphics: AMD Radeon HD 6750M, AMD Radeon HD 6750M, PCIe, 1024 MB
    Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1333 MHz, 0x84B0, 0x4F435A334D31333333344720202020202020
    Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1333 MHz, 0x84B0, 0x4F435A334D31333333344720202020202020
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 (5.106.98.81.22)
    Bluetooth: Version 4.0.9f33 10885, 2 service, 18 devices, 1 incoming serial ports
    Network Service: Ethernet, Ethernet, en0
    Serial ATA Device: OCZ-AGILITY3, 240.06 GB
    Serial ATA Device: TOSHIBA MK7559GSXF, 750.16 GB
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfa100000 / 3
    USB Device: Razer Naga, 0x1532, 0x0015, 0xfa130000 / 6
    USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0245, 0xfa120000 / 5
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 4
    USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x821a, 0xfa113000 / 8
    USB Device: FaceTime HD Camera (Built-in), apple_vendor_id, 0x8509, 0xfa200000 / 2
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfd100000 / 2
    USB Device: My Passport 0740, 0x1058  (Western Digital Technologies, Inc.), 0x0740, 0xfd130000 / 4
    USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd110000 / 3

    When I look at the code on your page, I see this -
    <?php include("PHP/form.php"); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    This can only mean a) your server does not support PHP, or b) your file is not named with a *.php extension.  If I browse to index.html, I get the same page.  I'm guessing that this is the first problem.  Can you confirm it?

  • Read-through/write-behind and queued deletes (and updates)

    Hi,
    If I am changing the state of objects in a cache and using the write-behind and read-through mechanism what happens when I have deleted or updated an object in the cache but the change has not yet been committed to the database?.
    If I delete and object in the cache and the delete DB operation is being queued and during this time try and perform a get against the key for the object is the value read through from the database or is it ignored since the database delete is pending?
    For updates I presume that the value in the cache will be used - as the value exists in the cache and a read-through from the database will not be triggered.
    Can you clarify the behavior of Coherence under these circumstances, particularly that of a pending delete.
    Thanks,
    Dave

    Hi Dave,
    If I am changing the state of objects in a cache and
    using the write-behind and read-through mechanism
    what happens when I have deleted or updated an object
    in the cache but the change has not yet been
    committed to the database?.
    If I delete and object in the cache and the delete DB
    operation is being queued and during this time try
    and perform a get against the key for the object is
    the value read through from the database or is it
    ignored since the database delete is pending?I seem to remember a forum post mentioning that the removes from a write-behind cache are performed synchronously (they are done as part of the backingMap.remove(key)) operation so even if there are were pending updates in the write-behind queue. If I remember correctly, then the above mentioned problem cannot happen.
    >
    For updates I presume that the value in the cache
    will be used - as the value exists in the cache and a
    read-through from the database will not be
    triggered.
    Exactly.
    Best regards,
    Robert

Maybe you are looking for

  • Partner not getting picked

    Hi All, We have the below scenario which is not happening as expected. We have the Partner Function ZS and ZG which is assigned to the respective Account Groups. ZS is the sourse for ZG. We have done the config for the Partner Function in such a way

  • Pc gaming mice in Bootcamp?

    I am using a 27 inch iMac. I also run bootcamp on it. I am buying a G9x gaming mouse from Logitech and I want to know if the mouse will fully work in bootcamp.

  • Yet another Version of iTunes that doesn't work

    Well, I've tried...more than a few times. Every time they come out with a new version I give it a shot, but every time I do...I'm glad I kept the executable from 4.7 because I always have to roll back. They have, however, made progress. I can now rip

  • Bank details - create a vendor

    Hi Specialist I would like to know where is the place to do mandatory or not the bank details of my vendors. COuld you tell me please the exacly place to change or add it?? Actually I have mandatory - bank account number - bank key - bank key countri

  • Changelog configuration to audit specific attributes changes

    Hi, I am trying to configure changelog. The objective is to create a file having the change in specific attribute values for adds and mods. I configured the same and it creates the file also; but I don't see changes in that file and under the columns