Public process in 3A4

Is it valid to have public processes in 3A4 PIP like 3A7 and 3A8?

Not sure what do you mean by having in 3A4 PIP but as per RosettaNet V02.03.00, the combination of PIP 3A4, 3A8, 3A7 and/or 3A9 is used for ordering processes. You may find RosettaNet standard implementation details here -
http://www.rosettanet.org/Default.aspx?TabId=2985
Regards,
Anuj

Similar Messages

  • Hundreds of smbd processes - CPU: 0,00 % inactive - Virtual mem about 25GB

    Hi there,
    we've got an ugly problem here. Since a few month now, our XServe freezes nearly every second day. The problem seems to be that there are hundreds of smbd processes which need all system resources.
    Clearly we tried some things to solve that.
    1. added "deadtime = 3" to /etc/smb.conf
    2. added "max smbd processes = 40" to /etc/smb.conf
    3. added "max connections = 40" to /etc/smb.conf
    4. added "* 18 * * * root killall -HUP smbd" and
    "* 7 * * * root killall -HUP smbd" to /etc/crontab
    But nothing solved the problem. Now we need your help please!
    Our full /etc/smb.conf:
    [global]
    encrypt passwords = yes
    log level = 1
    display charset = UTF-8-MAC
    security = user
    deadtime = 3
    guest account = unknown
    add machine script = /usr/bin/opendirectorypdbconfig -c createcomputeraccount -r %u -n "/LDAPv3/127.0.0.1"
    add user script = /usr/bin/opendirectorypdbconfig -c createuseraccount -r %u -n "/LDAPv3/127.0.0.1"
    client ntlmv2 auth = no
    preferred master = yes
    defer sharing violations = no
    allow trusted domains = yes
    netbios name = xserve
    lanman auth = YES
    vfs objects = darwin_acls
    wins support = no
    interfaces = 192.168.1.5
    brlm = yes
    wins server = 192.168.1.1
    max smbd processes = 40
    max connections = 40
    max log size = 2000
    server string = Xserve - Mac OS X 10.4.11
    logon drive = H:
    os level = 20
    domain logons = yes
    passdb backend = opendirectorysam guest
    dos charset = CP850
    bind interfaces only = yes
    unix charset = UTF-8-MAC
    auth methods = guest opendirectory
    local master = no
    domain master = yes
    map to guest = Never
    use spnego = yes
    printer admin = @admin, @staff
    logon path = \\%N\profiles\%u
    ntlm auth = YES
    workgroup = OURDOMAIN
    [Images]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Library/Images
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [Public]
    vfs objects = darwin_acls
    map archive = no
    path = /Shared Items/Public
    read only = no
    inherit permissions = no
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [OURSHARE1]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Users/USERGROUP1
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [homes]
    comment = User Home Directories
    root preexec = /usr/sbin/inituser %U
    create mode = 0750
    read only = no
    browseable = no
    [profiles]
    path = /Users/Profiles
    oplocks = yes
    strict locking = no
    read only = no
    browseable = no
    [printers]
    printable = yes
    path = /tmp
    [Library]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Shared Items/Library
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [OURSHARE2]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Users/USERGROUP2
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [Programme]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Shared Items/Programme
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [Documents]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Library/WebServer/Documents
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [netlogon]
    path = /etc/netlogon
    oplocks = yes
    strict locking = no
    write list = @admin
    browseable = no
    [Groups]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Groups
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [Users]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Users
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    [cvsroot]
    oplocks = 0
    map archive = no
    vfs objects = darwin_acls
    path = /Groups/cvsroot
    read only = no
    strict locking = 1
    inherit permissions = 0
    comment = macosx
    create mask = 0644
    guest ok = 0
    directory mask = 0755
    Our testparm result:
    testparm /etc/smb.conf
    Load smb config files from /etc/smb.conf
    Processing section "[Images]"
    Processing section "[Public]"
    Processing section "[Schueler]"
    Processing section "[homes]"
    Processing section "[profiles]"
    Processing section "[printers]"
    Processing section "[Library]"
    Processing section "[Lehrer]"
    Processing section "[Programme]"
    Processing section "[Documents]"
    Processing section "[netlogon]"
    Processing section "[Groups]"
    Processing section "[Users]"
    Processing section "[cvsroot]"
    Loaded services file OK.
    Invalid combination of parameters for service Images. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service Public. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service Schueler. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service homes. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service printers. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service Library. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service Lehrer. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service Programme. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service Documents. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service Groups. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service Users. Level II oplocks can only be set if oplocks are also set.
    Invalid combination of parameters for service cvsroot. Level II oplocks can only be set if oplocks are also set.
    Server role: ROLEDOMAINPDC
    It would be awesome if some of you guys have a solution for us.
    Thanks!

    Macintosh HD (disk1) / : 748.93 GB (293.48 GB free) - 111 errors
    Do a backup. Your hard drive may be failing.

  • How to create an independent process in java

    Hi ,
    I want to execute a dos command from a java program.
    The code is shown below.
    Process p;
    ProcessBuilder pb;
    command[0] = "cmd";
              command[1] = "/C";
              command[2] = "C:\\plink.exe -v -N -L 33890:10.103.1.87:3389 -l graja 10.100.32.100 -i C:\\putty_private.ppk -pw xxxxx \n";
            pb = new ProcessBuilder(command);
            p = pb.start();The purpose of this program is create an ssh tunnel to the specified host .i.e 10.100.32.100 (here).
    The problem i am facing here is, the tunnel is not created until the main program which creates this process is exited.
    My requirement is ..the main program and the process should be run at the same time.
    *plink is the command line version of PuTTY tool.
    * I tried this with one level threading and two level threading also. but it couldnt workout.
    Hi,
    This looks to be very small.
    I wish to create a process which executes a DOS command ( It is one which deals with network connections).
    I have written a small program, which creates a process that executes the DOS command.
    Until the main thread or process is exited , the connection is not establishing..
    In my project , the main() thread should create a process and continue with remaining program.
    For this , i have tried with 2 levels of threading , but i couldn't get through.
    This is the code of main program:
    public class abc {
    public static void main(String[] args){
    String[] command =  new String[3];
            command[0] = "cmd";
            command[1] = "/C";
            command[2] = "C:\\plink.exe -v -N -L 33890:10.103.1.87:3389 -l graja 10.100.32.100 -i C:\\putty_private.ppk ";
    Process       p = Runtime.getRuntime().exec(command);     
    }First , i tried with putting this code in the main function itself.
    Second, i tried with putting this code in a thread(), which is created and started by main() function ---one level threading. like the below...
    public class  hello extends Thread
        public Process p ;
        public void run()
            try{
            String[] command =  new String[3];
            command[0] = "cmd";
            command[1] = "/C";
            command[2] = "C:\\plink.exe -v -N -L 33890:10.103.1.87:3389 -l graja 10.100.32.100 -i C:\\putty_private.ppk ";
            p = Runtime.getRuntime().exec(command);      
            }catch(Exception e)
                e.printStackTrace();
       public static void main(String[] args) throws Exception
           hello h = new hello();
           h.start();
           Third , i tried with putting this code in a thread which creates another thread which creates this process.
    But problem was not solved
    Can anybody please help me in this?
    Thanks,
    Raj
    Edited by: raj143shi on May 26, 2008 11:39 PM

    Need not to use thread for this.
    Once you execute the command..job is done at that time only.
    Check the example below
    1. While the main thread is sleeping your output file (a.txt) is created in C:\
    import java.io.IOException;
    public class abc1 {
        public static void main(String[] args){
        String[] command =  new String[3];
                command[0] = "cmd";
                command[1] = "/C";
                command[2] = "DIR >> c:\\a.txt";
                try {
                 Process p = Runtime.getRuntime().exec(command);
        } catch (IOException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
        try {
         Thread.sleep(50000);
         System.out.println("Slept for 50 secs");
        } catch (InterruptedException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
    }

  • Monitor a process progress - JProgressBar

    Hello all,
    I have a method that runs a process:
    public Process EXECUTE(String command) {
              try {
         return Runtime.getRuntime().exec(command);
         catch(IOException ioe){
              return null;
    and a process that represents a call to this method:
    Process proc;
    proc = EXECUTE("notepad text.txt");
    proc.waitFor();
    I want to monitor in some way the progress of the process(i.e. when it is a large text file and it takes time to open) and at the same time the system must waitFor() it to complete before moving on to the following code.The final objective is to monitor this with a JProgressBar
    Any help is welcome
    Thanks in advance          

    This may help
    http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

  • Doubt on exec method from Process class

    i want to use exec method from Process class to run an external exe.
    now the problem is that Process is an abstract class and hence cant be instantiated.nor can i access exec method directly even though i import the required packages as its not static.how can i go about using exec() if thats the case.
    Also can i run a file like notepad.exe present in system32 by providing the path of notepad.exe as an arguement in exec

    i would be really grateful to you if you can write
    the syntax for me along eith the class.i tried it out
    and i got a lot of errors
    this is what i obbtained from the documentation
    "public Process exec(String command)
    throws IOException"
    l to comprehend is what that class Process is doing
    in the syntax.from the method its supposed to return
    Process class.can you explain it and the usage of
    exec too
    import java.lang.*;
    class abc
         Runtime ob1;
         ob1.exec("c:\\windows\\system32\\notepad.exe");
    //i am getting a compile time error for this code
    which cites that <identifier> required at line 6You need to put the exec call in a method or constructor. You can't just place code anywhere within a class.
    You should also cal Runtime.exec just as I told you. It's a static method.
    There are lots of examples if you google.
    Kaj

  • Creating native processes

    Hi,
    Runing SuSE Linux 8.0, java 1.4.0
    I'm trying to create a native shell (I/O dumped into a JTextArea) woith java, the problem is that once I have invoked bash, it somehow manages to work out that its not running in a real console and behaves as if my input was a script. I managed to get bash working properly with command line args, but now when I want to start other interpreters on top of it they too seem to detect they are not in a proper tty.
    Is there a way to make native processes behave as if they were run from, say, an xterm?
    my code follows:
    file tests/ConsoleOnSteroids.java
    /* File:    ConsoleOnSteroids.java
    * created: 10/07/03
    * author:  dsm
    package tests;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.PrintStream;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    *  Defines a console that handles a native process
    * @author    dsm
    public class ConsoleOnSteroids extends JFrame {
        private ThreadedStreamReader out;
        private ThreadedStreamReader err;
        private PrintStream inp;
        private String processName;
        private JTextArea jta;
        private IOControl ioc;
        private JScrollPane jsp;
         *  Constructor for the ConsoleOnSteroids object
         * @param  name         The name of the frame
         * @param  processName  The name of the process to execute (like /bin/bash in UN*X systems)
        public ConsoleOnSteroids(String name, String processName) {
            super(name);
            this.processName = processName;
            this.jsp = new JScrollPane();
            this.jta = new JTextArea();
            try {
                this.ioc = new IOControl(Runtime.getRuntime().exec(this.processName));
                this.out = new ThreadedStreamReader(this.ioc.getStdout(), this.jta,
                    this.processName + ":stdout");
                this.err = new ThreadedStreamReader(this.ioc.getStderr(), this.jta,
                    this.processName + ":stderr");
                this.inp = this.ioc.getStdin();
            } catch(IOException ioe) {
                System.err.println("The process " + this.processName
                     + "could not be started due to an IOException:");
                ioe.printStackTrace();
                System.exit(1);
            this.jta.setEditable(false);
            this.jsp.setViewportView(jta);
            this.addListeners();
            this.getContentPane().add(jsp);
            //this.pack();
            this.setSize(600, 500);
            this.setLocation(100, 100);
            this.setVisible(true);
            this.out.start();
            this.err.start();
            //this.inp.println("ps -A");
            //this.inp.flush();
         *  The main program for the ConsoleOnSteroids class
         * @param  args  The command line arguments
        public static void main(String[] args) {
            ConsoleOnSteroids cos  = new ConsoleOnSteroids("Bash", "/bin/bash --login --noediting -i");
         *  Adds necessary Listeners to the ConsoleOnSteroids object
        private void addListeners() {
            /* Window Listener... what happens when the window is closed */
            this.addWindowListener(
                new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent evt) {
                        System.exit(0);
            this.jta.addKeyListener(
                new java.awt.event.KeyAdapter() {
                    public void keyTyped(java.awt.event.KeyEvent evt) {
                        textBoxKeyTyped(evt);
         *  Handles the typing of stuff in the text area
         * @param  evt  Description of Parameter
        private void textBoxKeyTyped(java.awt.event.KeyEvent evt) {
            jta.append(new String(new char[]{evt.getKeyChar()}));
            inp.print(evt.getKeyChar());
            inp.flush();
         *  This private class takes a BufferedReader and a JEditorPane as parameters for the
         *  constructor, and every time a line is avaliable on the reader, it appends it to the pane.
         * @author    dsm
        private class ThreadedStreamReader extends Thread {
            private BufferedReader reader;
            private JTextArea pane;
             *  Constructor for the ThreadedStreamReader object
             * @param  reader  The reader to take input from
             * @param  pane    The pane to dump the input in
             * @param  name    The name of the thread
            public ThreadedStreamReader(BufferedReader reader, JTextArea pane, String name) {
                this.reader = reader;
                this.pane = pane;
                this.setName(name);
             *  Main processing method for the ThreadedStreamReader object
            public void run() {
                while(ioc.isAlive()) {
                    try {
                        char c;
                        int i;
                        if((i = reader.read()) != -1) {
                            c = (char) i;
                            pane.append("" + c);
                    } catch(IOException ioe) {
                        System.err.println("Cannot read from " + this.getName() +
                            " because of an IOException:");
                        ioe.printStackTrace();
                        System.exit(2);
                System.exit(0);
    }file tests/IOControl.java
    /* File:    IOControl.java
    * created: 10/07/03
    * author:  dsm
    package tests;
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.PrintStream;
    *  Controls the I/O for a process. When using the std[in|out|err] streams, they must all be put on
    *  different threads to avoid blocking!
    * @author    dsm
    public class IOControl extends Object {
        private Process process;
        private BufferedReader stdout;
        private BufferedReader stderr;
        private PrintStream stdin;
        private boolean alive;
         *  Constructor for the IOControl object
         * @param  process  The process to control I/O for
        public IOControl(Process process) {
            this.process = process;
            final Process p  = process;
            new Thread(
                new Runnable() {
                    public void run() {
                        alive = true;  // set the adequate flag for the process
                        try {
                            p.waitFor();  // wait for process to end interfacethis thread
                        } catch(InterruptedException ie) {
                            System.err.println("An error ocurred during the execution of the process");
                            ie.printStackTrace();
                        } finally {
                            alive = false;  // the process has ended
                }).start();
            this.stdin = new PrintStream(process.getOutputStream());
            this.stdout = new BufferedReader(new InputStreamReader(process.getInputStream()));
            this.stderr = new BufferedReader(new InputStreamReader(process.getErrorStream()));
         *  Gets the stdin attribute of the IOControl object
         * @return    The stdin value
        public PrintStream getStdin() {
            return this.stdin;
         *  Gets the stdout attribute of the IOControl object
         * @return    The stdout value
        public BufferedReader getStdout() {
            return this.stdout;
         *  Gets the stderr attribute of the IOControl object
         * @return    The stderr value
        public BufferedReader getStderr() {
            return this.stderr;
         *  Gets the process attribute of the IOControl object
         * @return    The process value
        public Process getProcess() {
            return this.process;
         *  Gets the alive attribute of the IOControl object
         * @return    The alive value
        public boolean isAlive() {
            return alive;
    }thanks,
    dave.

    anyone?

  • Process, help me, real java man

    i use following code to execute a command (exceptions are deleted):
    String s="java.exe MyClass";
    Runtime run=Runtime.getRuntime();
    Process pro=run.exec(s);
    simple enough, after the code has been executed, we see an interface (i.e. JFrame,if MyClass extends JFrame).
    my question is: if user closes MyClass by click close button, in my app, how to know MyClass is destroyed?
    very trick, any methods such as Process.waitFor() don't work in the case, because:
    1. object Process pro represnts java.exe (not MyClass)
    2. MyClass is a process created by java.exe
    thx

    hi i myself am not a guru but nothing wrong in trying
    in the app that i am working i can stop the process in-between
    that was possible because i was calling it through a thread
    the solution to the problem could be on exit check if the thread is alive() and then you know
    new JMenuitem("compile"):
    setActionCommand("Compile");
    addActionListener(new Compiler());
    public class compiler implements ActionListener{
    public void actionparformed(ActionEvent e){
    String para=e.getActionCommand();new Processer(para);
    class Processer implements Runnable{
    public processer(String sw){this.s=sw;}
    Thread d;
    boolean b;              
            public  void start()
                d=new Thread(threada.this);
                d.setPriority(Thread.MAX_PRIORITY-3);
                but.setVisible(true);
                b=true;
                d.start();
    public void run()
    System.gc();
    if(b==true)
      but.setText(" RUNNING "+ d);
      but.setToolTipText("CLICK IF YOU WANT TO STOP THE RUNNING THREAD ");
      but.addActionListener(
              new ActionListener()
                  public void actionPerformed(ActionEvent we)
                     try
                     p.destroy();//p is java.lang.Process
                     r.gc();//p is java.lang.Process
                     System.gc();//p is java.lang.Process
                     b=false;
                    }catch(Exception ae )
                     {System.out.println(ae);}
                                  try{
                                     if (s=="Compile")
                                       new compile();
    public void stop()
       try{
       but.setText(" T Stopped .);
       but.setToolTipText("CLICK IF YOU WANT TO STOP THE RUNNING THREAD   |-> "+Thread.currentThread()+"  STOPPED");
                    System.gc();
                    d=null;
                             }catch(Exception ){}so to all given logic if you could directly dispose the active threads or nullify them it could work or
    let us say if the thread is alive then we can show a confirm popup asking if they want the process to end or not
    of course u have to handle it in WindowClosingEvvent before your System.exit(0);

  • Pass a COM object across processes

    Hi,
    I need to pass a COM object from process A to B.  I didn't find a good code example for IMoniker.  So I am trying to test a simpler solution.  Please refer to the following snippet of code.  There is a problem.  When the execution
    reaches GetActiveObject in B, the system hangs.  "HRESULT h" in several places returns S_OK.   Does anybody have a clue?  Please help me out.  Thanks for your help in advance.
    // the definition of the COM object
    EXTERN_C const IID IID_IUniverse;
    #if defined(__cplusplus) && !defined(CINTERFACE)
        MIDL_INTERFACE("91CAF3F6-BD4D-4DDC-9C35-59F5DB20D570")
        IUniverse : public IDispatch
        public:
    // PROCESS A:
    HRESULT h = RegisterActiveObject (cwApp, IID_IUniverse, ACTIVEOBJECT_STRONG , &dwRegister);
    // PROCESS B:
    HRESULT h = CoInitialize(NULL);
    IUniverse *p = NULL;
    HRESULT h = GetActiveObject(IID_IUniverse, NULL, (IUnknown**)&p);
    if (p)
      CComPtr<IUniverse> cwApp(p);
    JD

    On 1/27/2015 7:43 PM, jdyng77 wrote:
    I did some research on this issue to help me better understand your comments here.  I still don't fully understand the problem.  Please help me out.  Or, if I can get around the problem by using IMoniker and IRunningObjectTable instead,
    I would be more than happy doing that.
    Unlikely. If, as I suspect, the problem is that the server thread blocks, then the client won't be able to obtain the interface pointer from it by any means. Any IPC mechanism you might want to use kind of assumes that both parties remain responsive.
    WaitForSingleObject() is the opposite of "responsive".
    The third party (3rd pty) provides a COM interface.  I write a COM server A
    In-process (a DLL) or out-of-process (an EXE)? From your description, I would assume in-proc.
    that has an implementation for this interface.  I believe the 3rd pty must have called CoInitialize(NULL) before it instantiates object A.
    It must have, yes. This is only significant if A is an in-proc server.
    The 3rd pty passes a COM object of IUniverse to A.  I can call IUniverse's methods in A without any problem.  The need here is to transfer the IUniverse object to another process B so that B can call IUniverse's methods.  The problem
    is that B hangs.
    My guess is, B hangs because A hangs. In one of your responses, you suggest that you are calling WaitForSingleObject (waiting on process B's handle, I presume). In so doing, you have created a deadlock. B is trying to communicate with A to retrieve the
    interface pointer, but A is waiting for B to exit.
    After A registers IUniverse pointer (whether in ROT or as active object), it should return to the caller. Said caller likely spins a message pump - but by blocking and not returning, you don't allow it to run.
    The thread where A sits is created in the 3rd pty.  If I understand you correctly, the 3rd pty must "retrieve and dispatch window messages in a timely manner".  I think it does because it calls A when a window button is clicked.
    3rd pty would, if only A would let it. By sitting in the message handler, A prevents the caller from retrieving messages in a timely manner.
    But I don't know whether I should use Class, File or Item IMoniker.
    Item moniker is the easiest to use by far. It just wraps a piece of text. You create one with CreateItemMoniker: pass L"!" (by convention) in the first parameter, and arbitrary string in the second. Both parties (one that registers in ROT, and
    one that picks up) should agree on and use the same string, of course.
    Igor Tandetnik

  • Delete files from folder

    first of all please forgive me as I am new to the Java language... I have spent quite a lot of time with VB and now would like to learn Java. I've only completed a few very easy programs and read one book cover to cover. I really seem to do much better once I get my feet wet and complete a few programs...
    okay, here is what I'm trying to do:
    delete all files (not folders) in this directory:
    "c:\testing\"
    there are numerous folders within this directory. I don't want to delete the folders, just the .bmp files...
    I started with something like this, but I need some serious direction on how to go about this. I realize, my wildcard * is not valid. I think the basic delete command is correct, but I need help on how to use a wildcard as bellow (all folders within this directory and only files with the .bmp extension)...
    File f = new File("c:\testing\*\*.bmp");
    f.delete();
    Thanks very much for any help provided!

    You will need to use the Runtime Class where you can make a Op Sys call:
    exec
    public Process exec(String command)
    throws IOException
    Executes the specified string command in a separate process.
    The command argument is parsed into tokens and then executed as a command in a separate process. The token parsing is done by a StringTokenizer created by the call:
    new StringTokenizer(command)
    with no further modifications of the character categories. This method has exactly the same effect as exec(command, null).
    Parameters:
    command - a specified system command.
    Returns:
    a Process object for managing the subprocess.
    Throws:
    SecurityException - if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
    IOException - if an I/O error occurs
    ex:
    String strFullCommand = "delete c:\*.foo";
    Runtime rt = Runtime.getRuntime();
         try
         child = rt.exec(strFullCommand);
         catch(IOException e)
         System.err.println( "IOException starting process!");

  • Need help in using Runtime class

    Hi all,
    I am facing problem with JRE versions of websphere and SUN JRE. Let me explain my problem.
    We have an application working fine in websphere, Now my organization wants to migrate this app to websphere. This application downloads some set of jar files to the client side when the user hits the server with some url. These jar files starts th swing based application in the client side , at the same it will try to communicate with EJB's deployed in the server(Now websphere) to get the data for menus and trees in the swing application. Because of different JRE in the websphere commucation problems like class cast exception are happening. Now we are downloading the the Websphere JRE to the client side and trying to start the application with the downloaded JRE(Even it is not required in case of weblogic in the exiting application also they are downloading the sun JRE). Here the problem starts for me. The execute method of Process class is not able to detect the main class. The waitFor method is returning non zero value. Here is my method.
    Can anybody guess what's wrong going on with this code.
    public Process spawnProcess(String szSpawnCommand) throws
    Exception
              szSpawnCommand = "C:\\ccc\\JRE\\bin\\javaw.exe com.att.suite.client.SuiteAppManager";
              System.out.println("starting processs "+szSpawnCommand);
    Process oProcess = null;
    try
    // oProcess = Runtime.getRuntime().exec(szSpawnCommand);
         Runtime rt = Runtime.getRuntime();
         System.out.println("Got runtime.....");
         oProcess = rt.exec("c:/ccc/JRE/bin/java com.att.suite.client.SuiteAppManager");
         //oProcess.waitFor();
    //oProcess = rt.exec("c:/ccc/JRE/bin/javaw -version");
    catch (Exception ex)
    // Throw an exception with the reason why the process
    // couldn't be spawned
    // The original message here confused end users - almost always
    // occurs due to lack of memory and we cannot determine actual
    // reason OS failed to spawn a process.
    // Changed to correct LCR MR#: 437
    // throw new Exception("Unable to spawn process with command: \"" +
    // szSpawnCommand + "\".\nSystem Reason: " + ex.getMessage());
    /*throw new Exception("You have insufficient memory to " +
    "launch this program. \nPlease quit some other " +
    "applications and try again.");*/
         System.out.println("In oProcess.... ");
    ex.printStackTrace();
    // Wait for a second to give the new process a chance
    // to run properly
    try
    Thread.sleep(1000);
    catch (Exception ex)
    final DataInputStream oProcStdOutStream = new DataInputStream(
    oProcess.getInputStream());
    final DataInputStream oProcStdErrStream = new DataInputStream(
    oProcess.getErrorStream());
    Thread oProcStdOutStreamThread = new Thread()
    public void run()
    try
    String szLine = null;
    while ((szLine = oProcStdOutStream.readLine()) != null)
    System.out.println("[FromProc1] " + szLine);
    catch (Exception ex)
         System.out.println("In oProcStdOutStream");
    ex.printStackTrace();
    oProcStdOutStreamThread.start();
    Thread oProcStdErrStreamThread = new Thread()
    public void run()
    try
    String szLine;
    while ((szLine = oProcStdErrStream.readLine()) != null)
    System.out.println("[FromProc2] " + szLine);
    catch (Exception ex)
    ex.printStackTrace();
    oProcStdErrStreamThread.start();
    // See if the process is still running properly
    int nProcessExitValue = 0;
    try
    nProcessExitValue = oProcess.exitValue();
         // nProcessExitValue = oProcess.waitFor();
         System.out.println("nProcessExitValue : "+nProcessExitValue);
    catch (Exception ex)
    // This means that the process is still running which
    // we'll consider a good sign.
    nProcessExitValue = 0;
    System.out.println("In nProcessExitValue");
    ex.printStackTrace();
    // Check the process exit value
    if (nProcessExitValue != 0)
    // Throw an exception with the return value of the spawned
    // process.
    // The original message here confused end users - almost always
    // occurs due to lack of memory and we cannot determine actual
    // reason OS failed to spawn a process.
    // Changed to correct LCR MR#: 437
    // throw new Exception("Unable to spawn process with command: \"" +
    // szSpawnCommand + "\".\nProcess Exit Value: " +
    // nProcessExitValue);
    throw new Exception("You have insufficient memory to " +
    "launch this program. \nPlease quit some other " +
    "applications and try again.");
         //System.out.println("In nProcessExitValue!=0");
    Here is the error :
    starting processs C:\ccc\JRE\bin\javaw.exe com.att.suite.client.SuiteAppManager
    Class loaded...
    Got runtime.....
    nProcessExitValue : 1
    [FromProc2] The java class is not found: com/att/launch/jre/Sample
    java.lang.Exception: You have insufficient memory to launch this program.
    Please quit some other applications and try again.
         at com.att.launch.jre.LaunchApp.spawnProcess(LaunchApp.java:525)
         at com.att.launch.jre.LaunchApp.spawnCJAS(LaunchApp.java:366)
         at com.att.launch.jre.LaunchApp.main(LaunchApp.java:171)
    Please help me, I am struggling with this problem from the long time. Or can any body suggest different way to solve this problem instead of downloading the JRE to the client side.
    Bhaskar

    Hi ,
    I am facing problem with JRE versions of websphere and SUN JRE. Let me explain my problem.
    We have an application working fine in websphere, Now my organization wants to migrate this app to websphere. This application downloads some set of jar files to the client side when the user hits the server with some url. These jar files starts th swing based application in the client side , at the same it will try to communicate with EJB's deployed in the server(Now websphere) to get the data for menus and trees in the swing application. Because of different JRE in the websphere commucation problems like class cast exception are happening.
         Now we are downloading the the Websphere JRE to the client side and trying to start the application with the downloaded JRE(Even it is not required in case of weblogic in the exiting application also they are downloading the sun JRE).
    Here the problem starts for me. The execute method of Process class is not able to detect the main class. The waitFor method is returning non zero value. Here is my method.
    Can anybody guess what's wrong going on with this code
    public Process spawnProcess(String szSpawnCommand) throws
    Exception
              System.out.println("starting processs "+szSpawnCommand);
    Process oProcess = null;
    try
         Runtime rt = Runtime.getRuntime();
         System.out.println("Got runtime.....");
         oProcess = rt.exec("c:/ccc/JRE/bin/java com.att.suite.client.SuiteAppManager");
    catch (Exception ex)
    throw new Exception("You have insufficient memory to " +
    "launch this program. \nPlease quit some other " +
    "applications and try again.");      
    // Wait for a second to give the new process a chance
    // to run properly
    try
    Thread.sleep(1000);
    catch (Exception ex)
    final DataInputStream oProcStdOutStream = new DataInputStream(oProcess.getInputStream());
    final DataInputStream oProcStdErrStream = new DataInputStream(oProcess.getErrorStream());
    Thread oProcStdOutStreamThread = new Thread()
    public void run()
    try
    String szLine = null;
    while ((szLine = oProcStdOutStream.readLine()) != null)
    System.out.println("[FromProc1] " + szLine);
    catch (Exception ex)
         System.out.println("In oProcStdOutStream");
    ex.printStackTrace();
    oProcStdOutStreamThread.start();
    Thread oProcStdErrStreamThread = new Thread()
    public void run()
    try
    String szLine;
    while ((szLine = oProcStdErrStream.readLine()) != null)
    System.out.println("[FromProc2] " + szLine);
    catch (Exception ex)
    ex.printStackTrace();
    oProcStdErrStreamThread.start();
    // See if the process is still running properly
    int nProcessExitValue = 0;
    try
    nProcessExitValue = oProcess.exitValue();
         // nProcessExitValue = oProcess.waitFor();
         System.out.println("nProcessExitValue : "+nProcessExitValue);
    catch (Exception ex)
    // This means that the process is still running which
    // we'll consider a good sign.
    nProcessExitValue = 0;
    System.out.println("In nProcessExitValue");
    ex.printStackTrace();
    // Check the process exit value
    if (nProcessExitValue != 0)
    throw new Exception("You have insufficient memory to " +
    "launch this program. \nPlease quit some other " +
    "applications and try again.");
    Here is the error :
    starting processs C:\ccc\JRE\bin\javaw.exe com.att.suite.client.SuiteAppManager
    Class loaded...
    Got runtime.....
    nProcessExitValue : 1
    [FromProc2] The java class is not found: com/att/launch/jre/Sample
    java.lang.Exception: You have insufficient memory to launch this program.
    Please quit some other applications and try again.
         at com.att.launch.jre.LaunchApp.spawnProcess(LaunchApp.java:525)
         at com.att.launch.jre.LaunchApp.spawnCJAS(LaunchApp.java:366)
         at com.att.launch.jre.LaunchApp.main(LaunchApp.java:171)
    Please help me, I am struggling with this problem from the long time. Or can any body suggest different way to solve this
    problem instead of downloading the JRE to the client side.
    Bhaskar

  • Useful Document/resources For Begginners

    this document is easily on net
    WS-BPEL Guide
    Last changed on Dec 10, 2004 by Matthieu Riou
    What is this article about ?
    This is an introduction to WS-BPEL that should give you a practical understanding of what you have to do to create a nice WS-BPEL process, dwelling on most important details. After reading this article you probably won't be able to write a WS-BPEL process from top to bottom. But you should have a pretty good notion of what can be done with it, what it involves and be familiar with the main elements of the grammar.
    First things first, here are the answers to the most trivial questions:
    •     What this new and unique acronym means? Web Services Business Process Execution Language.
    •     What is WS-BPEL? It's an XML grammar (a W3C schema) defining and standardizing structures necessary for web services orchestration.
    •     What does WS-BPEL? Well, actually nothing as it's just a grammar. But a WS-BPEL engine can do many things when executing your process. Like reacting to message reception, manipulating the message data, sending messages to web services and evaluating expressions.
    •     Where does it come from? It has been written by IBM, BEA Systems and Microsoft. Siebel and SAP joined these three and the specification has bee donated to OASIS.
    •     Where does WS-BPEL fit? It's a very good candidate to add an orchestration layer to a Service Oriented Architecture. It will make your services collaborate nicely and will encapsulate the cross-service business logic. It will also help you to introduce long-living transactions.
    Now that the introductory questions have been answered and before going any further I would like to clarify one thing about WSDL (I voluntarily wrote WSDL here, it's not a weird typo). WS-BPEL heavily relies on WSDL to describe the web services it is interacting with (we will see that soon) but that doesn't mean that it can only interact with services using XML(SOAP)/HTTP. WSDL introduces bindings which are the declaration of your services underlying communication medium. Bindings can be declared for local Java, JMS, RMI or anything you like (you might want to check Apache WSIF ). So a WS-BPEL engine using the right bindings could very well invoke many different services.
    So let's see how we are going to take a look at WS-BPEL. First, I'm going to give a very simple and classic example, just to give you a taste of what can be done with WS-BPEL. Then I'll introduce briefly its main activities. We'll see how to handle your process data and manipulate it and also how a particular process execution can be identified among all others. Finally we'll talk about how WS-BPEL introduces long-living transactions.
    A very simple yet demonstrative example
    After reading this chapter, most of you will probably think that the example I'm going to use is too simple and not realistic. I agree. But my goal here is just to give you a flavor of how WS-BPEL can be used, a realistic example would take more than all this article by itself.
    Now, you are the owner of a small bank granting loans to some of your customers. You have sales offices creating new customer contracts. You also have a web site and customers can directly ask for a loan online for small amounts. But before accepting a contract, some verifications are necessary. Those verifications are done using a risk assessment system maintained by a third party and by an in-house system that files the most tough requests. Loan specialists are part of your staff and then use this in-house system to take the final decision.
    So here is, step by step, the process that must be followed:
    1.     A loan request is issued, either from your web site of from one of your agencies. This request is made for a customer and for a certain amount.
    2.     A risk assessment system must be contacted to check whether the risk associated with the customer asking for the loan is high or low (probably based on his credit history).
    1.     If the loan amount is lower than $10,000 and the risk associated to the customer is low, the loan is directly approved (which saves time).
    2.     Otherwise, the loan request must be filed in your in-house system.
    1.     A loan specialist checks the request and gives his final decision.
    2.     The in-house system let you know the specialist's decision.
    3.     The response is sent to the customer.
    So how those pieces would be implemented in a "WS-BPEL aware" architecture? Here we go:
    •     One message triggered by your web site or your sales system and targeted at your process web service. It would hold at least the customer's name and the loan amount.
    •     One message triggered by the WS-BPEL engine to the risk assessment system to ask for the risk associated with the customer. If you pay your bills correctly, an answer message from this message should be expected.
    •     If needed, one message from the WS-BPEL engine to your in-house system to fill the loan request.
    •     One message from your in-house system to the process web service to give it the loan specialist's answer.
    •     Finally, one message back to your web site or to your sales system to give the final answer.
    One thing some of you probably already noticed is that when talking about the process I mentioned the "process web service". That's right, every process created inside a WS-BPEL engine is published as a web service with its own endpoint. When you want to send a message to your process, you actually send it to this web service.
    So now that you have a better idea of what it would take to implement this process in WS-BPEL, it's time to step back a bit.
    Private vs. Public Processes
    It's quite important to differentiate private and public processes (they are called executable and abstract in WS-BPEL). It is the same kind of opposition as between orchestration and choreography and it has a great impact on your architecture.
    Private processes manage services inside a given organization. They act as a service themselves and are centralized. As in an orchestra, there is a chief conductor (the process engine). Public processes manage services across several organizations. Each organization knows about it's own part of the process but doesn't know anything about the activities executed by other parties (for obvious confidentiality reasons). It's a peer-to-peer approach where you know the incoming and the outgoing messages, but nothing about what is done before, after or even meanwhile.
    WS-BPEL is quite good to handle private processes but doesn't perform so well for public ones (don't shoot me!). I have a feeling that even the members of the Oasis committee working on WS-BPEL don't know too much what to do with those. But actually, service choreography (public services) is not completely mature yet in terms of standards and market acceptance where as orchestration already has a widely embraced specification (WS-BPEL, in case you didn't realize) and many commercial implementations as well as open source ones (you may want to check Twister ). So good news, what you are going to learn in this article might prove useful.
    After those high-level considerations, we'll now look into WS-BPEL guts to see what's there and what we could use to build our process.
    WS-BPEL Activities
    In WS-BPEL, everything being part of your process body is an activity. There are basic activities (the ones that do something) and structured activities (the ones that organize basic activities without doing anything by themselves, just like your boss).
    Basic activities
    Invoking a web service is as simple as that:
    <invoke partnerLink="riskAssessor" portType="assessor" operation="assess"/>
    Pretty simple isn't it? In our initial example this declaration would be used to invoke the risk assessment system. Well, I'm actually cheating, you'll see later that you usually need a bit more (like input and output data) but this is a valid invocation.
    To wait for an incoming message, you'll write:
    <receive partnerLink="inhouseSystem" portType="inhousePort" operation="registerLoanRequest"/>
    That would be used to wait for the loan specialists' answer after registering the loan request in your in-house system. Now let's say that you want to send an immediate synchronous answer to this "receive". You'd write, after the receive:
    <reply partnerLink="inhouseSystem" portType="inhousePort" operation="registerLoanRequest"/>
    But how exactly does a WS-BPEL engine know, upon reception of a message, if it has to trigger the creation of a new process execution (a process instance)? Well, there's an attribute just for that: "createInstance".
    <receive partnerLink="loanRequester" portType="loanProcess" operation="processLoanRequest" createInstance="true"/>
    These 3 declarations use common attributes: partnerLink, portType and operation. If you know WSDL, you are already familiar with the port types and operations. Partner links have been introduced in WS-BPEL to model a two-way interaction between a process and a partner (a web service or another process). It lets you define the role of each of the two party in the interaction.
    There are two more basic activities that could prove useful (or at least one of the two):
    <wait until="'2002-12-24T18:00+01:00'"/>
    <empty/>
    Structured activities
    To start with, 3 basic ones: sequence, switch and while. If their behavior is not clear yet, here are examples:
    <sequence>
    <receive .../>
    <invoke .../>
    <invoke .../>
    </sequence>
    <switch xmlns:inventory="http://supply-chain.org/inventory" xmlns:FLT="http://example.com/faults">
    <case condition= "bpws:getVariableProperty(stockResult,level) > 100">
    … do something
    </case>
    <case condition="bpws:getVariableProperty(stockResult,level) >= 0">
    … do something else
    </case>
    <otherwise>
    … do the last thing
    </otherwise>
    </switch>
    <while condition="10 < bpws:getVariableData('loopVar', 'main', '/counter')">
    <assign>
    <copy>
    <from expression="bpws:getVariableData('loopVar', 'main', '/counter') + 1"/>
    <to variable="loopVar" part="main" query="/counter"/>
    </copy>
    </assign>
    </while>
    Another structured activity is 'pick'. It's just like several receive activities waiting at the same time with an additional alarm construct to avoid waiting forever the occurrence of a message:
    <pick>
    <onMessage partnerLink="" portType="" operation="">
    … do something
    </onMessage>
    <onMessage partnerLink="" portType="" operation="">
    … do something else
    </onMessage>
    <onAlarm until="2004-12-31T23:59:00">
    … hey, what the hell are you waiting for?
    </onAlarm>
    <pick>
    Like the receive activity, it's possible to declare a 'createInstance' attribute on the pick element to trigger the creation of a new process instance.
    Finally, for those who found all those activities way too structured and were missing a bit of anarchy, WS-BPEL introduced a flow activity. You basically declare all your activities as you like and then create links that take those activities as origin and target. The flow is also the only way to enable the execution of several parallel branches.
    Process Data
    To handle the process execution data, WS-BPEL introduces a new and unique concept: variables… Ok, that was just a bad attempt to keep you interested. Here is the context: your process engine must receive and send messages as defined by web services WSDL descriptions. To be able to do anything useful it must retain those messages and let you manipulate their content to create new messages or influence the process flow in variables. Therefore variables hold the state of a process execution. WS-BPEL variables can either hold a WSDL message or an arbitrary XML structure defined by a schema.
    An example for the declaration of a variable that can hold a WSDL message (the first stanza comes from the WSDL description, the second is a part of the process definition):
    <message name="creditInformationMessage">
    <part name="firstName" type="xsd:string"/>
    <part name="lastName" type="xsd:string"/>
    <part name="amount" type="xsd:integer"/>
    </message>
    <variable name="requestLoan" messageType="creditInformationMessage"/>
    So now, how do I stuff an incoming message into this variable? Here is the stuffing:
    <receive partnerLink="loanRequester" portType="loanProcess" operation="processLoanRequest" variable="requestLoan"/>
    Hey hey! That's our old receive! A variable attribute can be specified for a receive to hold the incoming message. For a reply, there's also a variable attribute to give the content of the message to send. And for an invoke, there's an inputVariable attribute to give the variable to send and an outputVariable to hold the response (for a synchronous invocation).
    We have variables to hold our message and we know how to give them a value upon reception of a message. But how do you initialize a variable when you want to send a message using it? How do you build a variable using parts of other variables? The answer is assignment. There's an additional activity I didn't mention yet (yes, I'm holding information) named assign. It lets you "copy and paste" the whole content of a variable, only a WSDL part in a message or even just an element (using Xpath). Again, examples are better than idle words:
    <assign>
    <copy>
    <from variable="ob1"/>
    <to variable="knob"/>
    </copy>
    <copy>
    <from variable="userInfo" part="homeAddress"/>
    <to variable="address"/>
    </copy>
    <copy>
    <from variable="house" part="bathroom" query="/shower/soap"/>
    <to variable="cleaningAgent"/>
    </copy>
    <copy>
    <from>hey you</from>
    <to variable="song" part="title"/>
    </copy>
    </assign>
    Once your variable has been set correctly, you can simply use it as inputVariable for an invoke.
    There's still one mystery unsolved in the way you can use variables in WS-BPEL: referencing them in expressions. Let's say you have a variable holding a specific value and want to use this value in the condition of a switch case, how do we do that? By using two functions:
    bpws:getVariableProperty ('variableName', 'propertyName')
    bpws:getVariableData ('variableName', 'partName'?, 'locationPath'?)
    The first function accepts the name of your variable and a property (we'll introduce property later but right now you just need to know that a property is a named XPath expression). The second accepts your variable, an optional part and an optional XPath expression relative to the part root.
    It's now time to see your first complete WS-BPEL example. It triggers the execution of a process upon reception of a message and iterates over a value contained in the message until 10. It's a very stupid example and it's probably the last thing you want to do with WS-BPEL (just as a reminder, WS-BPEL is used to orchestrate web services, not iterate over a value) but it illustrates almost everything we talked about in this paragraph.
    <?xml version='1.0' encoding="UTF-8"?>
    <process name="loop"
    targetNamespace="http://www.smartcomps.org/twister/example/loop/process/"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:def="http://www.smartcomps.org/twister/examples/loop/service/"
    abstractProcess="no">
         <variables>
              <variable name="loopVar" type="loopVarType"/>
         </variables>
         <correlationSets>
              <correlationSet name="counterCorrel" properties="def:counterId"/>
         </correlationSets>
         <sequence>
              <receive partnerLink="loopPartner" portType="loopPort" operation="loopOp"
              variable="loopVar" createInstance="true">
                   <correlations>
                        <correlation set="counterCorrel" initiate="yes"/>
                   </correlations>
              </receive>
              <while condition="10 > bpws:getVariableData('loopVar', 'main', '/counter')">
                   <assign>
                        <copy>
                             <from expression="bpws:getVariableData('loopVar', 'main', '/counter') + 1"/>
                             <to variable="loopVar" part="main" query="/counter"/>
                        </copy>
                   </assign>
              </while>
         </sequence>
    </process>
    As you probably already realized, data manipulation can quickly become a bit verbose. The WS-BPEL Technical Committee is currently working on it to have something easier for WS-BPEL 2.0.
    Correlation
    Correlation is a notion that can be a bit hard to grasp at first but is very important. So hang on and I'll do my best to be even more clear (somehow) than usually. During its execution, a process has to interact with several different services. This interaction is stateless so there is no way to make sure you will be addressed to a particular instance of a service. So let's imagine you own a wine store and have a web site allowing users from all over the world to order cheap and very good French wine. A service provided by your bank does the billing for you and you also use a shipper to send the orders all over the world. When a user places an order online, your web site generates an order id. But your bank doesn't know anything about your order id, it creates its own billing id corresponding to your order and you always must use this billing id when interacting with your bank (to confirm the transaction just after shipment for example). The shipper also creates his own shipment id that will be used when he confirms that the order has been sent.
    You want to use a WS-BPEL engine to handle those tasks automatically and orchestrate all the services (there's probably much more than three services and many steps involved). That's a really good idea!!! But how do you deal with all these different ids ? Yep, you guessed it: correlation. How does it work? A correlation is an unique way to identify the interaction of your process execution with a given party. A correlation is a list of property elements and a property element is a named XPath expression. This XPath expression must select a value in the exchanged messages that will be the value of the correlation for this particular message. So for our previous example we would define the following elements:
    <property name="billId" type="xsd:string"/>
         <propertyAlias propertyName="billId" messageType="createBillMessage" part="billInfo" query="billId"/>
         <propertyAlias propertyName="billId" messageType="confirmTransactionMessage" part="billId"/>
         <property name="shipId" type="xsd:string"/>
         <propertyAlias propertyName="shipId" messageType="shipMessage" part="shipId"/>
         <correlationSets>
              <correlationSet name="bankCorrelation" properties="billId"/>
              <correlationSet name="shipperCorrelation" properties="shipId"/>
         </correlationSets>
    A correlation can be composed of more than one property (separated by spaces). A property can also have several aliases for each type of message the correlation is used for.
    Usually a correlation is declared for each actor your process has to communicate with. The correlation is initiated during the first message exchange between your process execution and a party and is reused anytime your process execution sends a message to this party.
    Compensation
    I'm not going to detail this chapter as much as I did for the previous ones. This article is already far too long (and therefore too boring). Talking about compensation in a detailed manner would require another article like this one. But to whet your appetite, I'll tell you what its is and what it is the problem it has been designed to solve.
    Compensation is related to error handling. WS-BPEL processes are usually long-lasting (there could be days between 2 activities), they use asynchronous messages and interact with several different services. Introducing the concept of ACID transactions in this context is quite tough. Each of the services involved can locally use its own transaction but it's impossible within your process to control them (and you probably don't want to). So what can you do if you have three asynchronous operations, like 3 invoke / receive couples, that must be executed in an "all or nothing" fashion? How to cancel the two first operations that have already been committed if the third fails?
    Compensation is basically a set of activities attempting to cancel operations that have already been completed inside an unit of work. If an activity fails or a fault is thrown inside this unit of work, this set of activities is supposed to roll back everything that has been already completed in the unit of work in a way specific to your business case. You are the only one who really knows what to do if something goes wrong so you have to provide the necessary operations.
    But this system has important drawbacks:
    •     It is your responsibility to execute the right activities to handle the cancellation.
    •     All the services you are interacting with must support a way to rollback a previously committed transaction (most probably requiring some hard coding).
    Conclusion
    WS-BPEL has been a bit criticized principally for its absence of human participant interaction (as in conventional workflows), everything is a service. But whether you like it or not, it's already standard and if you use it for what it is good at, a pretty good one. Besides it's a good step in the right direction to standardize the BPM - SOA - 'call it what you like' space. And you can always rely on good products like Twister to introduce Worklist functionalities (remember, always a bit of marketing in a conclusion).
    Resources
    WS-BPEL Specification: http://www-106.ibm.com/developerworks/library/ws-bpel/
    Oasis WS-BPEL Technical committee: http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsbpel
    Twister WS-BPEL Open Source Implementation: http://www.smartcomps.org/twister

    Where can I get a document like this for the IQ775? I have asked HP several times, but get no response. I just want to know how to open the damned thing!

  • How can I get the container of a button after the button is clicked?

    I have two components:
    public class A extends JPanel implements ActionListener {
        public A() {
        public void actionPerformed(ActionEvent e) {
            String command = e.getActionCommand();
            // here need to know the instance of B to execute it's process()
            // but I can only know the button jb in B via the following code:
            JButton myjb = (JButton)(e.getSource());
    public class B extends JPanel {
        public ContainerInfoInput(ActionListener al) {
            JButton jb = new JButton("OK");
            jb.setActionCommand("B.ok");
            jb.addActionListener(al);
        public process() {
    public class Main {
        A a = new A();
        B b = new B(a);
    }How can I get the instance of B in which the button is clicked?
    Thank you

    I think it's a defect of the listener mechanism. Under the present circumstance, I must do it like the following:
    I must use another class M as a bridge:
    class A {
        public A() { }   
        public processA (String info ){}
    class B{
        public B(ActionListener al) {       
            JButton jb = new JButton("OK");       
            jb.setActionCommand("B.ok");      
            jb.addActionListener(al);  
       public String processB () {    }
    class M implements ActionListener  {
        public M() {
            A a = new A();
            B b = new B(this);
        public void actionPerformed(ActionEvent e) {
            String command = e.getActionCommand();
            if(command.equals("B.ok")) {
                String information =b.processB();
                a.processA(information);
    }Why not just use A to listen B and obtain instance of B through the ActionEvent?
    Anyone know a solution about it?

  • Parameter  to shell script using Runtime.exec(string)

    Hi all, ( Speciall hi to dheeraj tak )
    Briefly : How do i pass an arguement to a non - java executible being called using Runtime.exec.
    In detail : i am using Runtime.exec to call a shell script : The code is as follows:
    String callAndArgs[] = {"/home/tom/jakarta-tomcat-4.1.24/webapps/dash/script.sh"};
    try {
    Runtime rt = Runtime.getRuntime();
    Process child = rt.exec(callAndArgs);
    This works properly & calls the shell script which in turn invokes some other executible (c file).
    $HOME/midi/test/build/bin/<C-EXECUTIBLE>
    Here i am specifying the name (say hello.exe ) . So far so good.
    I want to make this happen dynamiclaly. so i need to pass the name of the executible as a parameter to the script.
    To pass a parameter i hav to change the string to :-
    String callAndArgs[] = {"/home/tom/jakarta-tomcat-4.1.24/webapps/dash/script.sh <C-EXECUTIBLE HERE>"};
    and the script to
    $HOME/midi/test/build/bin/$1 --- where $1 refers to argument 1. (C-EXECUTIBLE AGAIN).
    This is giving an IO - Execption. Plz help
    Code will be very helpful.
    Thanx in advance

    some 1 plz tell me the difference :-
    This is the documentation of Runtime.exec that i found :-
    1> exec
    public Process exec(String command) throws IOException
    Executes the specified string command in a separate process.
    The command argument is parsed into tokens and then executed as a command in a separate process. This method has exactly the same effect as exec(command, null).
    Parameters:
    command - a specified system command
    Complete refernce says : Process (String progName) ----- Executes a program specified by programname as a seperate process.
    2> exec
    public Process exec(String cmdarray[]) throws IOException
    Executes the specified command and arguments in a separate process.
    The command specified by the tokens in cmdarray is executed as a command in a separate process. This has exactly the same effect as exec(cmdarray, null).
    Parameters:
    cmdarray - array containing the command to call and its arguments.
    Complete reference says : Process exec(String comLineArray[]) ---- Executes the command line specified bythe string in comLineArray as a seperate process.
    This means that there is provision 4 command line arguments...
    how do u use it then????????????????????????????

  • Control browser properties from a java application while launching a browse

    How to control the properties of a browser when it is launched from a java application?
    I am using the command " Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+url); " to launch the browser. The syntax of "exec" command is "public Process exec(String command,String[] envp) throws IOException". I would like to know whether we can give the arguments in this command to control the browser properties.
    If you know any other option by which we can open a URL in a controlled browser, please share it.
    Thanks in advance :).
    Surekha_Venugopal

    Hi All,
    I have found a solution to control browser parameters from Java applications.
    1. Create an intermediate HTML file at runtime which contains Javascript to launch a browser. Pass the parameters like the URL and browser control parameters to the Javascript of this HTML file.
    2. Open this HTML file and invoke the javascript while loading the file. Javascript will launch the required URL in a controlled browser.
    3. Close the intermediate HTML file.
    Limitation:
    1. There will be a flickering of windows.
    2. Applets will have permission issues with the above solution. For applets a better solution is JSobject. No need of an intermediate file here.
    Hope this will be useful for someone. :-)
    Cheers,
    Surekha_Venugopal

  • Checking for cycles

    I would think that this is a pretty straightforward task however I'm running into some difficulties. Basically I'm given a bunch of "processes" and which can be exectuted in parallel provided they aren't dependent on another processes finishing first. I have to calculate the amount of time needed for all processes to be finished.
    So for example, given this:
    int[] time = {150, 200, 250};
              String[] prec = {"NYN", "NNY", "NNN"};This means, Process 0 takes 150ms, 1 takes 200ms, and 2 takes 250ms.
    Process 0 depends on process 1 to finish, Process 1 waits for process 2, and process 2 has no dependencies. So the total time is 600. My code works however for large cases I seem to have trouble checking for cycles even though I think my code to check for cycles works (a cycle example being if process 2 depended on process 0 as well).
    import java.util.*;
    public class ParallelProgramming
         public int minTime(int[] time, String[] prec)
              //Go through list of processes and calculate the time
              for(Process p:pList)
                   current = p;
                   if(!p.visited)
                        check = calcTime(p);
                   else check = p.time; //don't waste time going through processes I've already seen
                   totalTime=Math.max(totalTime,check);
                   if(flag)
                        return -1;
              return totalTime;
         public int calcTime(Process p)
              p.visited = true;
              if(p.parallel)//no dependencies
                   return p.time;
              else
                   int t = p.time;
                   int maxTime = 0;
                   for(Integer i:p.deps)//deps is list of processes that this process depends on
                        Process next = pList.get(i);
                        int check = 0;
                        if(next.visited)
                             check=next.time;
                        else check = calcTime(next);
                        if(next != current)//checks for a cycle
                             maxTime = Math.max(maxTime, check);
                        else flag = true;
                   t+=maxTime;
                   p.time = t;
                   return (t);
         }

    Sure, sorry this is going to take up quite a bit of space:
    Attempt 1:
    import java.util.*;
    public class ParallelProgramming
         ArrayList<Process> pList = new ArrayList<Process>();
         int totalTime = 0;
         Process current;
         boolean flag = false;
         public int minTime(int[] time, String[] prec)
              //Create a list of processes and link up their dependencies
              for(int i=0;i<time.length;i++)
                   Process p = new Process(prec,time[i],i);
                   for(int c=0;c<prec[i].length();c++)
                        if(prec[i].charAt(c)=='Y')
                             p.parallel=false;
                             p.deps.add(c);
                   pList.add(p);
              //Go through list of processes and calculate the time
              for(Process p:pList)
                   current = p;
                   int check = 0;
                   if(!p.visited)
                        check = calcTime(p);
                   else check = p.time;
                   if(flag)
                        return -1;
                   totalTime=Math.max(totalTime,check);
              return totalTime;
         public int calcTime(Process p)
              p.visited = true;
              if(p.parallel)
                   return p.time;
              else
                   int t = p.time;
                   int maxTime = 0;
                   for(Integer i:p.deps)//get each dependent process
                        Process next = pList.get(i);
                        int check = 0;
                        if(next.visited)
                             check=next.time;
                        else check = calcTime(next);
                        if(next != current)
                             maxTime = Math.max(maxTime, check);
                        else flag = true;
                   t+=maxTime;
                   p.time = t;
                   return (t);
         class Process //contains schedule,time for this process, and what number process it is
              int time;
              String sch;
              boolean parallel = true;
              boolean visited = false;
              Integer num;
              ArrayList<Integer> deps = new ArrayList<Integer>();
              public Process(String s,int t,int n)
                   sch = s;
                   time = t;
                   num = n;
              public boolean equals(Object o)
                   return num==((Process)o).num;
    Fails for this set of data (doesn't report a cycle):time is [299, 986, 91, 28, 462, 70, 805, 234, 730, 746, 3, 276, 999, 35, 982, 7, 632, 915, 82, 945, 55, 639, 988, 147, 702, 552, 739, 908, 833, 85, 904, 443, 47, 828, 159, 10, 260, 998, 242, 213, 990, 817, 839, 96, 995, 59 ]
    prec is ["NYNNYYNNNYYNNYNYNNYNYNNYNYNNYNNYYNNYNYNYNYYNYY", "NNNNNYNNNNNNNNNNNNYNNNNNNYNNNNNNNNNNNNNYNYYNNN", "NNNYYYNYNYYYNYYYNNYNYNNNYYYYYYNYYNYYYYNYNYYYNY", "NYNNNYNNYYYNYYYYNNNNYNYYNNNNYNYYYNYYYYNYNYYYNN", "NYNNNYNNNNNNNYNNNNNNNNNYNNNNNNNNNNNYNYNYNNYNNN", "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", "YNYYYYNYNYNNYYYYYYYNYNYYYYYNYYNYYNYYYYYYYYYNNY", "NYNNYYNNYYYYYYYNNNNNYNYYNYYNYNYYYYYYYYNYNNYNNY", "YYNNYNNNNNYNNYNYNNNNNNYYNYNNYNNYYNNNNNNNNYNNYY", "NYNNYYNNNNYNNYYYNNNNYNYYNYNNYNNYYNNYNYNYNYNNYY", "NYNNYYNNNNNNNYNYNNYNNNYYNYNNNNNNNNNNNYNYNYYNYN", "YYNNYYNNYYYNNYNNNNYNNNYYNYNNYNNNYNNYNYNYNNYNNY", "YYNNYYNNYYYNNYYYNNYNYNYYNNNNYNNYYNNNYYNYNYNNYY", "NNNNNYNNNNNNNNNNNNNNNNNYNYNNNNNNNNNYNYNYNYYNNN", "NYNNYYNNNNYNNYNYNNYNYNYYNYNNNNNNYNNYNYNYNNNNNY", "NNNNYYNNNNNNNNNNNNYNNNYYNYNNNNNNNNNYNYNYNYYNNY", "YYYYYYNYYYYYYNYYNYNNYYNYYYYYYYYYYYYNYYNYNYYYYY", "NYYYNYNYYYYYNYYYNNYNYNYYYYYYYNYNYYYNYYNYNNYYYY", "NNNNNNNNNNNNNNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNNNN", "YYYYYYYYYNYYYYYYYYYNNYYYYYYNYYYNNYYNNYYYYNYNYN", "NYNNYYNNNNYNNYNYNNYNNNYYNYNNNNNNYNNYNYNYNNYNYY", "YNYYYYNYYYNYNYNYNYYNNNYYNYYYYNNNYYYNNYNYYYYYYY", "NYNNNYNNNNNNNNNNNNYNNNNYNYNNNNNNNNNYNYNYNYYNNY", "NNNNNYNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNNNNYNYYNNN", "YYNNYNNYNYYYYYNNNNYNYNNYNNYNYNYYYNYYYYNYNYYYYY", "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNYNNNYNNNN", "YYNNNYNNNYYNYYNNNNYNYNYYNNNNYNNNYYYNYNNYNYYNYY", "YYNYNYNYYNYNNYYYNNYNNNYYYYNNNNYYYYNYNYNYNYYNYY", "NYNNYNNNNNNNNYYNNNYNYNYYNYNNNNNNNNNNNYNYNYNNYY", "YNNNNYNYYYNNYNYYNNYNYNYYYYYYNNNNYYNYNYNYNYNYYY", "YYNNYNNNYYYNYYYYNNNNYNNYNYNNYNNYYNNNYYNYNYYNYY", "NYNNYYNNNNYNNYYYNNYNYNYYNNNNYNNNYNNYNYNYNYYNNY", "NYNNNNNNNNNNNYNYNNYNNNNYNYNNNNNNNNNYNYNYNYYNNY", "YYNNYYNNYYYYNYYNNNYNYNYYNYNNYNNNNNYYYNNYNYNNYY", "NYNNYYNNYYYYYNNYNNYNNNYYNYNNYNYYYNNNNYNYNYNNYY", "NNNNNYNNNNNNNYNNNNYNNNNYNNNNNNNNNNNNNYNYNYYNNN", "YYNNYNNNYYYYNNYNNNNNNNYYNYNNYNNYYNNNNYNYNYYNYN", "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", "NYYYYNNYYYYYYNNYYYYNNYYYYYYNYYYYYYYYYYNYYYYYNY", "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNYNNNNNNNN", "YNNYYNNYYYYYYYYYNNYNYNNYYNYYNYYYYNYYYYNYNYYYYY", "NNNNNYNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNYNNNNNNNN", "NNNNNYNNNNNNNNNNNNYNNNNNNYNNNNNNNNNNNYNYNNNNNN", "NYNNYYNYNYNYYNYYNNYNYNYYNYYNYNYYYYYNYYNNNNYNNY", "NYNNYYNNNNNNNYNNNNYNNNNYNYNNNNNNNNNYNYNYNYYNNY", "NNNNYYNNNNNNNYNNNNYNNNNYNYNNNNNNNNNYNYNYNYYNNN" ]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Changes and Logical Delete in View Maintenance

    Hi everybody. I've defined a table view maintenance V_TABLE for T_TABLE, with five fields. One of them is defined as 'R' (not editable field). I defined an event 05 and an event 02 (for create and save) where I move SY-DATUM to the CREATED_DATE or UP

  • STR-DH810, Panasonic plasma, and Wii

    Haven't seen any discussion in 2011 yet concerning the STR-DH810 AV receiver, so I think I'm safe posting a new message. Cannot get Nintendo Wii to display properly when connected through the receiver. Connection from Receiver-to-TV is a decent HDMI

  • Using BAPI_PO_RESET_RELEASE

    Dear all, I use BAPI_PO_RESET_RELEASE to cancel release a PO. but I found the STATUS in  Release strategy become  blank,instead of a yellow  triangle. Why? For example Code        Description               Status 01             staff                 

  • Does input level matter when it's a software/MIDI track?

    A real stupid question: When I'm recording a "software instrument" track (i.e. MIDI from my digital piano), does the input level matter? I.e. it's not an audio track so not important to get the level up to just below peaking? Or, should I still do th

  • Dreamweaver Background Updates

    I am using Dreamweaver CS3 for Mac and finding that it is overwriting files that have been modifoied by subcontractors I have hired. The 'pages' revert back, apparently to some copy that is hidden somewhere on my computer. I want to turn off this fea