Some design questions

          Hello,
          I got two rather unrelated questions regarding the JMS implementation:
          - Is there any guarantee on when messages become available to consumers?
          Suppose my producer is a session bean which posts a message on a
          queue. Is there any guarantee on whether a QueueBrowser who starts right
          after the transaction is committed will see the message I posted ? Or is
          it possible that some delay causes the message to become visible only some
          time later ?
          - Can QueueBrowsers see messages with a scheduled delivery time that hasn't
          arrived yet ?
          Thanks & Regards,
          Francois Staes.
          Francois Staes
          NetConsult BVBA
          [email protected]
          Tel: +32/3/353.44.22
          Mobile: +32/475/73.74.48
          Fax: +32/3/353.44.06
          

Hi Francois,
          Since you must process messages in order, then the MDB is the
          only consumer, so why not just cache state in the MDB that
          contains the message-id of the last message processed? If
          a newly received message's message-id matches the stored
          message-id from the previous message, then treat the newly
          received message as an error message.
          This seems much simpler than queue-browser/error-queue.
          Tom, BEA
          P.S. Note that an MDB is destroyed and recreated if the
          onMessage throws a Runtime exception or Error. So you will need to
          put in a "try/catch() {ejbctx.setRollbackOnly(); cacheMessageId(msg);}"
          to prevent the destroy in order to preserve the cached message id
          value...
          Francois Staes wrote:
          > Greg Brail wrote:
          >
          >
          >>>- Is there any guarantee on when messages become available to consumers?
          >>> Suppose my producer is a session bean which posts a message on a
          >>> queue. Is there any guarantee on whether a QueueBrowser who starts
          >>> right after the transaction is committed will see the message I posted
          >>> ? Or is it possible that some delay causes the message to become
          >>> visible only
          >>
          >>some
          >>
          >>> time later ?
          >>
          >>Well, theoretically, there's always going to be "some delay" ;-) In
          >>practice, you should see the message right away. However, if the queue has
          >>a consumer on it, we push messages to that consumer in batches (that's one
          >>of the things that the "messages pending" statistic in the console tells
          >>you about). So, it's possible that the message has already been pushed out
          >>to a consumer, which is why you don't see it.
          >>
          >
          >
          > Thanks for the answer.
          >
          > Let me clarify what I want to achieve: I have an MDB receiving messages
          > about customers. These messages need to be handled in the correct order.
          > But it can happen that some message cannot be processed. Those messages need
          > to be pushed onto a seperate queue (an administrative utility can be used
          > afterwards to requeue them on the default queue so they get re-processed).
          >
          > As soon as there is a message about a certain customer on this error queue,
          > no further messages about that customer should be processed. Hence, from
          > within the MDB we peek on the error queue using a QueueBrowser. If we find
          > anything on there for the same customer as the current message, we
          > immediately stop the processing, and enqueue it on the error queue too.
          >
          > Originally, we tried implementing this using the error-queue feature of WLS.
          > However, moving the messages on the error queue is an asynchronous activity
          > in that case. This means that if a message cannot be processed, and another
          > message arrives right afterwards for the same customer, it might be that
          > the first message isn't yet visible on the error queue....
          >
          > That's why I was thinking about moving them to some kind of error queue
          > manually, and I needed some kind of guarantee that they would be visible
          > immediately.
          >
          > If I understand correctly what you're saying, I think there is no problem
          > because a QueueBrowser is not an asynchronous consumer on the error queue.
          >
          > Thanks for your help,
          >
          > Francois Staes.
          >
          

