Package net.jini.core.entry

Examples of net.jini.core.entry.Entry


     * sections 2.3, 2.6.</P>
     */
    public void run() throws Exception {
        SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1);
        SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2);
        Entry snapshot1;
        Entry snapshot2;
        SimpleEntry origEntry1;
        SimpleEntry origEntry2;
        SimpleEntry result;
        Transaction txn;

View Full Code Here


     * <P>Notes:<BR>For more information see the JavaSpaces specification
     * sections 2.6, 3.1.</P>
     */
    public void run() throws Exception {
        SimpleEntry sampleEntry = new SimpleEntry("TestEntry #1", 1);
        Entry snapshot;
        SimpleEntry result;
        Transaction txn1;
        Transaction txn2;

        // first check that space is empty
View Full Code Here

    public void setup(QAConfig config) throws Exception {
        super.setup(config);
    }

    public void run() throws Exception {
        final Entry entry = writeOne();
        logger.log(Level.INFO, "Wrote:" + entry);
        spaceSet();

        // Read back under all combos
        try {
            final Template writen = new Template(entry);
            TemplateGenerator gen = new AllMatchingInClassTmplGen(entry);
            Entry tmpl;
            int count = 0;

            while ((tmpl = gen.next()) != null) {
                count++;
                logger.log(Level.INFO, "Read #" + count + " with " + tmpl);
                final Entry rslt = spaceRead(tmpl, null, queryTimeOut);

                if (rslt == null) {
                    throw new TestException(
                            "Failed to match under all templates");
                }
View Full Code Here

                + "matching.MismatchTest.use_takes", false);
    }

    public void run() throws Exception {
        try {
            final Entry entry = writeOne();
            logger.log(Level.INFO, "Wrote:" + entry);
            spaceSet();

            // Read/take back under mismatches
            TemplateGenerator gen = new MismatchTmplGen(entry, classList);
            Entry tmpl;
            int count = 0;

            while ((tmpl = gen.next()) != null) {
                count++;
                logger.log(Level.INFO, "Query#" + count + " with " + tmpl);
                Entry rslt;

                if (useRead) {
                    rslt = spaceRead(tmpl, null, queryTimeOut);
                } else {
                    rslt = spaceTake(tmpl, null, queryTimeOut);
                }

                if (rslt != null) {
                    throw new TestException(
                            "Got match from a template we should not have");
                }
            }

            // Lets make sure it realy was their
            final Entry rslt = spaceRead(entry, null, queryTimeOut);

            if (rslt == null) {
                throw new TestException("Orginal write did not work");
            }
        } catch (UnusableEntryException e) {
View Full Code Here

            JavaSpace.class});
  Configuration c = getConfig().getConfiguration();
        final Listener listener1 = new Listener(c, true);
        final Listener listener2 = new Listener(c, false);
        final JavaSpace space = (JavaSpace) services[0];
        final Entry aEntry = new UninterestingEntry();

        // Register ill-behaved handler  and write matching entry
        EventRegistration reg = space.notify(aEntry, null, listener1,
                                             Lease.ANY, null);
  reg = (EventRegistration)
View Full Code Here

        testUtil = new NotifyTestUtil(getConfig(), this);
    }

    public void run() throws Exception {
        testUtil.init((JavaSpaceAuditor) space);
        final Entry toWrite = getOne();

        // Register for events
  TemplateGenerator gen = new MismatchTmplGen(toWrite, classList);
  int count = 0;
  Entry tmpl;
 
  while ((tmpl = gen.next()) != null) {
      testUtil.registerForNotify(tmpl);
      logger.log(Level.INFO,
           "Notify Registration " + ++count + " " + tmpl);
View Full Code Here

    public void setup(QAConfig config) throws Exception {
        super.setup(config);
    }

    public void run() throws Exception {
        final Entry entry = writeOne();
        logger.log(Level.INFO, "Wrote:" + entry);
        spaceSet();

        try {

            // Take it back
            final Entry takeRslt = spaceTake(entry, null, queryTimeOut);

            if (takeRslt == null) {
                throw new TestException(
                        "Failed to take entry just wrote");
            }
            logger.log(Level.INFO, "Took:" + entry);

            // Read and make sure it is not their
            final Entry readRslt = spaceRead(entry, null, queryTimeOut);

            if (readRslt != null) {
                throw new TestException(
                        "Got entry (" + readRslt
                        + ") read after it was removed by a take");
View Full Code Here

        Matcher[] matchers = new Matcher[writeList.size()];
        Iterator i;
        int j;

        for (i = writeList.iterator(), j = 0; i.hasNext(); j++) {
            final Entry ent = (Entry) i.next();
            logger.log(Level.INFO, "Setup query for " + ent);
            matchers[j] = new Matcher(ent, j);
            matchers[j].start();
        }
        spaceSet();
View Full Code Here

        public void run() {
            try {
                while (true) {
                    try {
                        Entry rslt;

                        if (useRead) {
                            rslt = spaceRead(tmpl, null, matchTimeout);
                        } else {
                            rslt = spaceTake(tmpl, null, matchTimeout);
View Full Code Here

        testUtil = new NotifyTestUtil(getConfig(), this);
    }

    public void run() throws Exception {
        testUtil.init((JavaSpaceAuditor) space);
        final Entry toWrite = getOne();

        // Register for events
  TemplateGenerator gen = new AllMatchingInClassTmplGen(toWrite);
  int count = 0;
  Entry tmpl;
 
  while ((tmpl = gen.next()) != null) {
      testUtil.registerForNotify(tmpl);
      logger.log(Level.INFO,
           "Notify Registration " + ++count + " " + tmpl);
View Full Code Here

TOP

Related Classes of net.jini.core.entry.Entry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.