eGate5.1 userInitialize()

Hi all,

I'm trying to execute the collaboration once I deploy the interface to logicalhost, is there any possibility to do so in eGate5.1? eGate4.5 has this userInitialize() function but not on this version. Anyone can guide or help me on this?

Thank you.

Regards,

Alex

[302 byte] By [RaDian06] at [2007-11-26 10:37:18]
# 1

You can do one of two things

1) add a constructor to your JCD. There is a toolbar button that will do that in teh JCD Editor Standard Mode, or you can do it by hand in teh siurce code mode. Bear in mind the restrictions on the constructor.

2) you can add an "initialisation section' conditional on a static class variable that gets synch-updated after the code executes once and causes teh code to never get executed again. A poor-man's user-initialise.

If you don't have what you need build it - it is Java fter all!

mczapski at 2007-7-7 2:48:17 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 2

Thanks for the reply but I don't think this is what I want.

Basically what I need is something to trigger a method or constructor when deploying the interface to logicalhost automatically , and not when running the JCD. This is able to be done in eGate4.5 with this userInitialize() method but not eGate5.1.

Help needed. Thank you.

RaDian06 at 2007-7-7 2:48:17 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 3

Then your only choice is the Constructor, which is executed at the object creation time, though it may not be until the MDB is actuallry triggered for teh first time - one would have to de-comple one and see.

You need to ask yourseve what yiu need to do in UserInitilize and work out if it can be done elsewhere, such as in a constructor or in a one-off conditional piece of code that is executed the first time the collaboration runs.

mczapski at 2007-7-7 2:48:17 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 4

The reason we need the userInitialize() method is to capture database connection string and display it on our ready made dashboard. The dashboard is mainly for our end-user to view it. So, executing while deploying the interface is the best option, and if worse come to worse, then probably will go for one-off like what you mentioned earlier.

But what do you mean by execute at the object creatioin time?

RaDian06 at 2007-7-7 2:48:17 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 5
hi radian06,how would you do "capture database connection string" in ICAN?i have searched for it but didnt find it.regards chris
ChrisBrennsteiner at 2007-7-7 2:48:17 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 6
use dbSource.getConnection().getMetaData().getURL()
RaDian06 at 2007-7-7 2:48:17 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 7

We've got the same requirement and you can use the scheduler eWay with a long period. After deployement you should get a trigger into a given JCD. Practically speaking, it is like a "one time trigger at startup".

Clearly, it will also trigger when the App Server restarts. It is not exactly what you need, but sounds close enough.

lerognon at 2007-7-7 2:48:17 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 8

Hi lerognon,

Thanks for the suggestion, indeed it was very helpful. But now I'm facing another problem, if I'm going to create a new new interface just to use the schedular eWay, how am I going to get the database connection string from other interface? Do you know any API that can do this?

Alex

RaDian06 at 2007-7-7 2:48:17 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...