Similar Messages

  • Do I need multiple primary sites? Some design questions..

    I have about a thousand users & devices, across two sites.   Setting up SCCM 2012 R2 and wondering if I need to have multiple primary sites?
    From everything I've read so far, it seems that a single standalone site will handle tens of thousands of users/devices or some very large number, so I'm not sure if I'd ever need a secondary site or what it's function would be - failover, backup, or is
    it just best practice to have different roles spread across multiple servers?
    I was originally thinking of just doing a single primary site on a single server.  But then I'm not sure if my DP should be separate.
    Can someone point me the the right direction to a high level planning document or blog?
    Thanks
    Nathan

    How many clients are there in total? How many at each location? What's the WAN speed in between?
    Multiple primaries are only needed for scale out purposes (>100k clients)!
    Torsten Meringer | http://www.mssccmfaq.de
    About 500 at each, T1 speeds connect the sites, so I want to enable software metering I think.
    Also - if I have a single server with DP role installed, what kind of RAM/HD requirements are needed?  I know this probably varies with the install/features, but are there any ballpark estimates/starting points posted?  Sorry I know this is probably
    on the MS site somewhere, the the volume of information is hard to weed through.   Update, I found some good guidelines here:
    http://myitforum.com/myitforumwp/2012/06/27/sccm-2012-site-hardware-requirements/
    For 1000 or less users, is a single Gb NIC sufficient?  Sounds like it might be?   Also, when using a virtual machine, do you need to still somehow separate SQL logs & data from OS?
    Update #2, looks like that above post answered that question too:
    If you’re in a VM, it’s not sufficient to have a single VHD file, and having the roles split among 4 virtual drives inside that file.  It’s not sufficient to have that single file on a shared set of remote disks.  It’s not sufficient to have that
    single file on a dedicated set of disks, regardless of the number and size of those disks.  Any VM should be configured to only run the OS, and the 3 other spindles should be dedicated sets of disks, attached to the VM.  Otherwise, it’s like painting
    with watercolors in a hurricane…you’re spending a lot of time, looking creative, with zero value.
    But I'll take any follow up comments or recommendations if you have them on proper VM setup.
    Thanks
    Nathan

  • Backup to Tape ; Some Design questions

    Version : We have DBs on 10.2, 11.2 Enterprise Edition
    Platform: Solaris 5.10 SPARC
    Helloo..
    Never worked on Tape before. Currently , all our RMAN Backup Pieces are going to Disk and from there Sysadmin moves it to the tape using TSM.
    1. If you were to design a Backup strategy, would you backup to Disk first and then get the Sysadmin to
    copy to Tape OR backup directly to Tape?
    2. Do you guys backup Level_0 backup on TapeA , Level_1 backups on Tape B
    and Archivelogs, Control file , Spfile on TapeC
    3. RMAN Backup to Disk or Tape; Which is faster?

    1. Best practice directly to tape
    Adv: a. Longer retention inexpensive. separate tapes for weekly, monthly and yearly rotation.
    b. Can compress
    c. Inexpensive for VLDB.
    DisAdv: a. Needs Tape vendor (MML) license to directly write to tape.
    b. Storing tapes and tape maintenance.
    c. Slow process
    Writing directly to Disks
    Adv:a. For smaller databases with less retention.
    b. Faster backups locally
    c. Faster restores.
    DisAdv:a.Media failure
    b.Does not work for VLDB
    2. Its expensive to separate tape drives as they come in big sizes.Have maxsetsize or section size set to few GBs for faster read to restore. RMAN can easily identify the files it needs for recovery and the storage vendor have the catalogs that helps. You can separate tapes for permanent retention. Deleting the obsolete backups is messy as you have to load the right tape, operational difficulties.
    3. Refer #1.
    hth.
    Edited by: user11155666 on Jun 2, 2011 5:52 PM

  • Design Question for table - related columns

    Hi,
    I have some design question about table I am working on.
    Here are the sample fields in the table,
    process_begin_date
    process_approved_by
    process_signed_by
    process_monitor
    process_communication
    the same way I have around 10 groups, for ex
    other_begin_date
    other_approved_by
    other_signed_by
    other_email
    other_something
    Question: Is good have all 50 fields in the same table? or any better idea?

    Hi,
    Number of columns should not be any issue, but, proper normalization may be better for your design and scalability. If you can explain what you are storing in this table, you might get help if you need to have more than 2 tables in this particular scenario.
    If all these fields are related to a single entity, probably this single table is already normalized and needs not to be replaced by two tables.
    Salman

  • Design question: Scheduling a Variable-timeslot Resource

    I originally posted this in general java programming, because this seemed like a more high-level design descussion. But now I see some class design questions. Please excuse me if this thread does not belong here (this is my first time using the forum, save answering a couple questions).
    Forum,
    I am having trouble determining a data structure and applicable algorithm (actually, even more general than the data structure -- the general design to use) for holding a modifiable (but more heavily read/queried than updated), variable-timeslot schedule for a given resource. Here's the situation:
    Let's, for explanation purposes, say we're scheduling a school. The school has many resources. A resource is anything that can be reserved for a given event: classroom, gym, basketball, teacher, janitor, etc.
    Ok, so maybe the school deal isn't the best example. Let's assume, for the sake of explanation, that classes can be any amount of time in length: 50 minutes, 127 minutes, 4 hours, 3 seconds, etc.
    Now, the school has a base operation schedule, e.g. they're open from 8am to 5pm MTWRF and 10am to 2pm on saturday and sunday. Events in the school can only occur during these times, obviously.
    Then, each resource has its own base operation schedule, e.g. the gym is open from noon to 5pm MTWRF and noon to 2pm on sat. and sun. The default base operation schedule for any resource is the school which "owns" the resource.
    But then there are exceptions to the base operation schedule. The school (and therefore all its resources) are closed on holidays. The gym is closed on the third friday of every month for maintenance, or something like that. There are also exceptions to the available schedule due to reservations. I've implemented reservations as exceptions with a different status code to simplify things a little bit: because the basic idea is that an exception is either an addition to or removal from the scheduleable times of that resource. Each exception (reservation, closed for maintenance, etc) can be an (effectively) unrestricted amount of time.
    Ok, enough set up. Somehow I need to be able to "flatten" all this information into a schedule that I can display to the user, query against, and update.
    The issue is complicated more by recurring events, but I think I have that handled already and can make a recurring event be transparent from the application point of view. I just need to figure out how to represent this.
    This is my current idea, and I don't like it at all:
    A TimeSlot object, holding a beginning date and ending date. A data structure that holds list of TimeSlot objects in order by date. I'd probably also hold an index of some sort that maps some constant span of time to a general area in the data structure where times around there can be found, so I avoid O(n) time searching for a given time to find whether or not it is open.
    I don't like this idea, because it requires me to call getBeginningDate() and getEndDate() for every single time slot I search.
    Anyone have any ideas?

    If I am correct, your requirement is to display a schedule, showing the occupancy of a resource (open/closed/used/free and other kind of information) on a time line.
    I do not say that your design is incorrect. What I state below is strictly my views and should be treated that way.
    I would not go by time-slot, instead, I would go by resource, for instance the gym, the class rooms (identified accordingly), the swimming pool etc. are all resources. Therefore (for the requirements you have specified), I would create a class, lets say "Resource" to represent all the resources. I would recommend two attributes at this stage ("name" & "identifier").
    The primary attribute of interest in this case would be a date (starting at 00:00hrs and ending at 24:00hrs.), a span of 24hrs broken to the smallest unit of a minute (seconds really are not very practical here).
    I would next encapsulate the availability factor, which represents the concept of availability in a class, for instance "AvailabilityStatus". The recommended attributes would be "date" and "status".
    You have mentioned different status, for instance, available, booked, closed, under-maintainance etc. Each of these is a category. Let us say, numbered from 0 to n (where n<128).
    The "date" attribute could be a java.util.Date object, representing a date. The "status", is byte array of 1440 elements (one element for each minute of the day). Each element of the byte array is populated by the number designation of the status (i.e, 0,1,2...n etc.), where the numbers represent the status of the minute.
    The "Resource" class would carry an attribute of "resourceStatus", an ordered vector of "ResourceStatus" objects.
    The object (all the objects) could be populated manually at any time, or the entire process could be automated (that is a separate area).
    The problem of representation is over. You could add any number of resources as well as any number of status categories.
    This is a simple solution, I do not address the issues of querying this information and rendering the actual schedule, which I believe is straight forward enough.
    It is recognized that there are scope for optimizations/design rationalization here, however, this is a simple and effective enough solution.
    regards
    [email protected]

  • LDAP design question for multiple sites

    LDAP design question for multiple sites
    I'm planning to implement the Sun Java System Directory Server 5.2 2005Q1 for replacing the NIS.
    Currently we have 3 sites with different NIS domains.
    Since the NFS over the WAN connection is very unreliable, I would like to implement as follows:
    1. 3 LDAP servers + replica for each sites.
    2. Single username and password for every end user cross those 3 sites.
    3. Different auto_master, auto_home and auto_local maps for three sites. So when user login to different site, the password is the same but the home directory is different (local).
    So the questions are
    1. Should I need to have 3 domains for LDAP?
    2. If yes for question 1, then how can I keep the username password sync for three domains? If no for question 1, then what is the DIT (Directory Infrastructure Tree) or directory structure I should use?
    3. How to make auto map work on LDAP as well as mount local home directory?
    I really appreciate that some LDAP experta can light me up on this project.

    Thanks for your information.
    My current environment has 3 sites with 3 different NIS domainname: SiteA: A.com, SiteB:B.A.com, SiteC:C.A.com (A.com is our company domainname).
    So everytime I add a new user account and I need to create on three NIS domains separately. Also, the password is out of sync if user change the password on one site.
    I would like to migrate NIS to LDAP.
    I want to have single username and password for each user on 3 sites. However, the home directory is on local NFS filer.
    Say for userA, his home directory is /user/userA in passwd file/map. On location X, his home directory will mount FilerX:/vol/user/userA,
    On location Y, userA's home directory will mount FilerY:/vol/user/userA.
    So the mount drive is determined by auto_user map in NIS.
    In other words, there will be 3 different auto_user maps in 3 different LDAP servers.
    So userA login hostX in location X will mount home directory on local FilerX, and login hostY in location Y will mount home directory on local FilerY.
    But the username and password will be the same on three sites.
    That'd my goal.
    Some LDAP expert suggest me the MMR (Multiple-Master-Replication). But I still no quite sure how to do MMR.
    It would be appreciated if some LDAP guru can give me some guideline at start point.
    Best wishes

  • WLPI Design Question

    I've got a bit of a design question for Process Integrator. Currently I'm building
    a prototype for an exception handling system using Process Integrator. The application
    has to be web based and I'm using the Front Controller design pattern that is
    described in the J2EE Blueprint docs.
    I've come across a bit of a design problem. Should I design the application so
    that all the user actions in a task are accessed via the api set or should I build
    this functionality into the template. For example, a user will action a task which
    requires the user to update some variables in the template. In the template definition
    should use a Send XML to Client action and then use the taskExecute method on
    the worklist, or should I do it all programatically?
    Also if I do use the Send XML to Client should I then mark the task done using
    the APIs or using the Studio. I have noticed that if I mark the task done wihtin
    the studio after sending the xml, the task becomes available for the next user,
    even if the variables haven't been updated yet.
    Sorry about the rambling nature of this post.
    Thanks in advance.
    Preyesh

    If you want to write code that's easier for you to write, you do whatever the hell you want.
    If you want to write good code, retain the ID.

  • Universe Design Question - Time dimension

    Hi,
    Please help me with universe design question here.
    I have to make line graph
    Y- axis time dimension hh24:mi:ss
    y - axis Date dimension YYYYMM
    The data is like this
    progname end_date
    abcd 2011/01/23 13:01:20
    abcd 2011/01/24 13:30:20
    abcd 2011/01/25 13:34:20
    abcd 2011/01/23 13:34:20
    abcd 2011/01/25 13:45:20
    abcd 2011/01/2614:34:20
    I need to take time portion of each month and take average of it and that is printed on graph.
    I just wonder how I get average of time. The tool seems like can not get average of time as this is not a number.
    Then I converted time portion into seconds and did the average but my requirement is to show time on line graph not in seconds.
    Please give some idea.
    Thanks.

    Hi Afzal,
       I know how to segregate the date part and the time part. I just wonder how I get average of time. The tool seems like can not get average of time as this is not a number.
    Then I converted time portion into seconds and did the average but my requirement is to show time on line graph not in seconds.
    Please give some idea.
    Thanks.

  • Dinamically Generate PDF File - Design Question

    Hello there,
    I'd like to dinamically generade a PDF file but because I've never done that before I have some design / structure questions.
    The workflow I imagine works as follows.
    1. I created a new menu item with which a new Page is created. Idealy I would be able to generate the title and the subtitles of that new page already.
    2. The user imports other pdf documents to the newly created page and annotates stuff.
    3. The first page is then dynamically extended with the information from the annotated stuff.
    I already found a code sample in the Adobe SDK that I think is usefull. My question is how to structue the PDF file I'm generating. Is it a good idea to store every subtitle-category within a PDEContent element and then add the PDEText elements to it? Is it possible to add textfields, this is form elements too? Or, would it be possible to use a template for the basic structure that can be dinamically extended at runtime?
    I hope this description was understandable and I'm looking forward to your sugestions.

    You need to do some research on PDF first to understand how PDF works - both standard page content as well as the various Forms capabilities.  Then, armed with that knowledge, you need to evaluate the PDFs that users will be importing as well as the final document presentation & functionality that you desire.
    Then you'll have a design that we can comment on how to implement...

  • Web design questions (Was: A number of questions..)

    Ok so!
    What fonts are known to go well together when making banners or headers? I have been messing around with a lot of fonts and im really just looking for some new ones!
    I know this question really depends on the banner itself but what is a recommended size of a font when making a header? lets say 860x250 ?
    Are there any real kind of "must nots" when designing banners?
    When Placing text onto A banner where is the usual place you would see it? I know it changes from site to site but from just looking around a lot of text seems to be in the left bottom corner, is this a norm of some sort?
    Are there any known font combinations which would go together well when making a full webpage? As in fonts for the sidebar, content area, footer etc, any combinations?
    Thank you very much!

    You are asking design questions, but most web designers, including those who frequent this forum, have  no design expertise.
    Your questions are good, but  incomplete. The right typeface and size depends on the impression you are trying to create. For instance, you wouldn't want to use the typeface "Comic" for a website selling financial services.
    Many corporations have lengthy documents detailing their identity for graphic design and advertising. Such documents define which typefaces may be used where, and how. Assuming that you don't have such a document to work with for the creation of this web banner, think about the business, organization (or whatever) the website is for. Should it convey conservative dependability? Edginess? Family friendliness? The typefaces you choose should take such qualities into consideration.
    There's no definite answer to any of the questions you have asked. But that's OK. You should research websites that create the kind of impression you want to make and study how they accomplish it.

  • Javabean Design Question

    I'm new to writing Javabeans but started writing an application to test (and improve!) my knowledge and I have a few questions...
    I have a query that returns data from multiple different tables (like 6-8). I'm trying to decide how to structure my beans. To make it easiest on my JSP code, I wrote a single bean that had fields and accessor methods for the returned columns. However, I'm concerned that my Javabean design inexperience is coming up here. I cdon't think I see much reusuablity in the bean I wrote. Then again, I'm not sure how much reusability any of these beans would have no matter how they're written. And I would think that, from a practical standpoint, many beans are probably written that have little or no reusability value. At the very least though, they're still hiding code/complexity from JSP developers who are more on the HTML side, no? My bigger concern though is my first question. Can anyone offer me some design advice here? It would be much appreciated.
    Also, in a related question, as a rule of thumb, should a Javabean correspond to a single database table? Or is that just a misguided assumption I have from reading an example in a textbook?

    I don't worry about reusability until I've used my stuff at least once. It's gotta be usable before it can be reusable. ;) You might find that some of these beans will carry over to other projects, with some modification. When you've reused them several times you might see a pattern that will allow you to use them in all those projects without changes. If you've done a good job eventually the changes should stabilize, and you'll have some reusable Beans.
    This is a difficult that happens because objects and relational databases are different. It's called the Object-Relational Impedence Mismatch.
    Some people say objects should drive your problem, and that relational databases are merely repositories. The other side says that relational theory is well proven and developed over the last twenty years, so the database should be the focus.
    As much as I like objects, I'd rather not throw away the performance benefits that databases can give me.
    If you've got a single query that brings back data from 6-8 tables and loads it into a single Bean, it suggests that you've got a nicely normalized database. Leave it that way. Check your Bean design again to satisfy yourself that a coherent Bean really does need to draw on 6-8 tables. If it hangs together, leave it.
    There's a lot of work out there on Data Access Objects and persistence layer design. I'd read those, too:
    http://www-106.ibm.com/developerworks/java/library/j-dao/#resources
    If you can, see Martin Fowler's "Patterns of Enterprise Application Architecture". He's got a whole chapter on persistence patterns.

  • Some quick questions before purchase of MBP

    Hey Guys/Gals,
    I've been a PC user all my life, but will now be making a permanent switch to Macs. I've been wanting to buy a MBP since they have been released, but have been hesitant (like many others I think...) about the issues of whine, extreme heat, warped screens etc...
    With the recent updates of the logic board and even battery, I think I'm ready to go for it. I just had some quick questions before I place my order:
    1. I could order my MBP from the computer store at my university. Do you guys think that will get me the newest possible MBP or will they maybe get me one that they have had in stock for ages? I really don't want to get stuck with an outdated logic board and/or battery. Is it safest just to order directly from the site?
    2. Although the issue with really hot MBPs seems to have gotten better, I am still quite shocked that people say that temperatures well above 70 Celsius are "within spec". I understand that Apple officially states this and that the Intel chip can handle up to 100 Celsius, but this seems crazy to me Basically, I want to ask if I am correct in my observations that the new Intel chips don't get much hotter than other chips around, but rather Apple has chosen to set the temperature mark that sets off the fans pretty hight (around the 70s if I remember correctly?)
    I would assume that in following their "mission" of creating beautifully designed computers, Apple also wants to have a really silent one. Now I'm all for a quiet machine, but I feel as though if fans were on either (a) all the time or (b) when the CPU reaches the high 50s lots of people would be happier.
    Anyway, it's just a thought. I noticed there are lots of experts around here, so I'm just interested to hear what you guys think about this approach that Apple seems to have taken. I don't think the heat will stop me from getting this amazing notebook, but it certainly is a little frustrating.
    Any responses are greatly appreciated.

    1. I could order my MBP from the computer store at my university. Do you guys think that will get me the newest possible MBP or will they maybe get me one that they have had in stock for ages? I really don't want to get stuck with an outdated logic board and/or battery. Is it safest just to order directly from the site?
    No matter where you take possession there's no assurance of when the machine was manufactured. There is really just as good a chance of getting a perfectly good computer regardless of place of purchase. If there is a problem it's covered under warranty. You can have the computer replaced within the first two weeks. Afterwards they will replace or repair. Without Applecare's extended warranty the computer is warranted for one year after purchase.
    2. Although the issue with really hot MBPs seems to have gotten better, I am still quite shocked that people say that temperatures well above 70 Celsius are "within spec". I understand that Apple officially states this and that the Intel chip can handle up to 100 Celsius, but this seems crazy to me Basically, I want to ask if I am correct in my observations that the new Intel chips don't get much hotter than other chips around, but rather Apple has chosen to set the temperature mark that sets off the fans pretty hight (around the 70s if I remember correctly?)
    You are wrong in your assumption. The Core Duo's maximum temperature is 125C before shutdown. Normal operating temperatures according to Intel's own documentation is 50-70C under average load. MBPs under heavy load will typically reach core temperatures over 80C. Then there's the added heat from the hard drive and GPU. The aluminum case acts as a partial heat radiator hence the case temperatures can get high. The MBP User Guide specifically states this and issues a warning about using the computer on one's lap.
    I would assume that in following their "mission" of creating beautifully designed computers, Apple also wants to have a really silent one. Now I'm all for a quiet machine, but I feel as though if fans were on either (a) all the time or (b) when the CPU reaches the high 50s lots of people would be happier.
    In fact the fans in the MBP are very quiet at least mine are. Unless you are in the hardware design business with intimate knowledge of using Core Duo chips in portable computers, then your observations, although certainly your opinion, are not based on anything factual.
    Anyway, it's just a thought. I noticed there are lots of experts around here, so I'm just interested to hear what you guys think about this approach that Apple seems to have taken. I don't think the heat will stop me from getting this amazing notebook, but it certainly is a little frustrating.
    More likely there are a lot of people around here who think they are experts. As the remark goes, "An 'expert' derives from ex, meaning 'has been', and spert, meaning 'drip under pressure.'"
    You'll read lots of opinions on these forums. Don't take for granted that everything you read is factual or truth. A lot of the opinions expressed are without any basis in fact.

  • Design questions on using JMX

    I have been reading about JMX and trying to understand it
    I have some specific design realted questions and wanted some opinions to validate my understanding
    Assume a simple j2ee application that exposes 2 webservices .
    I would like to find out how many times each service is called and the total number of success/faults/errors
    encountered for each service along with params like starttime etc
    From what I have understood , I will have to first create a Bean , say "StatsCollector"
    and then creae a StatsCollectorMBean interface.
    The StatsCollector will provide the methods to set/update the above values and those will also be exposed by the StatsCollectorMBean interface
    1) I have trouble understanding how to create and maintain the MBean Resource...
    Shouldnt there be always 1 instance of this resource ? ie shouldnt there be only one StatsCollector ?
    Most of the examples create a simple class "Hello implements HelloMBean" and that makes it a MBean
    but they create Hello hello = new Hello() and then register it with the MBean server
    What if we create multiple objects of Hello? Wouldnt that defeat the porpose of the MBean ?
    I think that we need to make sure that this resource is always created once only.
    Is that correct ?
    2) Is it the right practice to separate your MBean and your "managed" resource ?
    ie in the above case , should there be a Singleton StatsCollector POJO that stores the Appliction
    statistics and another StatsMBean that will be the MBean that will access the POJO ? This makes sure that your Resource does not have
    dependency management classes.
    3) How does the application update the values in the MBean ?
    In the above example , how do you update the success and failure counts in the MBean from the application ?
    Can I update the singleton StatsCollector directly or do I have to go through the MBean Server to update
    any value in the MBean ?
    If I update them directly , will they be "visible" thru the MBean server ?
    4) Assuming that the above app gets deployed in a appserver like WebSphere and in a Clustered environment ,
    how to ensure that statisitcs are collected for all the services on all servers cummulativly ?
    Is this something that the appserver should provide ? Do we register the MBean with the Appserver
    MBean server ?
    Any ideas/suggestions will be helpful !
    thanks
    Pat

    Hello pat,
    very interesting questions. You are covering the main JMX design questions there.
    You should have a look (if you not already did) to the JMX best practices : http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/best-practices.jsp
    This document summarize common JMX design patterns.
    Answers to your questions:
    1) The resources you want to manage/monitor are Web Services. The life cycle of these services is handled by the J2EE container itself. As you say, the tricky part is to link the WebService resource life cycle to the MBean resource
    The MBean leaves inside its own container, the MBeanServer.
    You should identify an initialization phase in which you create your MBeans and register them inside the MBeanServer once.
    In your case, you can go for a single collector that monitors the 2 Web Services or a collector per Web Service. It seems that you want to track each service independently. Having 2 MBeans should offer a more flexible solution.
    If you go for 1 MBean, you should name it "<your management domain>:type=StatsCollector". This name identify an MBean for which you have a single instance. Once the collector registered with this name, the MBeanServer will guarantee that no MBean with the same name can be registered.
    If you go for 2 MBeans, you should add the Web Service name to each MBean ObjectName. For example:
    MBean 1 : "<your management domain>:type=StatsCollector,name=MyWebService1"
    MBean 2 : "<your management domain>:type=StatsCollector,name=MyWebService2"
    Example of MBean creation and registration code :
    StatsCollector collector1 = new StatsCollector();
    ManagementFactory.getPlatformMBeanServer().registerMBean(collector1,
    new ObjectName("com.foo.bar:type=StatsCollector,name=WebService1");
    At this point you have an MBean registered inside the platform MBeanServer.
    2) A Standard MBean is formed of a java interface and a class. Generally the interface and the class are not separated. They could be but I don't see a strong reason in your case to have the POJO and interface not being the same object.
    3) You shouldn't expose the methods to set the values in your MBean interface. Only getters should be visible. It means that you will have to keep a direct reference to the collectors to update the statistics. During your initialization phase, you could use JNDI to register the collector instances. The WebServices will then use JNDI to retrieve the collectors.
    An example of a simplified StatsCollector class and StatsCollectorMBean interface
    public interface StatsCollectorMBean {
    public int getNumRequests();
    public class StatsCollector implements StatsCollectorMBean {
    private int numRequests.
    public int getNumRequests() {
    return average;
    public serviceCalled() {
    numRequests++;
    In the above example, serviceCalled is not part of the management interface and is called by the Web Service.
    4) Difficult question for which I can't provide you with a reply. JMX doesn't offer such cumulative service in a standard way. In some appserver (glassfish for instance), MBeans are cascaded inside the domain server. There is no cumulative representation offered, but you could implement your own by defining new MBeans linked to the StatsCollector ones.
    To conclude, Appservers are offering some "out of the box" management and monitoring features . For example glassfish relies on the AMX framework (that is JMX based) . AMX (https://glassfish.dev.java.net/javaee5/amx/) allows you to monitor and manage your services. A possible solution would be to rely on this infrastructure to build your own management and monitoring.
    Hope this help.
    Regards.
    Jean-Francois Denise

  • Catalyst 3850 Stack VLANs, layer 2 vs. layer 3 design question

    Hello there:
    Just a generic, design question, after doing much reading, I am just not clear as when to use one or the other, and what the benefits/tradeoffs are:
    Should we configure the switch stack w/ layer 3, or layer 2 VLANs?
    We have a Catalyst 3850 Stack, connected to an ASA-X 5545 firewall via 8GB etherchannel.
    We have about 100 servers (some connected w/ bonding or mini-etherchannels), and 30 VLANs.
    We have several 10GB connections to servers.
    We push large, (up to) TB sized files from VLAN to VLAN, mostly using scp.
    No ip phones, no POE.
    Inter-VLAN connectivity/throughput and security are priorities.
    Originally, we planned to use the ASA to filter connections between VLANs, and VACLs or PACLs on the switch stack to filter connections between hosts w/in the same VLAN.
    Thank you.

    If all of your servers are going to the 3850 then I'd say you've got the wrong switch model to do DC job.  If you don't configure QoS properly, then your servers will start dropping packets because Catalyst switches have very, very shallow memory buffers.  These memory buffers get swamped when servers do non-stop traffic. 
    Ideally, Cisco recommends the Nexus solution to connect servers to.  One of the guys here, Joseph, regularly recommends the Catalyst 4500-X as a suitable (and financial) alternative to the more expensive Nexus range.
    In a DC environment, if you have a lot of VM stuff, then stick with Layer 2.  V-Motion and Layer 3 don't go hand-in-hand.

  • Design question: Link data between JFrames

    Dear all,
    I have a design question. I have this form in a JFrame where you can set an icon as a property. To achieve this, I have a "Set" button on the form which will open a new window with all the available icons. When you click an icon, I want the "icon" frame to be closed and the selected icon to be send to the original form. This is the way I do it now:
    Interface :
    public interface IconUpdate
    public void updateIcon(Icon icon);
    }Main frame with the "Set" button:
    public class Test extends JFrame implements IconUpdate, ActionListener
        private Icon icon = null;
        public Test()
            // add button and actionlistener and that kind of stuff
        public void actionPerformed(ActionEvent e)
            if(e.getSource() == btnSetIcon)
                new IconFrame(this);
        public void updateIcon(Icon icon)
            this.icon = icon;
    }The Icon frame:
    public class IconFrame extends JFrame implements ActionListener
        IconUpdate parent = null;
        public IconFrame(IconUpdate parent)
            this.parent = parent;
            // Initialize table,"Pick" button etc.
        public void actionPerformed(ActionEvent e)
            if(e.getSource() == btnPick)
                parent.updateIcon((Icon)list.getSelectedValue());
                this.dispose();
    }Maybe I made some spelling faults, but this is the way I implement it. Now my question is: is there another way to achieve my goal? If I have to create an interface for every "popup choose dialog" in my program, I have to create many of them. I know using a combobox in the main frame is an option, but I just want to use it this way. Can anyone tell me how I can rewrite this code to make it better / more professional?
    Tx in advance!!!
    Peter

    I can think of a couple options:
    1) Let IconFrame's constructor accept a Test parameter, instead of creating an interface.
    2) Make IconFrame into a modal dialog & have it store the user's selection in a variable. Then when you show the dialog, your action listener will block until the user selects an icon. Then you can call "getSelectedIcon()" to retrieve his/her selection. This would be much like the JOptionPane.showXXX() methods, and probably the cleaner solution.

Maybe you are looking for

  • My HP Photosmart C4480 won't scan

    I can print from my PC using Windows7 operating system but I can not scan. Always gives me an error message 0x00000015 for device not being ready. What can I do? Thanks in advance for the advice. Baytar1953

  • [q]Check lists of RS-232

    Dear all, I want to do some labview work using RS-232 communication of a commercial instrument. The RS-232 cable was made by myself for a reason (50pin). But my normal skill of RS-232 is not applied the instrument. 1. How to check the RS-232 cable? T

  • IPhone 5 left speaker broken, out of warranty but only 7 months old. Any advice?

    My iPhone 5 is 7 months old and my left speaker had just broke so I cannot listen to people on the phone nor listen to music. The iPhone is out of warranty, any solutions?

  • Jspinner key detection

    I have a JSpinner implemented in a JTable. The spinner is implemented as a table cell renderer, with a matching custom editor. JTable implementation..... table_Shots.getColumnModel ( ).getColumn ( i ).setCellRenderer ( new ToHoleColumnRender() ); tab

  • XML downloads for customers

    I'm new to using Oracle and would like to know the easiest way to do the following: I want to give our customers the abilty to submit a to and from dat from a web page and then I would like to query some tables to produce an XML file. I don't want th