How to use command pattern in grid computing

IS there a more comprehensive command pattern example available ? In a real life command method, execute method will query coherence cache for objects. Does this cause any kind of deadlock issue, i.e., in cases where Command being a coherence cluster managed object, which in turn would query another coherence managed object from another cluster member.

You might want to look at the Processing Pattern which is a more generalized and richer model for
doing distributed processing.
Check out this video: http://www.youtube.com/watch?v=Ic2ib_VIqWQ
Edited by: rhanckel on Oct 29, 2010 7:33 AM

Similar Messages

  • How to implement command pattern into BC4J framework?

    How to implement command pattern into BC4J framework, Is BC4J just only suport AIDU(insert,update,delete,query) function? Could it support execute function like salary caculation in HR system or posting in GL(general ledger) system? May I create a java object named salaryCalc which use view objects to get the salary by employee and then write it to database?
    Thanks.

    BC4J makes it easy to support the command pattern, right out of the box.
    You can write a custom method on your application module class, then visit the application module wizard and see the "Client Methods" tab to select which custom methods should be exposed for invocation as task-specific commands by clients.
    BC4J is not only for Insert,Update,Delete style applications. It is a complete application framework that automates most of the typical things you need to do while building J2EE applications. You can have a read of my Simplifying J2EE and EJB Development Using BC4J whitepaper to read up on an overview of all the basic J2EE design patterns that the framework implements for you.
    Let us know if you have more specific questions on how to put the framework into practice.

  • Can someone tell me how to use 2 ipods on one computer

    well when anyone can ill be waiting for the answer i want to know cuz since im buying the ipod video i want to see if i can use the same computer that im uploading stuff to my ipod mini

    There is no limit to how many iPods can run on a single PC. Or how many PCs a single iPod can connect to. Either by Apple design or by any legal issues.
    These links should help:
    Natalie Beresford: Multiple iPods/iTunes Installations
    How to use multiple iPods with one computer
    How to share music between different accounts on a single computer

  • How to use CQL patterns in CEP?

    Hi,
    How to use CQL patterns and what is the use ?

    Try the new Stream Explorer interface and check out the patterns section. These are pre-defined patterns that allow you to look for trends, missing events, duplicates, W Pattern, etc. These do in-memory incremental processing of data with high throughput and low latency.
    The SX user interface allows you to easily define a data stream and start applying a pattern. An Event Processing Network (EPN) with a CQL processor and the CQL are generated automatically and the results are immediately shown on the user-interface.

  • How to use lock pattern for ur home screen in pod touch 4g(ios 5)

    how to use lock pattern for ur home screen in pod touch 4g(ios 5)

    Video formats:
    H.264 video up to 720p, 30 frames per second, Main Profile level 3.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
    MPEG-4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
    Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format
    Support for 1024 by 768 pixels with Apple VGA Adapter; 576p and 480p with Apple Component AV Cable; 576i and 480i with Apple Composite AV Cable (cables sold separately)

  • Client/server RMI app using Command pattern: return values and exceptions

    I'm developing a client/server java app via RMI. Actually I'm using the cajo framework overtop RMI (any cajo devs/users here?). Anyways, there is a lot of functionality the server needs to expose, all of which is split and encapsulated in manager-type classes that the server has access to. I get the feeling though that bad things will happen to me in my sleep if I just expose instances of the managers, and I really don't like the idea of writing 24682763845 methods that the server needs to individually expose, so instead I'm using the Command pattern (writing 24682763845 individual MyCommand classes is only slightly better). I haven't used the command pattern since school, so maybe I'm missing something, but I'm finding it to be messy. Here's the setup: I've got a public abstract Command which holds information about which user is attempting to execute the command, and when, and lots of public MyCommands extending Command, each with a mandatory execute() method which does the actual dirty work of talking to the model-functionality managers. The server has a command invoker executeCommand(Command cmd) which checks the authenticity of the user prior to executing the command.
    What I'm interested in is return values and exceptions. I'm not sure if these things really fit in with a true command pattern in general, but it sure would be nice to have return values and exceptions, even if only for the sake of error detection.
    First, return values. I'd like each Command to return a result, even if it's just boolean true if nothing went wrong, so in my Command class I have a private Object result with a protected setter, public getter. The idea is, in the execute() method, after doing what needs to be done, setResult(someResult) is called. The invoker on the server, after running acommand.execute() eventually returns acommand.getResult(), which of course is casted by the client into whatever it should be. I don't see a way to do this using generics though, because I don't see a way to have the invoker's return value as anything other than Object. Suggestions? All this means is, if the client were sending a GetUserCommand cmd I'd have to cast like User user = (User)server.executeCommand(cmd), or sending an AssignWidgetToGroup cmd I'd have to cast like Boolean result = (Boolean)server.executeCommand(cmd). I guess that's not too bad, but can this be done better?
    Second, exceptions. I can have the Command's execute() method throw Exception, and the server's invoker method can in turn throw that Exception. Problem is, with a try/catch on the client side, using RMI (or is this just a product of cajo?) ensures that any exception thrown by a remote method will come back as a java.lang.reflect.InvocationTargetException. So for example, if in MyCommand.execute() I throw new MySpecialException, the server's command invoker method will in turn throw the same exception, however the try/catch on the client side will catch InvocationTargetException e. If I do e.getCause().printStackTrace(), THERE be my precious MySpecialException. But how do I catch it? Can it be caught? Nested try/catch won't work, because I can't re-throw the cause of the original exception. For now, instead of throwing exceptions the server is simply returning null if things don't go as planned, meaning on the client side I would do something like if ((result = server.executeCommand(cmd)) == null) { /* deal with it */ } else { /* process result, continue normally */ }.
    So using the command pattern, although doing neat things for me like centralizing access to the server via one command-invoking method which avoids exposing a billion others, and making it easy to log who's running what and when, causes me null-checks, casting, and no obvious way of error-catching. I'd be grateful if anyone can share their thoughts/experiences on what I'm trying to do. I'll post some of my code tomorrow to give things more tangible perspective.

    First of all, thanks for taking the time to read, I know it's long.
    Secondly, pardon me, but I don't see how you've understood that I wasn't going to or didn't want to use exceptions, considering half my post is regarding how I can use exceptions in my situation. My love for exception handling transcends time and space, I assure you, that's why I made this thread.
    Also, you've essentially told me "use exceptions", "use exceptions", and "you can't really use exceptions". Having a nested try/catch anytime I want to catch the real exception does indeed sound terribly weak. Just so I'm on the same page though, how can I catch an exception, and throw the cause?
    try {
    catch (Exception e) {
         Throwable t = e.getCause();
         // now what?
    }Actually, nested try/catches everywhere is not happening, which means I'm probably going to ditch cajo unless there's some way to really throw the proper exception. I must say however that cajo has done everything I've needed up until now.
    Anyways, what I'd like to know is...what's really The Right Way (tm) of putting together this kind of client/server app? I've been thinking that perhaps RMI is not the way to go, and I'm wondering if I should be looking into more of a cross-language RPC solution. I definitely do want to neatly decouple the client from server, and the command pattern did seem to do that, but maybe it's not the best solution.
    Thanks again for your response, ejp, and as always any comments and/or suggestions would be greatly appreciated.

  • Help wanted - step by step process on how to use two ipods on one computer

    I'm just in the process of getting an ipod (waiting on delivery!) and want to know how it is possible to have two ipods using the same computer but synchronizing differently. I don't want to risk losing my partners music (he'll be very upset!) and I don't want to end up with his music on my ipod. I'd appreciate it if someone could give me a step by step guide or tell me where the best place to look for the answer is. Is it possible somehow to have two different libraries on one computer? Is that how it works?

    There are a couple of methods for using more than one iPod on a single computer. Have a look at the article linked below. Method one is to have two Mac or Windows user accounts which by definition would give you two completely separate libraries. Method two as Chris has already described above is to set your preferences so each iPod is updated with only certain playlists within one library. Have a look anyway and see what you think and go for whichever you feel suits your needs best: How To Use Multiple iPods with One Computer

  • How to use an Aggregate in a Computation on an Interactive Report?

    version 4.0.2.00.07
    Hello,
    I'm trying to create a computation on an Interactive Report from the Actions menu to compute a percentage.
    I have two Status columns, one for open and one for closed. I have to count the number of open and count the number of closed and then divide the two.
    I created an aggregate, count, on the open status and closed status, but how to use them in the computation? There's no 'count' in the Function list in the Compute box.
    I was hoping that those aggregated columns would be displayed in the Compute sub-menu on the Actions button but they don't appear to be.
    Can someone help me with this?
    Thanks,
    Joe

    Maybe an alternative would be to put this logic into the select.
    select u.object_name,
           u.object_type,
           count(case when u.object_type = 'TABLE' then 1 end) over () count_tables,
           count(case when u.object_type = 'VIEW' then 1 end) over () count_views
    from user_objects u;This would count the number of tables and views in the data dictionary. And it is returned as a column value.

  • How to use 2 iPods in 1 computer

    How can I use 2 iPods in one computer using the same library but using different playlists?

    Hello JoeBonsai here is a article that should help you out with this question.
    http://docs.info.apple.com/article.html?artnum=300432
    - Nathanm
    MacBook | 2.0 Ghz | 2 GB Ram   Mac OS X (10.4.8)  

  • How i use java applet data grid i have many record i need show in grid

    hi master
    sir i have many record i want show all record in applet grid how i use grid in applet
    please send me sample code of java class how send many record to grid and applet code how use applet grid
    thanks
    aamir

    Duplicate post:
    how use the jtable in java applete
    Aamir,
    If you use JApplet then you can use JTable. Just do an Internet search for "JTable" and "applet".
    Good Luck,
    Avi.

  • How to use IT_special_groups in ALV Grid ?

    Hi Abapers,
    Am new to ALv's
    am passing almost all parameters to ALV_GRID FM..!
    i dont no how to use of options Groups , Filters and I_sel_hide .
    event i find an Demo example related to Groups ..
    but while displaying the out put i didnt find any Changes ?
    could any one give an Example with using GROUPS , Filters and SEL_INFO ?
    Pls help me out to resolve this problem ..!
    Thanks & Regrds
    Rajeshk

    Hi,
    you can group your ALV columns into various groups using field SP_GROUP in field catalog. You assign name to these groups in the table IT_SPECIAL_GROUPS. User can restrict column selection to one of these groups (using name from the table) on the current layout window. More info can be found in [SAP documentation|http://help.sap.com/saphelp_nw04/helpdata/en/a2/64f7a2ee4f11d2b484006094192fe3/frameset.htm]
    Probably as you know you can filter selected records in ALV (icon with funnel). You can use table IT_FILTER to set up this filter.
    I am not sure about I_SEL_HIDE but as far as I remember ALV can display selection criteria from report which call ALV FM. So I assume that you can use this table to control displaying of them.
    BTW there is a really nice [reference for ALV|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907?overridelayout=true].
    Cheers

  • How to use command line with acrobat to extract page(s) from pdf file?

    I have adobe acrobat, and have a pdf file with over 500 pages. I need to extract small chunks of pages from it as seperate pdf files. I was hoping I could use command line interface to do this faster.
    Something like:
    acrobat src des start end
    so for example
    adobe file.pdf my_folder 3 5
    Is this possible? There are many chunks and I don't want to manually do it for every chunk. Command line would be much easier...
    Thanks

    I can't find any programs... sorry.
    Can you create one for me please.
    It should at least have these 5 arguments: (well the first one is not neccessary since were not using acrobat anymore...)
    [program] [src path/src file] [destination path/file name] [start page (inclusive)] [end page (inclusive)]
    for example:
    acrobat ./my_file.pdf ./my_folder/chunk1.pdf 3 5
    if start page == end page, then it only extracts that one page.
    So this way I can just stack these comands on a .bat file or something (maybe like 100 commands), then run the bat file, and it will create all the files.
    Thanks for doing this, it is appreciated.

  • How to Use String Patterns?

    Hai all,
    I need help, In my project i am using String patterns.
    i need to search a string which contains special characters.
    Ex:
    1.Abstract{meaning}
    I have to search Abstract in this case.
    Another case is:
    2.Moon
    in this i Have to search Moon and
    so on.
    For this Source Code I had written is:
    string input = args[0];
    String pattern = "[0-9].*+\\{*\\}";
    String pattern1 = "[0-9].*";
    string line = "1.Abstract{meaning}";
    string line1 = "1.Moon";
    if( (Pattern.matches(pattern, line))||(Pattern.matches(pattern1, line1)) )
    Pattern p = pattern.compile("\\.");
    Pattern p1 = pattern.compile("\\{");
    String[] tokens = p.split();
    String[] tokens1 = p1.split();
    for(int i = 0; i < tokens.length ; i++)
    for(int j = 0; j < tokens1.length ; j++)
    if((tokens.equals(input))||(tokens[j].equals(input)))
    System.out.println(tokens[i]);
    System.out.println(tokens[j]);
    in this code it matching the 2nd case. it is not matchinf the 1st case.
    please help me.
    Thanks

    look up for "Using formatters" in the FB help.
    Essentially you'll instantiate a format, NumberFormatter for
    numbers for example, and set it's properties like e.g. showing a
    thousand separator and then one some event of the TextInput --
    valueCommit for example -- you'll do something like:
    ti.text = nf.format(ti.text)
    this is would also give you opportunity to validate user
    input using the same formatter and valid event.
    ATTA

  • How to use command promt for calling a java programe

    Hi
    i am using command promt to call my class CreateProdcut
    i am trying to call cmd.exe and then calling a class with argument *"java CreateProduct -----argument----"*
    Following is the code i am using to call cmd.exe as a seprate process
    Problem :-  I am not able to see command promt and called class o/p
    import java.io.*;
    public class ExecCreateProduct{
         public static void main(String args[]) throws IOException, java.lang.InterruptedException{
              Runtime runtime = Runtime.getRuntime();
                             Process pr = runtime.exec ("cmd /c"+"java "+"CreateProduct "+"Hello World"+"HHH");
               try {
               String line;
               BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                    while ((line = input.readLine()) != null) {
                   System.out.println(line);
                   input.close();
                   } catch (Exception err) {   
                        err.printStackTrace();
              int exitVal = pr.waitFor();
            System.out.println("Exited with error code "+exitVal);
    }Edited by: rahul_p on Jun 9, 2009 2:58 AM

    do it like this it works for me :)
    try{
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("java CreateProduct -----argument-----");
    InputStream stderr = proc.getErrorStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ( (line = br.readLine()) != null)System.out.println(line);
    int exitVal = proc.waitFor();
    exitVal!=0?System.out.println("Error"):System.out.println("success");
    catch(Exception e){
    System.ourt.println(e);
    }

  • Why struts used Command Pattern?(can not understand)

    I can not understand Commnad Pattern,
    Can anyone explain it with struts?
    thanks sincere!

    Encapsulating set of actions in to a single method call is nothing but command.
    In case of struts.. U must be having an request handler classes, which are defined in ur XML file.
    Once a request comes to a servlet, it reads the value of the action attribute. Depending on the value of the action attribute, appropriate request handler class will be instantiated.
    This request handler class encapsulates all the action through a single method call. This particular scenario, we can compare with command pattern
    class MyCommand extends AbstractCommand
    public Response execute()
    // add the code for action to be performed to fulfill the request
    client call will be
    AbstarctCommand ac = xxx.createInstance(action)
    Response resp = ac.execute();
    This one sample for command pattern

Maybe you are looking for

  • I, and my clients, want a VERY simple contact form hosting option...

    There's no need for us to have data collected and analyzed. No need for yet another hosting service to store data we'll NEVER use. I've already got a hosting service for my site. My clients already have hosting for their sites. None of us are willing

  • It is possible to retain logical and physical subviews layout.

    This is specially important when using subversion repository. I am able to create a subview and arrange the entities so that they properly show on the screen. however when I check this work in, other people that check-out my work have to spend time r

  • Will the HP LaserJet P2035 Monochrome Laser Printer work with the I mac

    will the HP LaserJet P2035 Monochrome Laser Printer work with the I mac

  • Problems displaying foreign text

    Hi, I have a swing application implementing a virtual keyboard with foreign text. However, when i try to display the foreign text(with keyboard clicks)onto a JTextArea, there are only ??? printing instead. I don't have an input method yet. Is having

  • J2EE server not coming up

    Hi, We have newly installed Java server after installing latest kernel when we try to start the server the java processes terminates. Getting following error message in dev_jcontrol file. [Thr  1] ***LOG Q0I=> NiPConnect: connect (79: Connection refu