How to unmarshall using castor into an existing Bean without duplicates.

A

adam.corsaw

Here's the problem.

I have a program which takes an EAR file as input and generates an
install script.

I populate a bunch of JavaBeans based on information extracted from the
EAR file.

The user can change some mutable fields during the process and I have
off any settings they might have changed using Castor into an XML file.

When the user comes back in I want to read their changes in so they
don't have to setup the application again. They could have new EJBs or
a new role in their application so I can't just wipe out what I have
prepopulated with the saved settings.

The only thing I've come up with so far is to take the ArrayList of
beans and do a manual sync between the two lists of beans. I think
that's too ugly and there should be a better way than that.

I could write a custom .equals method for the beans and if it's the
same take the new version but I don't see where Castor is calling my
setMyProperty(ArrayList list) method.

Any suggestions or past experience with something like this would be
REALLY appreciated.

Thanks
 
R

Robert M. Gary

I have a program which takes an EAR file as input and generates an
install script.

Its funny how many of us do that. I'm sure Sun is not happy about it.
They invisioned a world where customers would buy a J2EE container and
guys like us would release ear files. That doesn't seem to have ever
caught on. No customer I've seen know what a J2EE container is or cares
what it is. They don't want ear files, they want InstallAnywhere CDs.
As a result we end up shipping J2EE containers like JBoss with hacked
up configuration so customers don't know a J2EE container is running. I
think the original marketing idea from Sun was that they could go into
production environments and sell their J2EE container without upsetting
the apps running on it. They thought end customers would administer the
J2EE containers themselves.

-Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top