cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Customer code in java application

Former Member
0 Kudos

Hi,

in my java application running on WAS 6.40 I want to call some customer code.

Basically I create a data structure (DOM XML tree) and want to pass this to customer code to be able to modify it as needed.

My idea would be to define an interface which would than be implemented by customer java classes. But how do I load these classes?

In theory I would create a configuration table in my app where the customer would specify the classname of his classes implementing this interface and I would do a Class.forName("...")

But those classes will be unknown to my application'S classloader, right? Because they won't be deployed with my application and I can't have references as I do not know if and what the customer will deploy. What's the best approach to this? WOuld EJBs help better?

Thanks

Bruno

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Bruno,

We did this for our application. We needed a weak reference from our deployable DC to a specific DC (e.g. DC\customerExit) The customer then creates this DC and adds their classes to it. Since it is a weak reference, it does not need to exist for your application to work. You can use the customizing to be able to lookup the specific class name that they created.

hope this helps,

Rich

Former Member
0 Kudos

Hi Bruno,

You can devlop the interface as EJB Component and then deploy it in the WAS. You can use this EJB in your WebDynpro application in 2 ways . either create the Web Service of the EJB and deploy it in the WAS and call it through Model in WEbDynpro or you can directly call the EJB , in this case you have to include the EJB file name in the Webdynpro Sharing reference property.

Hari