users@glassfish.java.net

Non-web-based application; trying to get started

From: Richard Troy <rtroy_at_OneMedDb.com>
Date: Sun, 5 Feb 2012 10:41:34 -0800 (PST)

Hi All,

I'm wondering if Glassfish is a good fit for my application or not, and if
it can work, how I might go about implementing the solution I need in
Glassfish. So you understand what I'm looking to do, please forgive that I
begin at the beginning - I'll try not to bore you!

Way back in '97 I started writing an API in Java 1.0 that, as many apps
do, manages the contents of a database in a meaning ful way. Right from
the start I knew I needed an application-server architecture because,
while it would provide more overhead, it would make the database more
secure. But my customers weren't worried about what they saw as internal
security issues, so they kept me busy on other things and I added the
needed security using C that front-ended Java and provided encryption,
etc. (Some customers appreciated this.)

By 2002, Java RMI looked like it might be ready for prime-time, so I set
up the sample programs in my lab. It was instantly clear that I'd have to
write my own code that'd handle authentication and sessions management and
all the other things that make for a competent application-server - I can
certainly do this, but have few spare cycles for it. (The tech-bubble had
burst and revenues were down.) The API was getting to be large - some 30k
lines of code - and only 250 methods or so, but growing rapidly. By 2004
it looked like JINI might provide me the help in this arena that I needed,
and I began to prepare for the shift, changing all the methods from
returning JDBC ResultSets to returning Java Objects - no small feat, given
that the API was by then over 80k lines of code and had around 4000
methods.

By the time I got the API library reorganized and ready for the switch
sometime in 2005, it appeared that JINI had been redirected into something
different - and I abandoned the effort of trying to use it as an
application-server platform due to confusing information on what JINI
could do and, importantly, where JINI was going - what was it's reason
d'etre (sp?). I gathered, perhaps incorrectly, that it was at that time
oriented toward peer-to-peer networking for small devices, say, sensor
networks and the like.

Now I've got an opportunity by providing access via mobile platforms
(think Android) that absolutely requires an application-server type of
architecture, and it looks like Glassfish is solidly on track as an
"application-server" platform. Trouble is, the preoccupation with
web-based solutions is obscuring things for me - and this is why I'm
writing you now. For my application, adding in a web-layer would add
unacceptable overhead and needless complexity, so going that route is a
non-starter.

What I'm looking for is some machinery to help handle unsolicited
connect-requests, and some form of "thread" or "process" management. For
example, if the application-server were to instantiate for each new user
connection a new instance of a program I tell it about, I'm good to go,
especially if the mechanism lets me use RMI (or equivalent) to have a
Java-to-Java connection, so I don't have to do lower-level socket-based
handling of passed data values and their types. If it also did user
authentication in a way I can deal with, that's a plus, but I need some
flexability to use my existing mechanisms (ie, don't force me to use LDAP,
for example, because it's completely unnecessary and adds nothing of
value). Also, my application has no relationship whatsoever to Java EE, so
not forcing the use of it is also important.

...So, if Glassfish can help me, I would VERY much appreciate it if
someone can help give me a hand getting started - I'm competent and
insightful, just ignorant about Glassfish. I'm wondering what parts do I
want to focus my attention on, and what can I happily ignore completely?
Do I follow the basic guidelines for using RMI regarding client-side and
server-side code and develop a server half of my API and a corresponding
client half? Etc. What points, big picture, and fine detail, that you
think are important?

Or, is there another technology you know about I should be using instead?
For example, did I mis-understand JINI?

Thank you VERY much for your replies,
Richard