Someone was asking a while back about how to get the name of the current
application, here's how.

(please bear in mind this stuff is all completely proprietary to Orion and
will probably change just as often as they refactor the internals)

Try this as a JSP:

<%@ page import="javax.naming.*, com.evermind.server.administration.*" %>
<%
Context ctx = new InitialContext();
ApplicationAdministrator admin =
(ApplicationAdministrator)ctx.lookup("java:comp/Administrator");
%>
Application name: <%= admin.getDisplayName() %>

Poking around there is also a fun statistics object to get stats on your
app, ie:

<%
Map stats = admin.getStatistics();

Date uptime = new Date(((Long)stats.get("uptime")).longValue());
Date startTime = new Date(((Long)stats.get("starTime")).longValue())
%>

stats.get("logEvents") returns an object that I can't cast properly, but
this may lie at the heart of the logging matter mentioned previously.

As I mentioned before, reverse engineering / hacking your app server can
have harse consequences, only try it if you're as dumb as me ;)

Mike

PS Any tips from the Orion peopl always appreciated ;)


Reply via email to