admin@glassfish.java.net

Next iTeam Meeting

From: Byron Nevins <byron.nevins_at_oracle.com>
Date: Thu, 18 Nov 2010 11:57:01 -0800

Instead of answering the questions in email -- I'll pose more this week
and answer everything next Tuesday.

Q: I know that I'm supposed to implement toString() for every class. I
also know that virtually no classes implement toString in GF code.
That's probably because it's hard and time-consuming. And can easily
get out of whack with source changes.

I want a utility method that will neatly lay out all of my object's
variables. I want the option of also printing out ALL of my ancestor's
variables. The formatting should be clean and readable. If I change my
class the output must change automatically. Obviously it must be
heavily tested and bug-free.

Oh yeah -- I want to do this in no more than one line of code.

A: How about this?

Class Modifiers Field Value

LinuxService private targetName
GlassFish_domain1
LinuxService (package) target
\etc\init.d\GlassFish_domain1
LinuxService private static final TEMPLATE_FILE_NAME
linux-service.template
LinuxService private killDirs
[C:\etc\rc0.d, C:\etc\rc1.d, C:\etc\rc6.d, C:\etc\rcS.d]
LinuxService private startDirs
[C:\etc\rc2.d, C:\etc\rc3.d, C:\etc\rc4.d, C:\etc\rc5.d]
LinuxService private sFile
S20GlassFish_domain1
LinuxService private kFile
K20GlassFish_domain1
NonSMFServiceAdapter private flattenedServicePropertes <null>
NonSMFServiceAdapter private templateFile
C:\glassfish3\glassfish\lib\install\templates\linux-service.template
ServiceAdapter private final tokenMap
{NAME=application/GlassFish/domain1, START_COMMAND=start-domain,
AS_ADMIN_PATH=C:/glassfi
sh3/glassfish/bin/asadmin.bat, ENTITY_NAME=domain1, OS_USER=bnevins,
FQSN=domain1C:\glassfish3\glassfish\domains, LOCATION_ARGS_RESTART=
--domaindir C:\glassfis
h3\glassfish\domains , CREDENTIALS= ,
LOCATION=C:\glassfish3\glassfish\domains,
RESTART_COMMAND=restart-domain, SERVICEUSER_STOP=, LOCATION_ARGS_STOP=
--domaind
ir C:\glassfish3\glassfish\domains , LOCATION_ARGS_START= --domaindir
C:\glassfish3\glassfish\domains , SERVICEUSER_START=su --login bnevins
--command ", DATE_C
REATED=Thu Nov 18 11:51:03 PST 2010, STOP_COMMAND=stop-domain, TYPE=Domain}
ServiceAdapter final info
com.sun.enterprise.admin.servermgmt.services.PlatformServicesInfo_at_167d940