You can try the following ideas :
- Keep checking log file output
INFO: Server startup in 26438 ms
, because it's the last log entry after a complete hybris start.
- Keep trying to connect/knocking for the 9002/9001 port either using netstat script or using java socket. (a successful connection means the server is up)
- There is an event in Hybris called
AfterTenantRestartEvent
, you can create a scriptjob as a listener for that event, then trigger your code when the event is catched.
public class MyAfterTenantStartupEventListener extends AbstractEventListener
{
private final List<AfterTenantRestartEvent> eventsRecorded = new ArrayList<AfterTenantRestartEvent>();
@Override
protected void onEvent(final AfterTenantRestartEvent event)
{
doSomething();
}
script Groovy, and insert it using an impex.
INSERT_UPDATE Script;code[unique=true] ;scriptType(code) ;content
;EventListenerScript ;GROOVY ;<EventListenerCode>
Then use this ImpEx to create a job.
INSERT_UPDATE ScriptingJob ;code[unique=true] ;scriptURI
;helloWorldScriptJob ;model://helloWorldScript
2.3. Cron Job
create an instance of the CronJobModel and attach to it the scripting job
INSERT_UPDATE CronJob ;code[unique=true] ;job(code) ;sessionLanguage(isocode) ;sessionUser(uid)
;helloWorldScriptCronJob ;helloWorldScriptJob ;en ;admin
More information:
https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/6.6.0.0/en-US/8c53e973866910149f7f95676060d3de.html?q=script%20listener
https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/6.6.0.0/en-US/07e3db4b90b24eb39522cb26ceb34544.html?q=script%20listener