cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
james_decosta
Level 9

Is it possible to stop the installation for a specified duration through some means

hi,
Is it possible through some means to stop the installation for a specified duration say 15 minutes through some means.
I believe my wish is absurd but still i want to know if i can achieve this through some means.
james.
Labels (1)
0 Kudos

(13) Replies
pv7721
Level 20

If you mean the actual install process I guess that you could call a custom code that would sleep for 15 minutes, but of course it won't make any sense for the end user installing your software!...
0 Kudos
james_decosta
Level 9

hi,

i want to stop the install process after i start jboss server so that when jboss starts up i can do some other related tasks.
james.
0 Kudos
pv7721
Level 20

You have to put your launching jboss in the installation task, than check when it has successfully launched, then you can proceed with your installation.
0 Kudos
james_decosta
Level 9

hi,
now i start jboss using this script:


execute script

call $USER_INSTALL_DIR$$/$bin$/$run.bat

Now i get the server console window

But i want to wait till i get this message:

jboss Started in 7 min...................................

Can you guide me how to achieve this.
james.
0 Kudos
pv7721
Level 20

I'm not sure what you're trying to accomplish, but IMHO you're going right into the wall. Say you want to do something else in those 7 minutes before launching Jboss. Say it works on your machine. But how can you be sure that any machine will match yours? There are slower, there are faster machines. So sometimes 7 minutes won't be enough and sometimes 1 minute is more than enough...
0 Kudos
james_decosta
Level 9

hi,
well i need to execute run.bat and wait till jboss starts up and when jboss starts up i initialise some thing and then start the web console of the deployed war/ear.

Is this possible through some means when jboss has started up,As i use the execute launch browser feature of installanywhere,but my problem the browser gets executed previous to starting up of jboss,
hence i want to stop the installer execution for about ten to fifteen minutes
so that my apps server gets started prior to opening of launchbrowser.exe
james.
0 Kudos
purcellk24
Level 7

I had to do this once waiting for WebLogic to start. You need a custom code action that just keeps checking the server with a time out.
Have the action poll your jboss server every 2 or 5 seconds. If you don't get a response back in say 15 minutes, then break out of the loop, display a message dialog and then do some error handling.
0 Kudos
james_decosta
Level 9

hi,
i would like to know how did you achieve this while dealing with weblogic.
If possible i would like to get the code you had used for dealing with weblogic.
Well i would like to get the sample code you had used for polling.

Regards,
james.
0 Kudos
purcellk24
Level 7

I know that this java code can be re-written, as I did this a couple of years ago and haven't tried to refactor it, but here is a sample. Every second, it wakes up and checks if the app is running, if the $TIMEOUT_MILLIS$ has not been reached.

I also set a variable after the while loop to tell me if I reached the timeout or if the app was started. Then I use that variable to display the appropriate message dialog.

import com.zerog.ia.api.pub.*;

public class WaitForAction extends CustomCodeAction
{
private static final long SLEEPTIME = 1000;

public void install(InstallerProxy ip) throws InstallException
{
String timeOut = ip.substitute("$TIMEOUT_MILLIS$");

int waittime;
if ((timeOut != null) && !timeOut.equals(""))
{
waittime = Integer.parseInt(timeOut);
}
else
{
waittime = 120000;
}

long starttime = System.currentTimeMillis();
long currenttime = System.currentTimeMillis();

while (currenttime < (starttime + waittime))
{
try
{
Thread.sleep(sleeptime);

// Do check for app running.
/* boolean started = (Is App Running?)
if (started)
{
waittime = 0;
}
*/
}
catch (Exception e)
{
// Do some error handling here.
e.printStackTrace():
}
finally
{
currenttime = System.currentTimeMillis();
}
}
}
}
0 Kudos
nnjcsc
Level 6

Delay(1); // 1 second
Delay(60); // 1 minute
Delate(3600) // 1 hour
etc........
0 Kudos
james_decosta
Level 9

hi,
can you share with me the code with which i can stop the installation for a specified time say 1 hour.
Say i want to stop the installation for 1 hour after starting jboss so that one of my application gets initialized properly.
Regards,
james
0 Kudos
nnjcsc
Level 6

I don't really have any code. I just use the built-in Delay() function. Look in up in help.

Add the Delay() after the code you are calling.
0 Kudos
nnjcsc
Level 6

Or you can do a loop, like a repeat and until the count reaches a certain point. Look up repeat and until in help.
0 Kudos