Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: code needed for the following problem

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default code needed for the following problem

    Server 1 - “Simple Server” (use server1 codes)

    The first POA-based server you need to develop is the “simple server”. This server should
    perform the following tasks: 1. Start a timer.
    2. Create 1,000 Count objects with names “My Count1” ... “My Count1000”, and activate each
    object at the time of its creation.
    3. Stop the timer and print out the average time to create and activate each counter
    4. Register each Count object with the Naming Service (you do not need to time how long this
    operation takes)
    5. Wait for client requests

    Note that this server does not use a servant manager.


    The client for Server 1 should behave in the following way:

    1. Create an array of 1,000 Count object references, binding to each one in the Naming Service
    2. Start a timer
    3. Invoke 1,000,000 increment calls on randomly selected counters from the set of 1,000
    available counters. This means you make 1,000,000 TOTAL increments during each client run,
    with the 1,000,000 increments being randomly distributed among the 1,000 available objects.
    4. Stop the timer and print out the average time to perform each increment operation
    5. After the calls to increment, calculate the average sum value of all the 1,000 counters and print
    out the value.


    Server 2a – Simple Server with Activator (use server2 codes)

    The second POA-based server you need to develop is similar to the first server, but this one uses
    a Servant Activator. This server should perform the following tasks:

    1. Start a timer.
    2. Create 1,000 Count objects with names “My Count1” ... “My Count1000”, but do not activate
    each object at the time of its creation. Rather, only create a reference for the object.
    3. Stop the timer and print out the average time to create each counter
    4. Register each Count object with the Naming Service (you do not need to time how long this
    operation takes)
    5. Design a servant activator that stores/retrieves each count object's sum value in a disk file
    called “My CountXXX.state” (for example, “My Count412.state” or “My Count900.state”). Use one
    disk file for each counter created. Your servant manager should keep no more than 10 active
    servants in memory at a time. When forced to deactivate a servant, select one from random from
    your pool of servants.
    6. Register your servant manager with the POA.
    7. Wait for client requests


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: code needed for the following problem

    So what exactly is the problem? Where are you stuck?

    These look more like instructions rather than a problem to me.

    // Json
    Last edited by Json; October 12th, 2009 at 03:04 AM.

Similar Threads

  1. Urgent code needed
    By subhvi in forum AWT / Java Swing
    Replies: 4
    Last Post: August 27th, 2009, 12:55 AM
  2. HELP "code needed"
    By Dave in forum File I/O & Other I/O Streams
    Replies: 14
    Last Post: August 26th, 2009, 11:06 AM
  3. Java NullPointer Exception in Server chat program
    By Valtros in forum Exceptions
    Replies: 1
    Last Post: May 8th, 2009, 05:06 AM
  4. Java/J2EE with Linus/Unix
    By markthomas20 in forum Paid Java Projects
    Replies: 2
    Last Post: November 5th, 2008, 08:19 AM
  5. Replies: 4
    Last Post: May 22nd, 2008, 10:59 AM